8

A few months ago I was messing around with integrals of the form $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^{2n}+1}dx}\text{ ,where }n\in\mathbb{N}$$ You can use the residue theorem to get that the value is $$\frac {-i\pi} n\sum_{k=0}^{n-1}{e^{\frac{\pi i(2k+1)}{2n}+ie^{\frac{\pi i(2k+1)}{2n}}}}$$ This can be simplified to $$\frac \pi n \sum_{k=0}^{n-1}{\sin\left(\frac{\pi(2k+1)}{2n}+\cos\left(\frac{\pi(2k+1)}{2n}\right)\right)e^{-\sin\left(\frac{\pi(2k+1)}{2n}\right)}}$$ which is the simpliest form of the sum I could come up with. Note that deriving this formula is not what I am asking in this question. I wonder if this can be simplified further.

Using this formula to evaluate the first few integrals gives the following: $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^2+1}dx} = \frac \pi e$$ $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^4+1}dx} = \pi \frac{\sin{\left(\frac{1}{\sqrt2}\right)}+\cos{\left(\frac{1}{\sqrt2}\right)}}{\sqrt 2 e^{\frac{1}{\sqrt 2}}}$$ $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^6+1}dx} = \pi \frac{1+\sqrt{3e}\sin{\left(\frac{\sqrt3}{2}\right)}+\sqrt{e}\cos{\left(\frac{\sqrt 3}{2}\right)}}{3 e}$$ I can not find any way to simplify any 'higher' integral to a "nice" form like the first three. For example, if you evaluate $n=4$ with the formula you get this expression: $$\frac{\pi}{2}\left(e^{-\sin\left(\frac{\pi}{8}\right)}\sin\left(\frac{\pi}{8}+\cos\left(\frac{\pi}{8}\right)\right)+e^{-\sin\left(\frac{3\pi}{8}\right)}\sin\left(\frac{3\pi}{8}+\cos\left(\frac{3\pi}{8}\right)\right)\right)$$ Sure, you can expand the sine and cosine expressions but it does not really help that much because of the exponents of $e$.

I tried plugging the $n=4$ integral into several computer algebra systems such as wolframalpha but none of them were able to give a simple expression of the value. In fact, if I got a value at all, the expressions were incredibly long and had a lot of complex numbers within them (which should not be there if it was simplified since it is a real integral). Therefore, I do not believe that there is an explicit form, but I am curious if anybody here has any ideas. This type of math is quite new to me, so it is probable that I have missed something obvious lol. Thanks in advance.

Alex
  • 422
  • 7
    Welcome to Math.SE. Excellent first question – Sine of the Time Jan 02 '25 at 19:54
  • 3
    Just mentioning that a proof for your formula can be found here: https://math.stackexchange.com/a/793577/42969 – Martin R Jan 02 '25 at 20:04
  • 4
    Executing in Maple Pi/(n*I)*sum(exp(Pi*I*(2*k+1)/(2*n)+I*exp(Pi*I*(2*k+1)/(2*n))),k=0..n-1); simplify(eval(%,n=4)); latex(%); yields a manifestly real expression for $n = 4$: $$\frac{\pi \left({\mathrm e}^{-\sin \left(\frac{\pi}{8}\right)} \sin ! \left(\frac{\pi}{8}+\cos ! \left(\frac{\pi}{8}\right)\right)+{\mathrm e}^{-\sin \left(\frac{3 \pi}{8}\right)} \sin ! \left(\frac{3 \pi}{8}+\cos ! \left(\frac{3 \pi}{8}\right)\right)\right)}{2} .$$ – Travis Willse Jan 02 '25 at 20:32
  • 3
    For general n and $n\neq 0$ solution is:,using Mathematica code: \[Pi] FoxH[{{{0, 1}, {2 n, -2 n}}, {{n, -n}}}, {{{0, 1}}, {{n, -n}}}, 1] + \[Pi] FoxH[{{{0, -2 n}, {1, 1}}, {{0, -n}}}, {{{1, 1}}, {{0, -n}}}, (-1)^(-2 n)]. – Mariusz Iwaniuk Jan 02 '25 at 21:30
  • 1
    One might be able to construct an asymptotic formula for large $n$. The first term is cheap: As $n \to \infty$, the integrand approaches $\chi_{[-1, 1]} \cos x$, so $\lim_{n \to \infty} \int_{-\infty}^\infty \frac{\cos x}{x^{2n}+1}dx = \int_{-1}^1 \cos x ,dx = 2 \sin 1$. – Travis Willse Jan 04 '25 at 20:34
  • I've expanded my previous comment into an answer (well, a too-long-for-a-comment post, at least). – Travis Willse Jan 06 '25 at 03:05
  • You might consider the final expression in Answer 2 How to evaluate ... – Hanno Jan 08 '25 at 12:34
  • This question is similar to: How do you solve this $\int\limits ^{\infty }_{0}\frac{\cos( x)}{x^{n} +1} dx,\ n >0$. If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. – Sine of the Time Jan 28 '25 at 22:56

3 Answers3

4

As noted in the comments, the formula you're looking for is proven in this answer, which addresses the value of your integral for the case $n = 2$. I hope to provide a clearer explanation in my answer.

