# $\int_0^\infty \frac{\cos(tx)}{(x^2 - 2x + 2)}\,\mathrm{d}x$ for $t$ real

This was a question on an old prelim exam in complex analysis: compute

$$\int_0^\infty \frac{\cos(tx)}{x^2 - 2x + 2}\,\mathrm{d}x$$

for $t$ real. I've tried…

• Residue calculus—it's easy to integrate the similar $\int_0^\infty \frac{\cos(tx)}{x^2+2} \mathrm{d}x$ largely because the integrand is even, but this integrand isn't. Similarly $\int_0^\infty \frac{\sin(tx)}{x^2+2} \mathrm{d}x$ seems hard. Even if the original integral was from $1$ to $\infty$, so the denominator was even about $x=1$, we seem to need this latter, hard integral involving $\sin(tx)$.
• Mathematica—even for $t=1$, it gives the answer in terms of $$\int_0^z \frac{\sin(t)}{t}\,\mathrm dt \quad \text{and}\quad \int_0^z \dfrac{\cos(t)}{t}\,\mathrm dt,$$ which is not helpful.
• Looked through Gamelin's Complex Analysis text for inspiration; everything close used even or odd integrands.
• Googling/searching here, though it's hard to search for such a specific type of integral.

There's a chance there's just a typo on the old prelim, for what it's worth.

• +1 for one of the best formatted and well explained first posts.. Jul 18, 2013 at 6:54
• Decomposing into partial fractions you should get several complex exponential integrals. Jul 18, 2013 at 7:11
• @Ethan, have you tried? The path to hell is paved with «should»s... Jul 18, 2013 at 7:23
• @Argon I'm sure I copied it correctly. As I mentioned in the question, it might be a typo in the exam. Jul 18, 2013 at 22:44
• @O.L. You're entirely correct, my apologies, and thanks! I've updated the question (see the residue calculus bullet point). If I've done so incorrectly, please let me know. At this point I'm convinced the original problem either had a typo or was just a bad problem. Thank you for your time. Jul 19, 2013 at 0:03

The integral is even in $t$, so I will assume $t\ge0$. \begin{align} &\int_0^\infty\frac{\cos(tx)}{x^2-2x+2}\,\mathrm{d}x\\ &=\int_{-1}^\infty\frac{\cos(tx+t)}{x^2+1}\,\mathrm{d}x\\ &=\frac1{2i}\int_{-1}^\infty\left(\frac1{x-i}-\frac1{x+i}\right)\cos(tx+t)\,\mathrm{d}x\\ &=\frac1{2i}\int_{-1-i}^\infty\frac{\cos(tx+t+it)}{x}\,\mathrm{d}x\\ &-\frac1{2i}\int_{-1+i}^\infty\frac{\cos(tx+t-it)}{x}\,\mathrm{d}x\\ &=\frac1{2i}\cos(t+it)\int_{-1-i}^\infty\frac{\cos(tx)}{x}\,\mathrm{d}x -\frac1{2i}\sin(t+it)\int_{-1-i}^\infty\frac{\sin(tx)}{x}\,\mathrm{d}x\\ &-\frac1{2i}\cos(t-it)\int_{-1+i}^\infty\frac{\cos(tx)}{x}\,\mathrm{d}x +\frac1{2i}\sin(t-it)\int_{-1+i}^\infty\frac{\sin(tx)}{x}\,\mathrm{d}x\\ &=-\frac1{2i}\cos(t+it)\mathrm{Ci}(-t-it) -\frac1{2i}\sin(t+it)\left(\frac\pi2-\mathrm{Si}(-t-it)\right)\\ &\hphantom{=}+\frac1{2i}\cos(t-it)\mathrm{Ci}(-t+it) +\frac1{2i}\sin(t-it)\left(\frac\pi2-\mathrm{Si}(-t+it)\right) \end{align} This matches what Mathematica computes.

