Euler's famous identity states that:
eix=cosx+isinx
Replacing x with −x, we get:
e−ix=cosx−isinx
We can then combine these 2 equations to obtain the following:
cosx=2eix+e−ix
sinx=2ieix−e−ix
The key here is that the trigonometric functions can be written in terms of exponential functions. When you combine trigonometric functions, things can often get very messy, but exponentials are generally far less messy when put together.
One can also make use of the real and imaginary parts of a complex number:
cosx=Re(eix)
sinx=Im(eix)
It may seem ironic, but introducing complex numbers can actually make many integration and summation problems simpler.
Let us apply the identity cosx=Re(eix):
∫excosxdx=∫exRe(eix)dx
∫excosxdx=Re∫exeixdx
∫excosxdx=Re∫e(i+1)xdx
∫excosxdx=Re[1+ie(1+i)x]+C
∫excosxdx=exRe[2eix(1−i)]+C
∫excosxdx=ex2cosx+sinx+C
We have successfully computed the integral without any integration by parts!
Let's apply the identiy sinx=2ieix−e−ix:
∫sin2xdx=∫(2ieix−e−ix)2dx
∫sin2xdx=∫−4e2ix−2+e−2ixdx
∫sin2xdx=2x+8i−e2ix+e−2ix+C
∫sin2xdx=2x−4sin(2x)+C
Normally, we would use the double-angle identity to reduce the power of the trigonometric functions, but this method is quite painless. In this particular simple example, there is no real benefit to using this method, but evaluating more complicated integrals may bring to light the utility of these identities.