Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

simplify equations

Hello,

i'm trying to simplify equations "eq" (http://pastie.org/5624251) under two assumptions. The result is supposed to be (1+ax+by+c*z) / 2

What am I doing wrong?

click to hide/show revision 2
added the code

simplify equations

Hello,

i'm trying to simplify equations "eq" (http://pastie.org/5624251) under two assumptions. The result is supposed to be (1+ax+by+c*z) / 2

sage: var('x,y,z,a,b,c')
(x, y, z, a, b, c)
sage: (x*x+y*y+z*z == 1).assume()
sage: (a*a+b*b+c*c == 1).assume()
sage: eq = abs( sqrt((1+c)*(1+z)) / 2 + (1-c)*(1-z)*sqrt((1+c)*(1+z)) / (2*(a-i*b)*(x+i*y)) ) ^ 2
sage: eq.simplify_full()
(I*((-8.0*I*a*b - 8.0*b^2)*c - 8.0*I*a*b - 8.0*b^2)*x*y*z + 4*(c^3 - c^2 - c + 1)*z^3 + 8.0*I*b*c^2*x + 8.0*I*b*x*z^2 + I*((-8.0*I*a*b - 8.0*b^2)*c - 8.0*I*a*b - 8.0*b^2)*x*y + (-(4.0*a^2 - 8.0*I*a*b - 4.0*b^2)*c - 4*a^2 + 8.0*I*a*b + 4.0*b^2)*y^2 + ((4.0*a^2 - 8.0*I*a*b - 4.0*b^2)*c + 4*a^2 - 8*I*a*b - 4.0*b^2)*x^2 - (4*c^3 - ((8*a - 8*I*b)*c^2 - 8*a)*x - ((8*I*a + 8.0*b)*c^2 - 8*I*a - 8.0*b)*y - 4*c^2 - 4*c + 4)*z^2 + 4*c^3 + (-8.0*a*c^2 + 8*a - 8*I*b)*x + ((-8*I*a - 8.0*b)*c^2 + ((8*I*a^2 + 8.0*a*b)*c + 8*I*a^2 + 8.0*a*b)*x + 8*I*a + 8.0*b)*y + (((8*I*a^2 + 8.0*a*b)*c + 8*I*a^2 + 8.0*a*b)*x*y + (-(4.0*a^2 - 8.0*I*a*b - 4.0*b^2)*c - 4*a^2 + 8.0*I*a*b + 4.0*b^2)*y^2 + ((4.0*a^2 - 8.0*I*a*b - 4.0*b^2)*c + 4*a^2 - 8*I*a*b - 4.0*b^2)*x^2 - 4*c^3 + 4*c^2 + 4*c - 4)*z - 4*c^2 - 4*c + 4)/(-32.0*I*a*b*x^2 + 32.0*I*a*b*y^2 - 32.0*I*b^2*x*y + 16*(a^2 - b^2)*x^2 + (32*I*a^2 + 64.0*a*b)*x*y - 16*(a^2 - b^2)*y^2)

What am I doing wrong?