Let f be a sum of symbolic expressions. One of the summands is

sage: a = ((z^3 - 10*z^2 + 17*z - 8)/(z^4 + z^3 + z^2 + z + 1)).integrate(z)
sage: a
integrate((z^3 - 10*z^2 + 17*z - 8)/(z^4 + z^3 + z^2 + z + 1), z)

which cannot be integrated. However, doing

sage: a.subs({z^4 + z^3 + z^2 + z + 1: (z^5-1)/(z-1)}).expand()

evaluates the integral.

How do I apply subs/expand only to the summands of f, which have
operator "integrate" and not to any other summand?

(I can only think of very complicated and long workarounds, so what is
the best way to do this?)

Best

Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to