2

How to compute $\int\limits_{-\pi/2}^{\pi/2} \cos(\tan x)\,dx$?

I tried the usual Riemann integral method but could not figure out and thought of contour integral and seemed working. But whenever I tried to find the residue at the essential singularity of $f(z)=\cos (\tan z)$ at $\frac{\pm \pi}{2}$, I got stuck there.

Did
  • 284,245

4 Answers4

4

HINT:

Let $I$ be the integral given by

$$\begin{align} \int_{-\pi/2}^{\pi/2}\cos(\tan(x))\,dx&=\int_{-\infty}^\infty \frac{\cos(x)}{1+x^2}\,dx\\\\ &=\text{Re}\left(\int_{-\infty}^\infty \frac{e^{ix}}{x^2+1}\right)\,dx \end{align}$$

Now, use contour integration by closing the contour in the upper half plane.

SPOILER ALERT: Scroll over the highlighted area to reveal the solution

Let $J$ be the contour integral of $\frac{e^{iz}}{z^2+1}$ over the closed contour $C$, where $C$ is comprised of $(i)$ the real line from $-R$ to $R$, and $(ii)$ the semicircle in the upper-half plane with radius $R$ and centered at the origin. Then, $J$ is given by $$\begin{align}J&=\oint_C \frac{e^{iz}}{z^2+1}\,dz\\\\&=\int_{-R}^R \frac{e^{ix}}{x^2+1}\,dx+\int_0^\pi \frac{e^{iRe^{i\phi}}}{R^2e^{i2\phi}+1}\,iRe^{i\phi}\,d\phi\\\\&=2\pi i \text{Res}\left(\frac{e^{iz}}{z^2+1}, z=i\right)\\\\&=2\pi i \frac{e^{-1}}{2i}\\\\&=\frac{\pi}{e}\end{align}$$Taking the limit as $R\to \infty$ and taking the real part shows that $$\int_{-\infty}^\infty \frac{\cos(x)}{x^2+1}\,=\frac{\pi}{e}$$

Mark Viola
  • 184,670
2

For a non-complex solution: Using the sub $\tan x\mapsto x$ we get the integral $$\int_{-\infty}^{\infty} \frac{\cos x}{1+x^2}$$

Introduce the parameter $$f(\alpha) = \int_{-\infty}^{\infty} \frac{\cos (\alpha x)}{1 + x^2} \, \mathrm{d}x$$

Now differentiate: $$f'(\alpha) = -\int_{-\infty}^{\infty} \frac{x\sin (\alpha x)}{1+x^2} \, \mathrm{d}x$$

And again

$$\begin{align*}f''(\alpha) &= -\int_{-\infty}^{\infty} \frac{x^2 \cos (\alpha x)}{1+x^2} \, \mathrm{d}x \\ & =-\int_{-\infty}^{\infty} \frac{(x^2+1) \cos (\alpha x) - \cos (\alpha x)}{1+x^2} \, \mathrm{d}x \\ &= \int_{-\infty}^{\infty}\frac{ \cos (\alpha x)}{1+x^2} \, \mathrm{d}x - \int_{-\infty}^{\infty} \cos \alpha x \, \mathrm{d}x\\ & = f(\alpha)\end{align*}$$

This gives $f''(\alpha) -f(\alpha) = 0$ and so $$f(\alpha) = ae^{\alpha} + be^{-\alpha}$$

But $f(0) = a+b = \pi$ and $\lim_{\alpha \to \infty} = 0 \Rightarrow a = 0 $ so $$f(\alpha) = \pi e^{-\alpha}$$

Now recover your integral using $f(1) = \pi e^{-1}$.

Zain Patel
  • 17,200
  • 5
  • 29
  • 59
  • 1
    To improve this answer, analyze the problem with limits from $-L$ to $L$. Then, at the end, let $L\to \infty$. Also, $\int_{-L}^L \cos(\alpha x),dx\ne 0$. – Mark Viola Jul 31 '16 at 19:45
  • @Dr. MV Thank you, I can see the issue, I'll fix it in a bit. (I think a quick bout of IBP should do it) – Zain Patel Jul 31 '16 at 19:48
  • This is not right (or incomplete, at least). One can't differentiate $f(\alpha)$ under the integral sign because the integrand's partial derivative with respect to $\alpha$ is not an $L^1$ function, so the well-known "differentiate under the integral sign" theorem does not apply. So, you should find some other means to justify that (if possible, I don't think that this is at all easy to do). Things get even worse with $f''(\alpha)$. –  Jul 31 '16 at 20:09
  • @AhmedHussein Analysis can proceed by using limit $-L$ to $L$. – Mark Viola Jul 31 '16 at 20:19
  • @Dr.MV I don't see how. Can you please elaborate? –  Jul 31 '16 at 20:22
  • @AhmedHussein Then, Feynman's Trick is valid. I don't know if it facilitates the solution, but it is worth trying. – Mark Viola Jul 31 '16 at 20:28
  • @Dr.MV ok. It is possible then to find that $f(\alpha) = 2\tan^{-1} L e^{-\alpha}$, where we choose $L$ of the form $k\pi/\alpha$, then taking limits, things should work. I am not sure about how one would fill in the details for a rigorous argument, though. –  Jul 31 '16 at 21:04
1

Let $u=\tan x$, then it can be turned to $$\frac{1}{2}\int_{-\infty}^\infty\frac{e^{iu}}{1+u^2}du+\frac{1}{2}\int_{-\infty}^\infty\frac{e^{-iu}}{1+u^2}du$$

For the first integral, integrate along an upper semicircle in the counter-clockwise direction to give $$\frac{1}{2}2\pi i \frac{e^{-1}}{2i}$$ For the second integral, integrate along a lower semicircle in the clockwise direction to give $$\frac{1}{2}(-2\pi i)\frac{e^{-1}}{-2i}$$ Hence the sum is $$I =\frac{\pi}{e}$$

velut luna
  • 10,162
1

Following the expression obtained by Dr. MV, here's one more way to find the integral.

Let $\mathcal F\{ f(x) \} (t)$ denote the evaluation of the Fourier transform of $f$ at $t$, i.e.

$$\mathcal F \{f(x)\}(t) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} f(x) e^{-itx} dx$$

We have:

$$\int_{-\infty}^{\infty} \frac{e^{ix}}{1+x^2} dx = \sqrt{2 \pi} \mathcal{F} \left\{ \frac1{1+x^2} \right\} (-1)$$

It is easy to find:

$$\mathcal{F} \left\{ e^{-|x|} \right\} (t) = \sqrt{\frac{2}{\pi}} \frac1{1 + t^2}$$

Using the inversion formula on $L^1$, we find:

$$\mathcal{F} \left\{ \frac1{1+x^2} \right\} (t) = \sqrt{\frac{\pi}2} e^{-|t|}$$

Thus,

$$\int_{-\infty}^{\infty} \frac{e^{ix}}{1+x^2} dx = \pi e^{-1} = \pi/e = \Re \left( \int_{-\infty}^{\infty} \frac{e^{ix}}{1+x^2} dx\right) = \int_{-\infty}^{\infty} \frac{\cos x}{1+x^2} dx$$