If the integral was over the entire real line, the answer would avoid $\mathrm{Ci}$ and $\mathrm{Si}$. In fact, using contour integration, we get \begin{align} \int_{-\infty}^\infty\frac{\cos(tx)}{x^2-2x+2}\,\mathrm{d}x &=\int_{-\infty}^\infty\frac{\cos(tx+t)}{x^2+1}\,\mathrm{d}x\\ &=\cos(t)\int_{-\infty}^\infty\frac{\cos(tx)}{x^2+1}\,\mathrm{d}x \color{#C00000}{-\sin(t)\int_{-\infty}^\infty\frac{\sin(tx)}{x^2+1}\,\mathrm{d}x}\\ &=\cos(t)\,\mathrm{Re}\left(\int_{-\infty}^\infty\frac{e^{itx}}{x^2+1}\,\mathrm{d}x\right)\color{#C00000}{-0}\\ &=\cos(t)\,\mathrm{Re}\left(\frac1{2i}\int_\gamma\left(\frac1{x-i}-\frac1{x+i}\right)e^{itx}\,\mathrm{d}x\right)\\ &=\cos(t)\,\mathrm{Re}\left(\frac1{2i}\int_\gamma\frac{e^{itx}}{x-i}\,\mathrm{d}x-\frac1{2i}\int_\gamma\frac{e^{itx}}{x+i}\,\mathrm{d}x\right)\\ &=\cos(t)\,\mathrm{Re}\left(\frac1{2i}2\pi i e^{-t}-0\right)\\[6pt] &=\pi\cos(t)\,e^{-t} \end{align} Where $\gamma$ is the contour along the real axis and circling back counter-clockwise around the upper half-plane.

This may have been the intended question.

• I'm tempted to accept this as the answer since changing the lower limit of integration from $0$ to $-\infty$ makes the problem so reasonable and would be an easy typo to make. I'll probably do so shortly. Thank you for your time! Jul 20, 2013 at 1:33

Note that $$\int_0^\infty \frac{\cos(tx)}{x^2 - 2x + 2}\,\mathrm{d}x$$

can be written as $$\int_0^\infty {\frac{{\cos tx}}{{{{\left( {x - 1} \right)}^2} + 1}}} {\mkern 1mu} {\text{d}}x$$ so $x-1=u$ gives $$\int_{ - 1}^\infty {\frac{{\cos \left( {u + 1} \right)t}}{{{u^2} + 1}}} {\mkern 1mu} {\text{d}}u = \int_{ - 1}^\infty {\frac{{\cos tu\cos t - \sin tu\sin t}}{{{u^2} + 1}}} {\mkern 1mu} {\text{d}}u$$ which means we need to know what $$\int_{ - 1}^\infty {\frac{{\cos tu}}{{{u^2} + 1}}} {\mkern 1mu} {\text{d}}u$$ and $$\int_{ - 1}^\infty {\frac{{\sin tu}}{{{u^2} + 1}}} {\mkern 1mu} {\text{d}}u$$ are.

Note that $$\int_{ 0}^\infty {\frac{{\cos tu}}{{{u^2} + 1}}} {\mkern 1mu} {\text{d}}u$$ is not hard, similarily for the other, so we are worried about the remaining part in $[-1,0]$ mostly. By $u\mapsto -u$ we are looing at\eqalign{ & \phi \left( t \right) = \int_0^1 {\frac{{\cos tu}}{{{u^2} + 1}}} {\mkern 1mu} {\text{d}}u \cr & \eta \left( t \right) = \int_0^1 {\frac{{\sin tu}}{{{u^2} + 1}}} {\mkern 1mu} {\text{d}}u \cr}

In red you can see $\eta$; in grey $\phi$. Note that \eqalign{ & \phi - \phi '' = \int_0^1 {\cos tu} {\mkern 1mu} {\text{d}}u =\frac{\sin t}t \cr & \eta - \eta '' = \int_0^1 {\sin tu} {\mkern 1mu} {\text{d}}u=\frac{1-\cos t}t \cr} ADD Recall that $$\int_0^\infty {\frac{{\cos tx}}{{{x^2} + 1}}} {\mkern 1mu} {\text{d}}x = \frac{\pi }{2}{e^{ - \left| x \right|}}$$

I'm trying to remember what the other integral (with $\sin$) evaluates to.

• Indeed it turns out that $\eta$ involves the exponential integral. Jul 19, 2013 at 4:24
• @sos440 Ah, here's the Master of integrals to save us all!
– Pedro
Jul 19, 2013 at 4:36
• @sos440 What can I do to get as good as you at recognizing integrals? I have tried everything except changing my name to sos450.
– user14082
Jul 19, 2013 at 5:20
• @PeterTamaroff Perhaps this is what you are looking for with $\sin$: math.stackexchange.com/a/69059/27624 Jul 19, 2013 at 5:44
• I guess the integrand is meant to go from $-\infty$ to $\infty$ then there is a closed form for the integral. Jul 19, 2013 at 12:32