Let's work on the integral

for which an implicit change of variable will be very useful:

Since the right hand side is just $\mathrm{d}x$, this change may always be applied. All implicit changes of variable of the type $h(t)=x$ are directly appliable; whether these changes simplify or complicate the integrand is more subtle. In this case, the change works like a charm

Our new integrand is indeed simpler: $\cos(2t)=\cos^2(t) – \sin^2(t) = 2\cos^2(t) – 1\Longrightarrow \cos^2(t)=\dfrac{1+\cos(2t)}{2}$, and

Now we undo our change (keep in mind that $\sin(2t)=2\sin t\cos t$)

Great!! Let's differentiate to check that everything is peachy