I need to find a value of this definite integral: $$\int_0^\infty\frac{2-\cos x}{\left(1+x^4\right)\,\left(5-4\cos x\right)}dx.$$ Its numeric value is approximately $0.7875720991394284$, and lookups in Inverse Symbolic Calculator Plus and WolframAlpha did not return a plausible closed-form candidate.

Do you have any ideas how I can approach this problem?

  • $\begingroup$ Looks like you already have a value there. Do you have a particular reason to think it has a closed form? $\endgroup$ – Henning Makholm Sep 28 '13 at 23:55
  • 8
    $\begingroup$ @HenningMakholm One should always believe there is a closed form. It is just that some functions and constants are not yet well studied, understood and named :) $\endgroup$ – Vladimir Reshetnikov Sep 29 '13 at 0:06
  • 1
    $\begingroup$ @hmedan.mnsh Just to clarify: Mathematica does not return a closed form solution, but can give a numerical approximation using NIntegrate. $\endgroup$ – Vladimir Reshetnikov Sep 29 '13 at 0:31
  • 5
    $\begingroup$ @HenningMakholm It seems to me the phrase "you already have a value" is somewhat objectionable. A numerical integration in this case converges quite slowly, and I doubt that one can get more than $25$ correct digits in a reasonable time (and it would be a very difficult to make sure they all are indeed correct). On the other hand, having a closed form, I can compute $10^5$ digits in about a second. And I can be pretty sure all these digits are correct, because numerical algorithms for elementary functions have been thoroughly designed and polished for years, and verified for correctness. $\endgroup$ – Vladimir Reshetnikov Sep 29 '13 at 18:11
  • 5
    $\begingroup$ @StevenStadnicki I do not need $10^5$ digits, I used this number just to demonstrate the speed of calculations. But I can easily imagine that someone wants to get $30$ digits that are certainly correct. It is trivial task when one has an elementary closed form, but it might be quite difficult if one has to resort to numerical integration. Also, closed forms sometimes have a useful property to partially cancel each other or otherwise simplify when several factors or terms are combined into a single expression, while combining multiple approximate numeric values results in a precision loss. $\endgroup$ – Vladimir Reshetnikov Oct 1 '13 at 18:15

Yes, there is an elementary closed form for this integral: $$\int_0^\infty\frac{2-\cos x}{\left(1+x^4\right)\,\left(5-4\cos x\right)}dx=\frac{\pi}{2\,\sqrt2}\cdot\exp\left(\frac1{\sqrt2}\right)\cdot\frac{\sin\left(\frac1{\sqrt2}\right)-\cos\left(\frac1{\sqrt2}\right)+2\,\exp\left(\frac1{\sqrt2}\right)}{1-4\,\exp\left(\frac1{\sqrt2}\right)\cos\left(\frac1{\sqrt2}\right)+4\,\exp\left(\sqrt2\right)}\tag1$$


Let us denote the integral in question as $$\mathcal{I}=\int_0^\infty\frac{2-\cos x}{\left(x^4+1\right)\,\left(5-4\cos x\right)}dx\tag2$$ Note that the trigonometric part of the integrand is a periodic function and can be expanded to a Fourier series with particularly simple coefficients: $$\frac{2-\cos x}{5-4\cos x}=\sum_{n=0}^\infty\frac{\cos(n\,x)}{2^{n+1}}\tag3$$ (this can be easily checked by expressing cosines via exponents of an imaginary argument).

Now we can integrate it term-wise: $$\mathcal{I}=\sum_{n=0}^\infty\left(\frac1{2^{n+1}}\int_0^\infty\frac{\cos(n\,x)}{x^4+1}dx\right)=\sum_{n=0}^\infty\left(\frac1{2^{n+1}}\cdot\frac{\pi}{2\,\sqrt2}\cdot\exp\left(-\frac{n}{\sqrt2}\right)\cdot\left(\sin\left(\frac{n}{\sqrt2}\right)+\cos\left(\frac{n}{\sqrt2}\right)\right)\right)\tag4$$ (for the integral, see DLMF 1.14, vii, Table 1.14.2, $4^{th}$ row).

Trig functions in the last sum can again be expressed via exponents of an imaginary argument, and then the sum is easily evaluated. Converting exponents back to trig functions and getting rid of complex numbers, we get the final result $(1)$.

  • 16
    $\begingroup$ Clever expansion! $\endgroup$ – Ron Gordon Sep 29 '13 at 17:51
  • 14
    $\begingroup$ Very nice answer! $\endgroup$ – Start wearing purple Sep 29 '13 at 17:53

