For example, in computing
$$\int_{Cr}\frac {\cos(z)}{(z^2+a^2)^2}dz$$
over a semi-circular contour, must I first look at
$$\int_{Cr}\frac {e^{iz}}{(z^2+a^2)^2}dz$$
compute this integral first, and then read off the real part of the answer?
What would be incorrect with just computing
$$\int_{Cr}\frac {\cos(z)}{(z^2+a^2)^2}dz$$
directly?
Thanks,
No, there is no hard and fast rule that says you need to consider re-writing the integrand using Euler's formula. You can consider writing the integrand in any form you wish. The key is being able to find a form on the integrand in which the parts you don't care about go to zero on your given contour $C_r$.
So for your example here (I don't know because I haven't worked it out) if you just consider the integrand as is it might be the case that over one part of $C_r$ the integral actually diverges as you extend the radius of $C_r$ to infinity.
Where as if you re-write the integrand using Euler's formula you might find that the integral actually converges as you extend the radius to infinity.