On Tuesday, December 11, 2012 3:15:31 AM UTC-5, [email protected] wrote: > > # Define > var('y'); var('x') > f(x,y)= -(x*y)*exp(-(x^2 + y^2)) > fdx(x,y) = derivative(f(x,y), x) > fdy(x,y) = derivative(f(x,y), y) > > # Check > print f(x,y)-f(y,x) > > # Compare these > print derivative(f(x,y), x).simplify_full() > print derivative(f(x,y), y).simplify_full() > > This will print > > 0 > (2*x^2 - 1)*y*e^(-x^2 - y^2) > (2*x*y^2 - x)*e^(-x^2 - y^2) > > Partly educated guess; the Pynac print order we use
sage: fdx (x, y) |--> 2*x^2*y*e^(-x^2 - y^2) - y*e^(-x^2 - y^2) sage: fdy (x, y) |--> 2*x*y^2*e^(-x^2 - y^2) - x*e^(-x^2 - y^2) makes it easy for Maxima to "guess" that y*e^(-x^2-y^2) factors out of the first expression but not the second, since the x is "hidden". But this is done in Maxima, in particular with fullratsimp sage: fdx.simplify_rational() (x, y) |--> (2*x^2 - 1)*y*e^(-x^2 - y^2) sage: fdy.simplify_rational() (x, y) |--> (2*x*y^2 - x)*e^(-x^2 - y^2) I wouldn't worry about it, since in general there is no way to define "simpler" expression that is fully useful at all times, and for more complicated expressions more detail work would be needed anyway. - kcrisman -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support?hl=en.
