Consider the following symbolic function:
>> f=@(x) sin(x)+2*cos(x)
Integrating the above function using "int" as follows,
>> syms x;>> fInt=int(f(x),x)
we get the following expression in R2015a and later releases :
fInt = -2*cos(x/2)*(cos(x/2) - 2*sin(x/2))
Whereas, the desired expression is 2*sin(x)-cos(x).
Here the obtained result differs from the desired result only by a constant of integration, but we are able to obtain the desired simplified expression by executing the same code on older releases (R2014b and previous) .
Why do the newer releases give a more complicated answer while the older releases are able to give the simpler answer?
Best Answer