Proof that $\int_{-\infty}^\infty \frac{\cos x}{x^{2n}+1} \, dx = \frac{\pi}{n} \sum_{k=0}^{n-1} e^{-\sin\left( \frac{2k+1}{2n} \pi \right)} \sin\left( \frac{2k+1}{2n} \pi + \cos\left( \frac{2k+1}{2n} \pi \right) \right)$

The integral above can be understood as the real part of $$ \int_{-\infty}^\infty \frac{e^{ix}}{x^{2n}+1} \, dx. $$ For $R > 0$, let $\eta_R$ be the contour defined by the directed line segment from $-R$ to $R$, followed by the semicircle $\Gamma_R$ in the upper half-plane from $R$ to $-R$, forming a simple and closed curve in the complex plane. Consider the contour integral $$ \int_{\eta_R} \frac{e^{iz}}{z^{2n}+1} \, dz = \int_{-R}^R \frac{e^{iz}}{z^{2n}+1} \, dz + \int_{\Gamma_R} \frac{e^{iz}}{z^{2n}+1} \, dz, $$ As $R \to \infty$, since $|e^{iz}| \leq 1$ when $\text{Im}(z) \geq 0$, the numerator has absolute value at most 1 on $\Gamma_R$, and we observe that $$ \left| \int_{\Gamma_R} \frac{e^{iz}}{z^{2n}+1} \, dz \right| \le \frac{2\pi R}{R^{2n} - 1} \to 0. $$ Thus, the contour integral and the desired integral coincide as $R \to \infty$. For any $R > 1$, the contour integral becomes the sum of the residues of the poles in the upper half-plane, by the residue theorem: $$ \int_{\eta_R} \frac{e^{iz}}{z^{2n}+1} \, dz = 2\pi i \sum_{w^{2n} + 1 = 0, \, \Re(w) > 0} \lim_{z \to w} \left( (z - w) \frac{e^{iz}}{z^{2n}+1} \right). $$

The poles in the upper half-plane are located at $w_k = e^{\frac{2k+1}{2n} \pi i}$ for $k = 0, 1, \dots, n-1$, and the remaining poles are for $w_k$ with $k = n, n+1, \dots, 2n-1$. To find an explicit formula for the integral, we first perform partial fraction decomposition on the integrand's denominator: $$ \frac{e^{iz}}{z^{2n}+1} = \sum_{k=0}^{n-1} \frac{e^{iz}}{2n \left( e^{\frac{2k+1}{2n} \pi i} \right)^{2n-1} \left( z - e^{\frac{2k+1}{2n} \pi i} \right)}. $$

Therefore, the sum of the residues is: $$ \int_{\eta_R} \frac{e^{iz}}{z^{2n}+1} \, dz = \frac{\pi i}{n} \sum_{k=0}^{n-1} \frac{e^{i e^{\frac{2k+1}{2n} \pi i}}}{\left( e^{\frac{2k+1}{2n} \pi i} \right)^{2n-1}}. $$ By simplifying this expression and taking the real part, we arrive at the desired result for $\int_{-\infty}^\infty \frac{\cos x}{x^{2n}+1} \, dx.$

  • 1
    You should explain further why the integral of the semicircle goes to zero, as $|e^{iz}|$ is not $1$ when $z\not\in\mathbb R$ – Bruno Andrades Jan 03 '25 at 03:38
  • And the upper bound should be $\frac{{2\pi R}}{{R^{2n} - 1}}$. – Gary Jan 03 '25 at 04:22
  • 1
    @Gary you are correct, I noticed that when I was typing my answer, but I forgot to correct it. Bruno, I will provide more details on the partial fractions calculation and the limit of the integral on the semicircle, thank you for the feedback. – Gabriel Franceschi Libardi Jan 03 '25 at 11:38
  • Thank you for the answer. I did derive this formula myself and it is included in the post. I am essentially wondering if this is the simpliest formula for the integral or if it is possible to simplify the sum even more (I doubt there is). – Alex Jan 03 '25 at 16:08
  • I think you can further simplify this, however this remains to be a sum $\int_{\eta_R} \frac{e^{i z}}{z^{2 n}+1} d z=\frac{\pi i}{n} \sum_{k=0}^{n-1} \frac{e^{i e^{\frac{2 k+1}{2 n} \pi i}}}{\left(e^{\frac{2 k+1}{2 n} \pi i}\right)^{2 n-1}} = -\frac{\pi i}{n} \sum_{k=0}^{n-1} w_n ,e^{i w_n}$. – EngineerMathlover Jan 05 '25 at 09:39
  • 1
    This is interesting @EngineerMathlover, I think this summation can be further simplified by generatingfunctionology. – Gabriel Franceschi Libardi Jan 07 '25 at 11:56
3

Too long for a comment: A nicer closed form for the sun may not be available, but with a little work we can compute asymptotic formulae for the limiting cases as the exponent approaches $0$ (from the positive side) or $\infty$.

Since the integrand is even, we may as well consider $$I(m) := \int_0^\infty \frac{\cos x \,dx}{1 + x^m};$$ the positivity of the denominator means we may as well ask about general parameter values $m > 0$ and not just positive, even integers.

