MATLAB: Integrating sin(2x) in MATLAB

integration

Introduction:
I'm new to MATLAB and trying to learn how to integrate expressions.
Situation:
The expression to integrate is…..
sin(2x)
I'm entering the following code……
syms x
int(sin(2*x))
The answer MATLAB is displaying is…..
ans =
sin(x)^2
The answer I'm looking for is……. (-1/2)*cos(2x)+c

Best Answer

syms x
out = feval(symengine,'combine',int(sin(2*x)),'sincos')