On Jun 19, 8:34 pm, Renato Coutinho <[email protected]> wrote:
> On Sun, Jun 19, 2011 at 9:30 PM, Chris Smith <[email protected]> wrote:
>
> > On Sun, Jun 19, 2011 at 7:05 PM, Renato Coutinho <[email protected]>
> > wrote:
>
> >> Hello,
>
> >> On Sun, Jun 19, 2011 at 3:51 PM, Mani Chandra <[email protected]> wrote:
> >> > Hi,
> >> > Is it possible to tell simplify that the partial derivatives with
> >> > respect to
> >> > two different variable commute so that it can simplify further? For ex:
> >> > d^2 f/dxdy + d^2 f/dydx
> >> > The above expression is left as it is by simplify(), but it would be
> >> > nice if
> >> > there were some way to tell it about the commutation so that it can
> >> > simplify
> >> > further.
>
> >> This is fixed in current development version, so that
>
> >> >>> f(x, y).diff(x, y) - f(x, y).diff(y, x)
> >> 0
>
> >> If you don't want this to happen, you have to use unevaluated
> >> derivatives (diff() always evaluates them):
>
> >> >>> Derivative(f(x, y), x, y) - Derivative(f(x, y), y, x)
> >> D(f(x, y), x, y) - D(f(x, y), y, x)
>
> > Notice that he used "+" not "-" -- does he want `2*D(f(x,y), x, y)` to be
> > returned?
>
> Yes, I think that's what he meant, and it works too, returning
> 2*D(f(x, y), x, y).

With current git I get the behavior

In [1]: x=Symbol('x')

In [2]: y=Symbol('y')

In [3]: f=Function('f')

In [4]: f(x,y).diff(x,y)-f(x,y).diff(y,x)
Out[4]: 0

In [5]: f(x,y).diff(x,y)+f(x,y).diff(y,x)
Out[5]:
     2
    d
2⋅─────(f(x, y))
  dy dx

In [6]:

However, this is a new behavior compared to just a couple weeks ago (I
could not say when exactly was the last time I used git pull). The new
behavior assumes that the partial derivatives of the function f(x,y)
are continuous everywhere. See e.g.
http://en.wikipedia.org/wiki/Symmetry_of_second_derivatives#Non-symmetry
Is this change intended?

Cheers,
Julien

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to