risch: recognize Derivatives as components (#1012)
commit98b4fc903c867c3c0da968172fed4c3d454fdeac
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Sat, 16 Aug 2008 20:56:54 +0000 (17 00:56 +0400)
committerKirill Smelkov <kirr@landau.phys.spbu.ru>
Sat, 16 Aug 2008 20:56:54 +0000 (17 00:56 +0400)
tree25e96579c0e48f69c51c3f482b3e6e5c437cf0c6
parent17d0ad249c39637a82bb993f560c6754aa7a137c
risch: recognize Derivatives as components  (#1012)

If I understand it correctly, when heurisch sees f(x), it needs to extract f(x)
derivative and put it into set of terms. Each term is then called a new
variable and we do computations in their space.

But previously, components(Derivative(f(x),x), x) was only

    set([f(x), x])

instead of

    set([Derivative(f(x),x), f(x), x])

which resulted in that

    heurisch(f(x), x)  -> x⋅f(x)

I don't understand this stuff, but keeping Derivatives in a list of
components seems logical to me, and by the way, now heurisch is a bit
more clever:

In [1]: heurisch(f(x), x)

In [2]: heurisch(diff(f(x),x), x)
Out[2]: f(x)

In [3]: heurisch(f(x)*diff(f(x),x), x)
Out[3]:
 2
f (x)
─────
  2

In [4]: heurisch(diff(f(x),x) / f(x), x)
Out[4]: log(f(x))

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
CC: Mateusz Paprocki <mattpap@gmail.com>
Signed-off-by: Ondrej Certik <ondrej@certik.cz>
Signed-off-by: Mateusz Paprocki <mattpap@gmail.com>
sympy/integrals/risch.py
sympy/integrals/tests/test_integrals.py
sympy/integrals/tests/test_risch.py