MATLAB: Symbolic Toolbox: integration

integrationsymbolic

>> int('cos(x^2)^2')
Warning: Explicit integral could not be found.
ans =
int(cos(x^2)^2, x)
>> int('cos(2*x^2)')
ans =
(pi^(1/2)*fresnelC((2*x)/pi^(1/2)))/2
But there is a formula cos(2y)=2cos(y)^2)-1 and in first case MATLAB can't solve..
May be MuPAD forced to solve?

Best Answer

Apparently you have to do the substitution manually
int(simple(cos(x^2)^2))
Warning: Explicit integral could not be found.
Using the sincos version returned by
simple(cos(x^2)^2)
yields this
int(cos(2*x^2)/2 + 1/2)
ans =
x/2 + (pi^(1/2)*fresnelC((2*x)/pi^(1/2)))/4
I could not find where the sincos 'simplification' is available outside the simple command as it is in Maple...maybe this is the reason Maple returns the result automagically ;)
[edit for completeness]
int(feval(symengine, 'combine', cos(x^2)^2, 'sincos'))
ans =
x/2 + (pi^(1/2)*fresnelC((2*x)/pi^(1/2)))/4