# Simplify integral considering only the real part

I happened to stumble on the following simplification of an integral:

$$\frac{1}{\pi} \int_{0}^{\infty} dx \ e^{-ax} \cdot \cos(kx) = \frac{1}{\pi} Re \left[ \int_{0}^{\infty} dx \ e^{x (ik - a)} \right]$$

According to my reasoning: $$\cos(kx) = \frac{1}{2} \left( e^{ikx} + e^{-ikx} \right)$$, so the term on the exponent on the right side comes somehow from the first term of the complex form of $$\cos(kx)$$, but the second term gets cancelled, why?

Consider first $$e^{ikx} = \cos(kx) + i \sin(kx)$$ then you can easily deduce that $$Re(e^{ikx}) = \cos(kx).$$