The subs for s = sqrt(x**2 + y**2 + z**2) should work.

To make the other one work, try subs(x**2, s**2 - y**2), followed by a call
to factor().

Aaron Meurer


On Fri, Apr 4, 2014 at 11:14 AM, Dave M <[email protected]> wrote:

> Hi
> I've tried subs() for this but it's not working for me. I have the
> following expression:
>
> j*(3*x**4 + 6*x**2*y**2 - 24*x**2*z**2 + 3*y**4 - 24*y**2*z**2 +
> 8*z**4)/(2*(x**2 + y**2 + z**2)**(9/2))
>
> I want to simplify it by making the substitutions r = sympy.sqrt(x*x + y*y
> + z*z) and s = sympy.sqrt(x*x + y*y) so that it becomes something like
>
> j/r**9*(4*z**2*(z**2 - 3*s**2) + 3/2*s**4)
>
> can this be done with sympy, and if so how?
> Thanks
>
>
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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/a1c4dbb4-0263-495b-9a54-18fd33c4d431%40googlegroups.com<https://groups.google.com/d/msgid/sympy/a1c4dbb4-0263-495b-9a54-18fd33c4d431%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAKgW%3D6KjfDLdzXgpviL_SVma5bR2eoUc2YMCr7EA10Q9gJBTVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to