Open beew opened 1 year ago
So what is the exact issue ? Which one of these is incorrect ? Note that sage tries all of these and returns the first that gives an answer. In this case, the answer comes from giac
. The answer from sympy
is just that it cannot do that, so it's fine.
Note that the derivative of fricas
answer can be simplified to
cos(x)/(1/2*b^2*cos(-2*a + 2*x) - 1/2*b^2 + 1)^(3/2)
So how do you know which one is correct if the answer depends on which algorithms you use? Also the fricas solution is presented in such horrendous form is there a way to simplify it to gives a compact answer like Mathematica gives?
They all seem to be different representations of the same function. So they are all correct. One is just a nicer expression than the others.
One way to simplify it to a not so horrendous form is to use the .simplify_trig()
(or .simplify_full()
) methods.
They all seem to be different representations of the same function. So they are all correct. One is just a nicer expression than the others.
One way to simplify it to a not so horrendous form is to use the
.simplify_trig()
(or.simplify_full()
) methods.
integrate(cos(x)/(1 - (b^2)*(sin(x - a))^2)^(3/2),x, algorithm="fricas").simplify_trig()
((2*cos(a)^2 - 1)*b^2*cos(x)^2*sin(a) - b^2*cos(a)^2*sin(a) - 2*(cos(a)^3 - cos(a))*b^2*cos(x)*sin(x) + (b^3*cos(a)*cos(x)*sin(a) - (b^3*cos(a)^2 - b)*sin(x))*sqrt(2*b^2*cos(a)*cos(x)*sin(a)*sin(x) + (2*cos(a)^2 - 1)*b^2*cos(x)^2 - b^2*cos(a)^2 + 1) + sin(a))/(b^5*cos(a)^2 - (cos(a)^2 + 1)*b^3 - ((2*cos(a)^2 - 1)*b^5 - (2*cos(a)^2 - 1)*b^3)*cos(x)^2 - 2*(b^5*cos(a)*sin(a) - b^3*cos(a)*sin(a))*cos(x)*sin(x) + b)
integrate(cos(x)/(1 - (b^2)*(sin(x - a))^2)^(3/2),x, algorithm="fricas").simplify_full()
((2*cos(a)^2 - 1)*b^2*cos(x)^2*sin(a) - b^2*cos(a)^2*sin(a) - 2*(cos(a)^3 - cos(a))*b^2*cos(x)*sin(x) + (b^3*cos(a)*cos(x)*sin(a) - (b^3*cos(a)^2 - b)*sin(x))*sqrt(2*b^2*cos(a)*cos(x)*sin(a)*sin(x) + (2*cos(a)^2 - 1)*b^2*cos(x)^2 - b^2*cos(a)^2 + 1) + sin(a))/(b^5*cos(a)^2 - (cos(a)^2 + 1)*b^3 - ((2*cos(a)^2 - 1)*b^5 - (2*cos(a)^2 - 1)*b^3)*cos(x)^2 - 2*(b^5*cos(a)*sin(a) - b^3*cos(a)*sin(a))*cos(x)*sin(x) + b)
None give a nice compact output.
Steps To Reproduce
a, b = var('a b')
integrate(cos(x)/(1 - (b^2)*(sin(x - a))^2)^(3/2), x)
Expected Behavior
It should return
or something equivalent. This can be verified either by differentiation or integrating manually.
Mathematica gives
Which is easily seen to be equivalent
Actual Behavior
sage gave
integrate(cos(x)/(1 - (b^2)*(sin(x - a))^2)^(3/2), x, algorithm="fricas")
returns
integrate(cos(x)/(1 - (b^2)*(sin(x - a))^2)^(3/2), x, algorithm="maxima")
returns
integrate(cos(x)/(1 - (b^2)*(sin(x - a))^2)^(3/2), x, algorithm="sympy")
just returns the input.
Additional Information
No response
Environment
Checklist