integral of (1-cos^2 x) dx
might be easy but i need to make sure
The trick here is to rewrite cos^2x as (1+cos(2x))/2 -- which is a trig identity.
So we have
int(1-cos^2x) dx = int(1 - (1+cos(2x))/2) dx
= int(1) dx - (1/2)int(1+cos(2x)) dx
= x - (1/2)(x + (1/2)sin(2x)) + C
= x - x/2 -(1/4)sin(2x) + C
= x/2 - (1/2)sin(x)cos(x) + C
= (1/2)(x - sin(x)cos(x)) + C
The second to last step was also a trig identity. sin(2x)=2sin(x)cos(x). So (1/4)sin(2x) = (1/4)(2sin(x)cos(x))=(1/2)sin(x)cos(x)
Then I factored the (1/2) to make the answer look a bit neater.
We'll use a nifty identity: cos 2x = 2cos^2 x - 1 so cos^2 x = (1/2)(cos 2x + 1)
integral of (1-cos^2 x)
= integral of 1 - integral of cos^2 x
= x - integral of (1/2)(cos 2x + 1)
= x - (1/2) integral of (cos 2x + 1)
= x - (1/2) [integral of cos 2x + integral of 1]
= x - (1/2) [(1/2) sin 2x + x] + Constant
= (1/2)x - 1/4 sin 2x + Constant