6

I wanted to practice using the Residue theorem to calculate integrals. I chose an integral of the form $$\int_{-\infty}^\infty\frac{x^n}{1+x^m}dx$$and then choose random numbers for $n$ and $m$, which happened to be $$\int_{-\infty}^\infty\frac{x^2}{1+x^8}dx$$I know there is a general formula for integrals of this form, which is $$\int_{-\infty}^\infty\frac{x^n}{1+x^m}dx=\frac{\pi}{m}\csc\left(\frac{\pi(n+1)}{m}\right)$$But let's forget about this right now. I used the Residue theorem and the semicircular contour to get that $$\int_{-\infty}^\infty\frac{x^2}{1+x^8}dx=\Re\left(\frac{\pi i}{4}\left(\frac{1}{e^{\frac{5\pi i}{8}}}+\frac{1}{e^{\frac{15\pi i}{8}}}+\frac{1}{e^{\frac{25\pi i}{8}}}+\frac{1}{e^{\frac{35\pi i}{8}}}\right)\right)$$

Is there any other ways to calculate this integral?

Kamal Saleh
  • 6,973
  • 1
    Could you edit into your answer the details of your calculation? "I used the Residue theorem" doesn't tell us where you lost a factor of $7$. I'm guessing you used a semicircular contour, although the more general result you quoted - whose LHS should just be from $0$ to $\inf$ - is typically derived with a keyhole contour to handle odd $m$. – J.G. Feb 01 '23 at 16:41
  • Well, using the same way we derive the general formula, you can solve for this specific case. Just go step by step on that question (which i don't have the link to rn but should be easy to find). You can choose either a pizza slice or a keyhole to integrate it. On the other hand, you can also use the beta function. Again, solving for this specific case is really just the same as solving for the general case except you actually plug in numbers. – Captain Chicky Feb 01 '23 at 16:49
  • @CaptainChicky Yes it does :) – Kamal Saleh Feb 01 '23 at 16:59
  • @KamalSaleh oops i retracted that flag because i interpreted this as you practicing lol pay no heed to that – Captain Chicky Feb 01 '23 at 17:00
  • 2
    As of your edit it seems you got rid of a spurious factor of $\frac17$, so I'll summarize @CaptainChicky's pizza slice option. Define $f(z):=\frac{z^2}{1+z^8}$. Let $C_R$ be a contour from $0$ to $R$ to $Re^{i\pi/4}$ to $0$ so$$\int_{-\infty}^\infty f(x)dx=\frac{2}{1-e^{3i\pi/4}}\lim_{R\to\infty}\oint_{C_R}f(z)dz=\frac{-2\pi\csc\frac{3\pi}{8}}{e^{3i\pi/8}}\lim_{z\to e^{i\pi/8}}(z-e^{i\pi/8})f(z)=\frac{\pi}{4}\csc\frac{3\pi}{8}$$by L'Hôpital's rule. – J.G. Feb 01 '23 at 17:24
  • @J.G. Put this as an answer :) – Kamal Saleh Feb 01 '23 at 17:34
  • 1
    An old complex analysis problem book says: This integral can also e evaluated with the aid of Euler's beta function when m is even. – Bob Dobbs Feb 01 '23 at 18:05
  • I wonder if you could also solve it by writing it as equal to $2\int_0^\infty \frac{x^2}{1+x^8}dt$, making a substitution $x^8 = t$, and then integrating the result using a keyhole contour. (Though that's probably morally equivalent to the pizza slice contour option.) – Daniel Schepler Feb 01 '23 at 23:12

2 Answers2

8

Let $$ I=\int_{-\infty}^\infty\frac{x^2}{1+x^8}dx=2\int_{0}^\infty\frac{x^2}{1+x^8}dx.$$ Under $x\to\frac1x$, one has $$ I=\int_{-\infty}^\infty\frac{x^2}{1+x^8}dx=2\int_{0}^\infty\frac{x^4}{1+x^8}dx.\tag1$$ Clearly $$ I=-2\int_{0}^\infty\frac{x^{4}}{1+x^{8}}d\bigg(\frac1x\bigg). \tag2$$ Adding (1) to (2) gives \begin{eqnarray} 2I&=&2\int_{0}^\infty\frac{x^{4}}{1+x^{8}}d\bigg(x-\frac1x\bigg)\\ &=&2\int_{0}^\infty\frac{1}{x^4+x^{-4}}d\bigg(x-\frac1x\bigg)\\ &=&2\int_{0}^\infty\frac{1}{(x^2+x^{-2})^2-2}d\bigg(x-\frac1x\bigg)\\ &=&2\int_{0}^\infty\frac{1}{((x-x^{-1})^2+2)^2-2}d\bigg(x-\frac1x\bigg)\\ &=&2\int_{-\infty}^\infty\frac{1}{(x^2+2)^2-2}dx\\ &=&2\cdot\frac1{2\sqrt2}\int_{-\infty}^\infty\bigg(\frac{1}{x^2+2-\sqrt2}-\frac{1}{x^2+2+\sqrt2}\bigg)dx\\ &=&\frac1{\sqrt2}\bigg(\frac1{\sqrt{2-\sqrt2}}\arctan\bigg(\frac{x}{\sqrt{2-\sqrt2}}\bigg)-\frac1{\sqrt{2+\sqrt2}}\arctan\bigg(\frac{x}{\sqrt{2+\sqrt2}}\bigg)\bigg)\bigg|_{-\infty}^\infty\\ &=&\frac\pi{\sqrt2}\bigg(\frac1{\sqrt{2-\sqrt2}}-\frac1{\sqrt{2+\sqrt2}}\bigg)\\ &=&\frac\pi{2}(\sqrt{2+\sqrt2}-\sqrt{2-\sqrt2}). \end{eqnarray} So $$ I= \frac\pi{4}(\sqrt{2+\sqrt2}-\sqrt{2-\sqrt2})=\frac\pi{2}\sqrt{1-\frac1{\sqrt2}}. $$

xpaul
  • 47,821
4

Alternative complex solution:

$$\begin{align*} I &= \int_{-\infty}^\infty \frac{x^2}{1+x^8} \, dx \\[1ex] &= \int_0^\infty \frac{2x^2}{1+x^8} \, dx \tag{1} \\[1ex] &= \int_0^\infty \frac{\sqrt x}{1+x^4} \, dx \tag{2} \\[1ex] &= i \pi \sum_{k\in\{1,3,5,7\}} \operatorname{Res}\left(\frac{\sqrt z}{1+z^4}, z=e^{i\frac{k\pi}4}\right) \tag{3} \\[1ex] &= \frac\pi{\sqrt2}\sin\left(\frac\pi8\right) \end{align*}$$


  • $(1)$ : symmetry
  • $(2)$ : substitute $x\mapsto \sqrt x$
  • $(3)$ : integrate in the complex plane along a deformed circular contour that avoids a branch cut taken along the positive real axis

We can also reduce the powers further to halve the number of residues one has to compute. For instance, with $x\mapsto \sqrt[4]{x}$ we get

$$I = \frac12 \int_0^\infty \frac{dx}{\sqrt[4]{x}(1+x^2)}$$

By the residue theorem (using the same contour and branch),

$$i2\pi \sum_{\zeta=\pm i} \operatorname{Res}\left(\frac1{\sqrt[4]{z}(1+z^2)}, z=\zeta\right) = (1+i) \int_0^\infty \frac{dx}{\sqrt[4]{x}(1+x^2)} \, dx \\ \implies I = \frac\pi2\left(\underbrace{\cos\left(\frac\pi8\right)-\sin\left(\frac\pi8\right)}_{=\sqrt2\sin\left(\frac\pi8\right)}\right)$$


Once more, under $x\mapsto \sqrt[8]{x}$,

$$I = \int_0^\infty \frac{2x^2}{1+x^8} \, dx = \frac14 \int_0^\infty \frac{dx}{x^{5/8}(1+x)}$$

and we can use the residue theorem again, or simply recognize the beta integral, so that $I=\frac14\operatorname{B}\left(\frac38,\frac58\right)$.

user170231
  • 25,320