Establishing a bound in the complex plane so my function is $$f(z)= \frac{e^{iz}}{z^2+a^2} $$
What is getting to me and probably I should've been comfortable with this fact is how they establish this upper bound:
$$\bigg|\int_{0}^{\pi} f(Re^{i\theta})Re^{i\theta} d\theta\bigg| \leq R \int_0^{\pi} \frac{e^{-Rsin\theta}d\theta}{R^2 - a^2} \leq \frac{(\pi)R}{R^2 - a^2}$$
 A: First you parametrize the upper half circle as $z=Re^{i\theta}$ then see this

$$ \big|e^{i(x+iy)}\big| = e^{-y} = e^{-R\sin(\theta)} $$

and

$$ |z^2+a^2| \geq |z|^2-|a|^2 = R^2-a^2 \implies \frac{1}{|z^2+a^2|}\leq \frac{1}{ R^2-a^2}. $$

Can you know collect the above inequalities together to find the bound.
A: We have the triangle inequality
$$ \left\lvert \int_a^b f(z) \, dz \right\rvert \leqslant \int_a^b \lvert f(z) \rvert \lvert dz \rvert. $$
Taking each piece separately,
$$ \left\lvert \frac{1}{R^2 e^{2i\theta}+a^2} \right\lvert \leqslant \frac{1}{R^2-a^2}, $$
if $R>a$, because $|e^{i\theta}|\leqslant 1$, so the smallest the denominator can be is $|a^2+(-1)R^2|=R^2-a^2$.
$$ \lvert e^{i Re^{i\theta}} \rvert = \lvert e^{iR\cos{\theta}-R\sin{\theta}}\rvert = e^{-R\sin{\theta}}, $$
because $|e^{iy}|=1$ for real $y$.
$$ \lvert R e^{i\theta} \rvert = R, $$
for the same reason. So far we have done the first inequality. The second just follows by noting that $e^{-R\sin{\theta}}\leqslant 1$, so the integral is bounded by the integral of $1$ over the interval, which is $\pi$.
