I am to solve the following integral:
$$\int_{-\infty}^\infty \frac {\cos^2 (x)}{x^2 + 1} dx$$
We use contour integration in combination with residue calculus, so for $R > 1$ ($R$ is the radius of the contour/curve $C$) we get the ML-inequality:
$$\left|\oint\limits_C \frac{1+e^{2iz}}{z^2 + 1} dz\right| \le \frac{2 \pi R}{R^2 -1}$$
Now to simplify the first integral we can use the equality $\cos^2 (x) = \frac{\cos (2x) +1}{2}$
Also $\cos(2x)$ can be simplified further as follows: $\cos(2x) = \frac{1}{2} (e^{i2x}+e^{-i2x})$
As a hint for solving this problem it is given that $e^{i2x} = e^{i2z}$, and this is where my question arises. Why exactly is this last equality valid? Or in other words, why can we write the expression as $f(z) = \dfrac{1 + e^{i2z}}{1 + z^2}$?
Idea is to think of the the real numbers as a subset of the complex numbers. You are integrating along the real axis, so $z=x+i0$