Status: Accepted
Owner: asmeurer
CC: mattpap
Labels: Type-Defect Priority-Medium Integration Polynomial

New issue 2132 by asmeurer: Derivative of RootSum
http://code.google.com/p/sympy/issues/detail?id=2132

diff does not work at all with RootSum. This makes it impossible to reverse integrate() whenever it returns that. For example:

In [16]: a = RootSum(z**5 - z**2 + 1, Lambda(z, z*log(x - z)))

In [17]: a
Out[17]:
       ⎛ 5    2                        ⎞
RootSum⎝z  - z  + 1, Λ(z, z⋅log(x - z))⎠

In [18]: a.diff(x)
Out[18]:
d ⎛       ⎛ 5    2                        ⎞⎞
──⎝RootSum⎝z  - z  + 1, Λ(z, z⋅log(x - z))⎠⎠
dx

In [19]: a.diff(z)
Out[19]:
d ⎛       ⎛ 5    2                        ⎞⎞
──⎝RootSum⎝z  - z  + 1, Λ(z, z⋅log(x - z))⎠⎠
dz

But the derivative of x is just a rational function:

In [27]: b = (-5+4*x)/(1-x+x**5)

In [28]: b
Out[28]:
-(5 - 4⋅x)
──────────
         5
1 - x + x

In [29]: integrate(b, x)
Out[29]:
       ⎛ 5                            ⎞
RootSum⎝t  - t + 1, Λ(t, t⋅log(x - t))⎠

The derivative with respect to z should be even easier: it's just 0, since z is a dummy variable.

Now, fixing diff(z) should be trivial, but I don't know exactly how to compute the derivative with respect to x. This requires a bit more algebraic machinery than I currently know of. Mateusz, do you know how this might be done? I know that it can be done, because Maple can do it:

a:=sum(r*log(x - r), r=RootOf(_Z**5 - _Z + 1));
                                -----
                                 \
                                  )
                  a :=           /             r ln(x - r)
                                -----
                                 /  5         \
                       r = RootOf\_Z  - _Z + 1/
diff(a, x);
                                  -5 + 4 x
                                 ----------
                                          5
                                 1 - x + x

At any rate, it should at least return RootOf(poly, Lambda_expr.diff(x)).

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to