# Revision history [back]

### full simplify, sage vs mathematica

I have this somewhat lengthy, but in principal trivial expression

sage: B = 1/4*(e^(sqrt(-2*cos(l) + 2)) + 1)*(I*sin(l) -
cos(l))*e^(-1/2*sqrt(-2*cos(l) + 2)) - 1/4*sqrt(-2*cos(l) +
2)*(e^(sqrt(-2*cos(l) + 2))*sin(l)^2/sqrt(-2*cos(l) + 2) +
I*e^(sqrt(-2*cos(l) + 2))*sin(l)*cos(l)/sqrt(-2*cos(l) + 2)
- (I*e^(sqrt(-2*cos(l) + 2)) - I)*sin(l) +
(e^(sqrt(-2*cos(l) + 2)) - 1)*cos(l) - I*e^(sqrt(-2*cos(l) +
2))*sin(l)/sqrt(-2*cos(l) + 2))/(e^(1/2*sqrt(-2*cos(l) +
2))*cos(l) - e^(1/2*sqrt(-2*cos(l) + 2))) +
1/8*sqrt(-2*cos(l) + 2)*((I*e^(sqrt(-2*cos(l) + 2)) -
I)*cos(l) + (e^(sqrt(-2*cos(l) + 2)) - 1)*sin(l) -
I*e^(sqrt(-2*cos(l) + 2)) + I)*(e^(1/2*sqrt(-2*cos(l) +
2))*sin(l)*cos(l)/sqrt(-2*cos(l) + 2) -
2*e^(1/2*sqrt(-2*cos(l) + 2))*sin(l) - e^(1/2*sqrt(-2*cos(l)
+ 2))*sin(l)/sqrt(-2*cos(l) + 2))/(e^(1/2*sqrt(-2*cos(l) +
2))*cos(l) - e^(1/2*sqrt(-2*cos(l) + 2)))^2 -
1/4*((I*e^(sqrt(-2*cos(l) + 2)) - I)*cos(l) +
(e^(sqrt(-2*cos(l) + 2)) - 1)*sin(l) - I*e^(sqrt(-2*cos(l) +
2)) + I)*sin(l)/(sqrt(-2*cos(l) + 2)*(e^(1/2*sqrt(-2*cos(l)
+ 2))*cos(l) - e^(1/2*sqrt(-2*cos(l) + 2))))


My humble understanding of full_simply() is, that it will 'kind of' make the 'simplest looking' expression from that.

sage: B.full_simply()
1/8*((e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 1)*cos(l)^3 -
3*(e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 1)*cos(l)^2 +
3*(e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 1)*cos(l) +
((-I*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - I)*cos(l)^2 +
(2*I*e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 2*I)*cos(l) -
I*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - I)*sin(l) + sqrt(cos(l) -
1)*((I*sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) -
I*sqrt(2))*cos(l)^2 + (-2*I*sqrt(2)*e^(I*sqrt(cos(l) -
1)*sqrt(2)) + 2*I*sqrt(2))*cos(l) +
((sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - sqrt(2))*cos(l) -
sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) + sqrt(2))*sin(l) +
I*sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - I*sqrt(2)) -
e^(I*sqrt(cos(l) - 1)*sqrt(2)) - 1)/(e^(1/2*I*sqrt(cos(l) -
1)*sqrt(2))*sin(l)^2 + 2*e^(1/2*I*sqrt(cos(l) -
1)*sqrt(2))*cos(l) - 2*e^(1/2*I*sqrt(cos(l) - 1)*sqrt(2)))


That doesn't look too much simpler. So I compared to Mathematica

sage: B._mathematica_().FullSimplify()
(I*Sin[l/2]^3*(Sqrt[1 - Cos[l]]*Cosh[Sin[l/2]] -
Sqrt[2]*Sinh[Sqrt[Sin[l/2]^2]]))/(E^((I/2)*l)*(1 - Cos[l])^(3/2))


Does this imply I really have to use Mathematica for such things?

 2 retagged FrédéricC 3595 ●3 ●36 ●72

### full simplify, sage vs mathematica

