On 06/10/2012 12:04 PM, Chris Smith wrote:
On Sun, Jun 10, 2012 at 9:22 PM, Alan Bromborsky<[email protected]>  wrote:
Consider the expression:

A = (-3.0*x**2*(x**2 + y**2 + z**2)**(-2.5) - 3.0*y**2*(x**2 + y**2 +
z**2)**(-2.5) - 3.0*z**2*(x**2 + y**2 + z**2)**(-2.5) + 3*(x**2 + y**2 +
z**2)**(-1.5))

factor_terms(simplify(A))
0

((x**2 + y**2 + z**2)**(2.5))*A = (-3.0*x**2 - 3.0*y**2 - 3.0*z**2 + 3*(x**2 + 
y**2 + z**2)**1.0)

which is again zero but sympy cannot simplify (x**2 + y**2 + z**2)**1.0 to
(x**2 + y**2 + z**2)
B=((x**2 + y**2 + z**2)**(2.5))*A - ((-3.0*x**2 - 3.0*y**2 - 3.0*z**2 + 3*(x**2 
+ y**2 + z**2)**1.0))
simplify(B)
0

/c

When I factor_terms(simplify(A)) where

A = -3.0*x**2*(x**2 + y**2 + z**2)**(-2.5) - 3.0*y**2*(x**2 + y**2 + z**2)**(-2.5) - 3.0*z**2*(x**2 + y**2 + z**2)**(-2.5) + 3*(x**2 + y**2 + z**2)**(-1.5)

I get

A = -(-(-3.0*x**2 - 3.0*y**2 - 3.0*z**2)*(x**2 + y**2 + z**2)**1.5 - 3.0*(x**2 + y**2 + z**2)**2.5)*(x**2 + y**2 + z**2)**(-4.0)

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