Sympy rewriting

37 views
Skip to first unread message

Paul Royik

unread,
Dec 9, 2014, 6:28:29 PM12/9/14
to sy...@googlegroups.com
What function should I use to rewrite 2/(a*(u**2 + 1) - b*(u**2 - 1)) into 2/((a-b)*u**2+(a+b))?


Thanks.

Aaron Meurer

unread,
Dec 9, 2014, 7:39:31 PM12/9/14
to sy...@googlegroups.com
Use expand() and collect(), like collect(expand(expr), u).

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/86982404-4901-4fe3-8a24-0273cc6e80f1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages