Comment #3 on issue 2516 by [email protected]: Bug on collect()
http://code.google.com/p/sympy/issues/detail?id=2516

As noted in the discussion, the wrong result is obtained when 'u' below is replaced with a variable that starts with a lower case letter:

    >>> e
    (D**3*a + D**3*b + a*u**3 + b*u**3)/Re
    >>> for aa in [A, AA, Aa, aaA, aAa, aA, c]:
    ...  print aa, collect(e.subs(u, aa).expand(), [aa**3/Re, D**3])
    ...
    A A**3*(a + b)/Re + D**3*(a/Re + b/Re)
    AA AA**3*(a + b)/Re + D**3*(a/Re + b/Re)
    Aa Aa**3*(a + b)/Re + D**3*(a/Re + b/Re)
                              ^
[space inserted for clarity; compare first term below with last term above]
             V--------------/
    aaA D**3*(a + b) + aaA**3*(a + b)/Re
    aAa D**3*(a + b) + aAa**3*(a + b)/Re
    aA D**3*(a + b) + aA**3*(a + b)/Re
    c D**3*(a + b) + c**3*(a + b)/Re

--
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