Kernel: SageMath 9.4
I was showing my students a famous calculus example of an integral that can be computed in one order of the variables but not in the other. Knowing that SageMath can compute anything, the students suggested trying the integral the "wrong" way. The "right" way is
In [1]:
-1/2*cos(1) + 1/2
The "wrong" way is
In [2]:
-1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I - sqrt(-I)*((I + 1)*sqrt(2)*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2)*(-1)^(1/4)*e^I) + I*sqrt(2)*e^I - 2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 2*(-1)^(1/4))*e^(-I)
In [3]:
-1/16*(-1)^(3/4)*((sqrt(2) + 4*(-1)^(1/4))*e^I - sqrt(-I)*((I + 1)*sqrt(2)*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2)*(-1)^(1/4)*e^I) + I*sqrt(2)*e^I - 2*(-1)^(1/4)*e^(2*I) - (I + 1)*sqrt(2) - 2*(-1)^(1/4))*e^(-I) == -1/2*cos(1) + 1/2
In [5]:
False
In [6]:
0.229848847065930 - 4.16333634234434e-17*I
In [7]:
0.229848847065930
In [8]:
True
In [9]:
0
In [0]: