On 11 ago, 00:13, Aaron Meurer <asmeu...@gmail.com> wrote: > Perhaps the use() function can do what you want. Here's the docstring: > > use(expr, func, level=0, args=(), kwargs={}) > Use ``func`` to transform ``expr`` at the given level. > > Example > ======= > > >>> from sympy import use, expand > >>> from sympy.abc import x, y > > >>> f = (x + y)**2*x + 1 > > >>> use(f, expand, level=2) > x*(x**2 + 2*x*y + y**2) + 1 > >>> expand(f) > x**3 + 2*x**2*y + x*y**2 + 1
Thanks. I will test if "use" can be used in my case. > > By the way, if you are using this to map integrate() across an Add, > might I suggest that this is a bad idea. It turns out that you cannot > just do this, like you can with derivatives. The reason is that you > can have a sum for which each term it does not have an expressible > integral, but the whole sum does. No, "mapexpr" is being use to simplify the result of "integrate", so the user has many options to see the final result. Best regards, Roberto -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.