Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to best simplify product of square roots

I'd like to simplify expressions like

p1,p2,p3 = var('p1 p2 p3')
assume(p1>0,p2>0,p3>0)
R = p1*p2*sqrt(p3)*sqrt(p3/p1)*sqrt(p3/p2)
R

without using R.canonicalize_radical(), which unfortunately messes up other factors. I understand there are some options using R.simplify_chain_real(), but what else can I try?

how to best simplify product of square roots

I'd like to simplify expressions like

p1,p2,p3 = var('p1 p2 p3')
assume(p1>0,p2>0,p3>0)
R = p1*p2*sqrt(p3)*sqrt(p3/p1)*sqrt(p3/p2)
R

without using R.canonicalize_radical(), which unfortunately messes up other factors. I understand there are some options using R.simplify_chain_real(), but what else can I try?

Let us see an example where also R.simplify_chain_real() messes things up:

p1,p2,p3 = var('p1 p2 p3')
assume(p1>0,p2>0,p3>0)
# R = p1*p2*sqrt(p3)*sqrt(p3/p1)*sqrt(p3/p2)
R = p1*p2*sqrt(p3)*sqrt(p3/p1)*sqrt(p3/p2)/((p1 - p3)*(p2 - p3)*(p3 - 1))
%display latex
from sage.manifolds.utilities import simplify_chain_real
simplify_chain_real(R)
#R