Functions containing sine or cosine can be expressed as complex exponentials using
Euler's formula.
Example: suppose we wanted to integrate:

Then the cosine function can be expressed in its Euler form:


This is far easier to integrate.
Alternatively, we may also take note of real and imaginary portions of complex numbers
Cosine is the real portion of a complex number written in cos x + i sin x form