On Sat, Jul 16, 2011 at 8:58 AM, Matthew Rocklin <[email protected]> wrote:

> How can I separate an expression like
> a*(x+y) + x
> into terms involving only x and only y
> (a+1)*x , a*y
>
> This seems like the kind of function SymPy probably has.  I'm having
> trouble finding it.
>

    >>> eq
    a*(x + y) + x
    >>> collect(eq.expand(), x, y)
    a*y + x*(a + 1)

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

Reply via email to