[sympy] Expanding products of sqrts

2013-06-21 Thread Anton Loukianov
Hello, How do I expand products of square roots like this? import sympy as sp A1,A1 = sp.symbols('A1,A2', real=True, constant=True) coef1 = sp.sqrt(1/(A1**2 + A2**2 + sp.sqrt(A1**4 - A1**2*A2**2 + A2**4))) coef2 = sp.sqrt(1/(A1**2 + A2**2 - sp.sqrt(A1**4 - A1**2*A2**2 + A2**4)))

Re: [sympy] Expanding products of sqrts

2013-06-21 Thread Aaron Meurer
The issue is that sqrt(x)*sqrt(y) does not equal sqrt(x*y), unless x and y are positive (see http://docs.sympy.org/tutorial/tutorial/simplification.html#powers). Unfortunately, your assumptions that A1 and A2 are real is not enough for SymPy to deduce that the things under the square root are