There is an alternate way to compute this integral w/o a summation over $n$ in the middle steps.


$$\frac{2-\cos z}{5 - 4\cos z} = \frac12 \left[\frac{(2-e^{iz})+(2-e^{-iz})}{(2-e^{iz})(2-e^{-iz})}\right] = \frac12\left[\frac{1}{2-e^{iz}} + \frac{1}{2-e^{-iz}}\right] $$ and $\displaystyle\;\frac{1}{1+z^4}$ is an even function, we have

$$\mathcal{I} \stackrel{def}{=} \int_0^\infty \frac{2-\cos x}{(1+x^4)(5-4\cos x)} dx = \frac12\int_{-\infty}^\infty \frac{1}{(1+z^4)(2 - e^{iz})}dz$$

Since $\displaystyle\;\frac{1}{2-e^{iz}}$ is entire on the upper half plane $\Im z \ge 0$ and $\displaystyle\;\left|\frac{1}{2-e^{iz}}\right| \le \frac{1}{2-1} = 1$ there, we can complete the contour in the upper half-plane and

$$\mathcal{I} = \lim_{R\to\infty}\frac12 \oint_{C_R} \frac{1}{(1+z^4)(2 - e^{iz})}dz \quad\text{ where }\quad C_R = [-R, R ] \cup \big\{\; Re^{i\theta} : \theta \in [0,\pi]\big\} $$

$\displaystyle\;\frac{1}{1+z^4}$ has $4$ poles $\omega_k = e^{\frac{(2k+1)i}{4\pi}}, k = 0..3$ over $\mathbb{C}$. Two of them $\omega_0 = \frac{1+i}{\sqrt{2}}$ and $\omega_1 = \frac{-1+i}{\sqrt{2}}$ belongs to the upper half-plane. Since

$$\frac{1}{1+z^4} = \sum_{k=0}^3 \frac{1}{(z-\omega_k) 4\omega_k^3} = -\frac14 \sum_{k=0}^3\frac{\omega_k}{z-\omega_k}$$

The residue of the integrand at $\omega_k$ are $\displaystyle\;-\frac14 \frac{\omega_k}{2 - e^{i\omega_k}}$ for $k = 0, 1$. This leads to

$$\begin{align} \mathcal{I} &= \frac12\left[ -\frac{2\pi i}{4}\left(\frac{\omega_0}{2 - e^{i\omega_0}} + \frac{\omega_1}{2 - e^{i\omega_1}} \right)\right]\\ &= \frac{-\pi i}{4\sqrt{2}}\left( \frac{1+i}{2 - e^{-1/\sqrt{2}} e^{i/\sqrt{2}}} + \frac{-1+i}{2 - e^{-1/\sqrt{2}} e^{-i/\sqrt{2}}}\right)\\ &= \frac{-\pi i}{4\sqrt{2}} \left[ \frac{ (1+i)(2 - e^{-1/\sqrt{2}} e^{-i/\sqrt{2}}) + (-1+i)(2 -e^{-1/\sqrt{2}} e^{ i/\sqrt{2}}) }{ 4 - 4 e^{-1/\sqrt{2}}\cos\left(\frac{1}{\sqrt{2}}\right) + e^{-\sqrt{2}} } \right]\\ &= \frac{\pi}{2\sqrt{2}} \left[ \frac{2 - e^{-1/\sqrt{2}}\left( \cos\left(\frac{1}{\sqrt{2}}\right) - \sin\left(\frac{1}{\sqrt{2}}\right) \right) }{ 4 - 4 e^{-1/\sqrt{2}}\cos\left(\frac{1}{\sqrt{2}}\right) + e^{-\sqrt{2}} } \right]\\ &= \frac{\pi e^{1/\sqrt{2}} }{2\sqrt{2}} \left[ \frac{2 e^{1/\sqrt{2}} - \left( \cos\left(\frac{1}{\sqrt{2}}\right) - \sin\left(\frac{1}{\sqrt{2}}\right) \right) }{ 4 e^{\sqrt{2}} - 4 e^{1/\sqrt{2}}\cos\left(\frac{1}{\sqrt{2}}\right) + 1 } \right] \end{align} $$ Reproducing what Vladimir get in his answer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.