I have this somewhat lengthy, but in principal trivial expression

sage: B = 1/4*(e^(sqrt(-2*cos(l) + 2)) + 1)*(I*sin(l) -
cos(l))*e^(-1/2*sqrt(-2*cos(l) + 2)) - 1/4*sqrt(-2*cos(l) +
2)*(e^(sqrt(-2*cos(l) + 2))*sin(l)^2/sqrt(-2*cos(l) + 2) +
I*e^(sqrt(-2*cos(l) + 2))*sin(l)*cos(l)/sqrt(-2*cos(l) + 2)
- (I*e^(sqrt(-2*cos(l) + 2)) - I)*sin(l) +
(e^(sqrt(-2*cos(l) + 2)) - 1)*cos(l) - I*e^(sqrt(-2*cos(l) +
2))*sin(l)/sqrt(-2*cos(l) + 2))/(e^(1/2*sqrt(-2*cos(l) +
2))*cos(l) - e^(1/2*sqrt(-2*cos(l) + 2))) +
1/8*sqrt(-2*cos(l) + 2)*((I*e^(sqrt(-2*cos(l) + 2)) -
I)*cos(l) + (e^(sqrt(-2*cos(l) + 2)) - 1)*sin(l) -
I*e^(sqrt(-2*cos(l) + 2)) + I)*(e^(1/2*sqrt(-2*cos(l) +
2))*sin(l)*cos(l)/sqrt(-2*cos(l) + 2) -
2*e^(1/2*sqrt(-2*cos(l) + 2))*sin(l) - e^(1/2*sqrt(-2*cos(l)
+ 2))*sin(l)/sqrt(-2*cos(l) + 2))/(e^(1/2*sqrt(-2*cos(l) +
2))*cos(l) - e^(1/2*sqrt(-2*cos(l) + 2)))^2 -
1/4*((I*e^(sqrt(-2*cos(l) + 2)) - I)*cos(l) +
(e^(sqrt(-2*cos(l) + 2)) - 1)*sin(l) - I*e^(sqrt(-2*cos(l) +
2)) + I)*sin(l)/(sqrt(-2*cos(l) + 2)*(e^(1/2*sqrt(-2*cos(l)
+ 2))*cos(l) - e^(1/2*sqrt(-2*cos(l) + 2))))


My humble understanding of full_simply() is, that it will 'kind of' make the 'simplest looking' expression from that.

sage: B.full_simply()
1/8*((e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 1)*cos(l)^3 -
3*(e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 1)*cos(l)^2 +
3*(e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 1)*cos(l) +
((-I*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - I)*cos(l)^2 +
(2*I*e^(I*sqrt(cos(l) - 1)*sqrt(2)) + 2*I)*cos(l) -
I*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - I)*sin(l) + sqrt(cos(l) -
1)*((I*sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) -
I*sqrt(2))*cos(l)^2 + (-2*I*sqrt(2)*e^(I*sqrt(cos(l) -
1)*sqrt(2)) + 2*I*sqrt(2))*cos(l) +
((sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - sqrt(2))*cos(l) -
sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) + sqrt(2))*sin(l) +
I*sqrt(2)*e^(I*sqrt(cos(l) - 1)*sqrt(2)) - I*sqrt(2)) -
e^(I*sqrt(cos(l) - 1)*sqrt(2)) - 1)/(e^(1/2*I*sqrt(cos(l) -
1)*sqrt(2))*sin(l)^2 + 2*e^(1/2*I*sqrt(cos(l) -
1)*sqrt(2))*cos(l) - 2*e^(1/2*I*sqrt(cos(l) - 1)*sqrt(2)))


That doesn't look too much simpler. So I compared to Mathematica

sage: B._mathematica_().FullSimplify()
(I*Sin[l/2]^3*(Sqrt[1 - Cos[l]]*Cosh[Sin[l/2]] -
Sqrt[2]*Sinh[Sqrt[Sin[l/2]^2]]))/(E^((I/2)*l)*(1 - Cos[l])^(3/2))


Does this imply I really have to use Mathematica for such things?