SymPy isn't simplifying is because sqrt(x*y) isn't equal to sqrt(x)*sqrt(y) in general (e.g., if x and y are negative).
You can force this simplification use expand_power_base(force=True): In [12]: expand_power_base(sqrt((n*n-19)*(x**3+x**2*y**5))/sqrt(x**3+x**2*y**5), force=True) Out[12]: _________ ╱ 2 ╲╱ n - 19 Aaron Meurer On Sun, Jul 31, 2016 at 4:47 PM, hogehoge <[email protected]> wrote: > I would like to reduction to common denominator in following case. > > sqrt((n*n-19)*(x**3+x**2*y**5))/sqrt(x**3+x**2*y**5) ---> sqrt( n*n - 19 ) > > > In [4]: sqrt((n*n-19)*(x**3+x**2*y**5))/sqrt(x**3+x**2*y**5) > Out[4]: > ________________________ > ╱ ⎛ 2 ⎞ ⎛ 3 2 5⎞ > ╲╱ ⎝n - 19⎠⋅⎝x + x ⋅y ⎠ > ─────────────────────────── > ____________ > ╱ 3 2 5 > ╲╱ x + x ⋅y > > In [5]: ratsimp(Out[4]) > Out[5]: > _____________________________________ > ╱ 2 3 2 2 5 3 2 5 > ╲╱ n ⋅x + n ⋅x ⋅y - 19⋅x - 19⋅x ⋅y > ──────────────────────────────────────── > ____________ > ╱ 3 2 5 > ╲╱ x + x ⋅y > > > How can I simplify Out[4]? > > > > In [8]: simplify(Out[4]*Out[4]) > Out[8]: > 2 > n - 19 > > > But I don't know How to reduction to common denominator in Out[4]. > Could you tell me how to reduce to common denominator in Out[4]? > > -- > 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 https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/9747fec4-cad0-4083-9810-6d7450e7aaff%40googlegroups.com. > 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 https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JMTQvMkjKNUz-0WxCDtxH88092MVt%3DzV2NS_5vaMs20A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
