# Integration by transforming to complex

Evaluate the following by transforming it into a complex integral:

$$\int_{-\infty}^{\infty} \frac{\cos 4x}{x^4+5x^2+4}dx.$$

Could someone show me where to start? This is not homework, it's a study question for an exam and my professor didn't post the solution

• Note that the denominator is $(x+i)(x-i)(x+2i)(x-2i)$ so you know where the poles are. Hint: answer = $\frac{\left(2 e^4-1\right) \pi }{6 e^8}$ – David G. Stork May 16 at 19:48
• I wanted to add: you can check the final answer for a question like this using Wolfram Alpha. – The Count May 17 at 0:56

Let's get you started.

Your integral is equal to the real part of the integral

$$\int_{-\infty}^{\infty} \frac{e^{4ix}}{x^4+5x^2+4}dx.$$

This integral appears (sort of) in the following (surprisingly easier-to-play-with) equation:

$$\int_L \frac{e^{4iz}}{z^4+5z^2+4}dz=\lim\limits_{R\to\infty}\left(\int_{-R}^{R} \frac{e^{4iz}}{z^4+5z^2+4}dz+\int_{C_R} \frac{e^{4iz}}{z^4+5z^2+4}dz\right),$$

where $$L$$ is the curve consisting of the real line and the positively-oriented half-circle in the upper-half plane, $$C_\infty$$. Note that along the real axis, $$z=x$$.

The integrand has four simple poles, at $$z=\pm i$$ and at $$z=\pm 2i$$. Both positive poles are in your contour. For the left side of the equation, find their residues from the Residue Theorem. Then for the right side, show that the integral over $$C_R$$ goes to $$0$$ in the limit (at least, it should...). Then take the real part of both sides, and you will be left with your result.

EDIT: Between this and the wonderful picture provided by David G. Stork, you should be well on your way.

• TheCount: Ummm... aren't you missing a factor of $4$ in the exponent in the numerator? – David G. Stork May 16 at 20:30
• Oh goodness, yes thanks. Fixed. – The Count May 16 at 20:31
• @DavidG.Stork What did you think of the answer in general? I'm practicing communicating contour terminology effectively. – The Count May 16 at 20:48
• From a beginner perspective, I thought the answer was great. – Ovi May 17 at 0:45
• Thanks Ovi, I aim to help beginners specifically. – The Count May 17 at 0:46

A comment (so don't downvote) for @TheCount.

When in doubt, draw a picture (worth 1000 words):

And for completeness, the answer is:

$$\frac{(2 e^4 -1)\pi}{6 e^8}$$

• Very nice. Thanks for this! I'm sure OP will find it helpful. +1 – The Count May 16 at 21:58