collect: Add support for higher-than-1 order Derivatives
commitdf5f8b3baa07017e95c935d848043681b6770952
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Sat, 30 Aug 2008 18:55:15 +0000 (30 22:55 +0400)
committerKirill Smelkov <kirr@landau.phys.spbu.ru>
Sat, 30 Aug 2008 18:55:15 +0000 (30 22:55 +0400)
treea180244200d832c62d6aad69739378d528877a29
parent7e0866f383c0f8ea082e3809ed548f34c5bd741c
collect: Add support for higher-than-1 order Derivatives

We still can't properly handle multivariate expressions, but the
following should work:

In [1]: a,b=symbols('ab')

In [2]: D = Derivative

In [3]: e = a*D(f(x), x,x) + b*D(f(x), x,x)

In [4]: e
Out[4]:
     2               2
    d               d
a⋅─────(f(x)) + b⋅─────(f(x))
  dx dx           dx dx

In [5]: collect(e, D(f(x),x))
Out[5]:
        d ⎛d       ⎞
(a + b)⋅──⎜──(f(x))⎟
        dx⎝dx      ⎠

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Cc: Mateusz Paprocki <mattpap@gmail.com>
Signed-off-by: Ondrej Certik <ondrej@certik.cz>
sympy/simplify/simplify.py
sympy/simplify/tests/test_simplify.py