Integrating by parts gives $$I(m) = m \int_0^\infty \frac{x^{m - 1} \sin x \,dx}{(1 + x^m)^2} ,$$ which turns out to be more convenient for asymptotic analysis.

Asymptotics as $m \searrow 0$

The integrand extends continuously to $0$ from the right, so $\lim_{m \searrow 0} I(m) = 0$, and computing the (right) derivatives at $m = 0$ gives:

  • $\lim_{m \searrow 0} I'(m) = \frac14 \int_0^\infty \frac{\sin x \,dx}{x} = \frac\pi8$,
  • $\lim_{m \searrow 0} I''(m) = 0$,
  • $\lim_{m \searrow 0} I'''(m) = -\frac38 \int_0^\infty \frac{\log^2 x \sin x}{x} = - \frac\pi{64} \left(\pi^2 + 12 \gamma^2\right)$.

Substituting in a Taylor expansion gives an asymptotic expansion as $m \searrow 0$, $$\boxed{I(m) \sim \frac\pi8 m - \frac\pi{384} \left(\pi^2 + 12 \gamma^2\right) m^3 + \cdots} ,$$ where $\gamma$ denotes the Euler-Mascheroni constant and $\cdots$ denotes a remainder in $O(m^4)$ (in fact in $O(m^5)$).

Asymptotics as $m \to \infty$

Our form for $I(m)$ in terms of $\sin$ suggests the substitution $u = x^m$, which gives $$I(m) = \int_0^\infty \frac{\sin (u^M) \,du}{(1 + u)^2}, \qquad M := \frac1m .$$ Again it's not difficult to compute an expansion in $M$: \begin{align} \lim_{m \to \infty} I(m) = \left.\int_0^\infty \frac{\sin (u^M) \,du}{(1 + u)^2}\right\vert_{M = 0} &= \sin 1 \int_0^\infty \frac{du}{(1 + u)^2} = \sin 1 \\ \frac{d}{dM} \left.\int_0^\infty \frac{\sin (u^M) \,du}{(1 + u)^2}\right\vert_{M = 0} &= \int_0^\infty \frac{u^M \log u \cos(u^M)}{(1 + u)^2} = \cos 1 \int_0^\infty \frac{\log u}{(1 + u)^2} = 0 \\ \frac{d^2}{dM^2} \left.\int_0^\infty \frac{\sin (u^M) \,du}{(1 + u)^2}\right\vert_{M = 0} &= \int_0^\infty \frac{u^M \log^2 u [\cos(u^M) - \sin(u^M)] \,du}{(1 + u)^2} \\ &= -(\sin 1 - \cos 1) \int_0^\infty \frac{\log^2 u}{(1 + u)^2} = \frac{\pi^2}{3} (\cos 1 - \sin 1) . \end{align} Substituting in a Taylor expansion and rewriting the expression in terms of $m$ give an asymptotic expansion as $m \to \infty$, $$\boxed{I(m) \sim \sin 1 - \frac{\pi^2}6 (\sin 1 - \cos 1) \cdot \frac1{m^2} + \cdots} ,$$ where $\cdots$ now denotes a remainder in $O\left(\frac1{m^3}\right)$ (in fact in $O\left(\frac1{m^4}\right)$).

Travis Willse
  • 108,056
3

Here is an elementary derivation. With $a_k=\frac{(2k-1)\pi}{2n}$ $$I_n=\int_{-\infty}^\infty \frac{\cos x}{x^{2n}+1}dx =\frac\pi n\sum_{k=1}^n e^{-\sin a_k}\sin(a_k+\cos a_k) $$ as shown below via partial fractions \begin{align} I_n=& \int_{-\infty}^\infty \frac{\cos x}n\sum_{k=1}^n \frac{1+x \cos a_k}{1+2x \cos a_k+x^2}\ dx,\>\>\>\>\>(x=y-\cos a_k)\\ =& \ \frac1n \sum_{k=1}^n \int_{-\infty}^\infty \bigg[\cos(\cos a_k)\sin^2 a_k \frac{\cos y}{\sin^2 a_k+y^2}\\ &\hspace{25mm} + \sin(\cos a_k)\cos a_k\frac{y\sin y}{\sin^2 a_k+y^2}\bigg] dy \end{align} Then, utilize the known integrals $$\int_{-\infty}^\infty \frac{\cos y}{b^2+y^2}dy =\frac\pi b e^{-b},\>\>\> \int_{-\infty}^\infty \frac{y\sin y}{b^2+y^2}dy =\pi e^{-b} $$ to obtain the closed-form for $I_n$.

Quanto
  • 120,125
  • Interesting proof, but how would you prove by elementary means the formulas for the "known integrals"? As I see it, anything involving complex analysis or differentiation under the integral sign is not elementary, and I can't see a way to arrive at these formulas without those "advanced" tools. – Gabriel Franceschi Libardi Jan 09 '25 at 12:23
  • @GabrielFranceschiLibardi By elementary, I mean real method without resorting to special functions and infinite series. – Quanto Jan 09 '25 at 20:06