0

So I was in the search for a general formula of $$\int_{-\infty}^\infty\frac{1}{1+x^n}dx$$I haven't found one yet, but I realized that for odd $n$ this is $0$. For even $n$, I decided to try a few cases first. Everyone knows the case of $n=2$, so I tried $n=4$. That is, we are calculating $$\int_{-\infty}^\infty\frac{1}{1+x^4}dx$$ The only obvious way to do this is to use the Residue theorem.

Consider a semicircle contour with radius $R$. There is a pole of $\frac{1}{1+x^4}$ at $x=\sqrt{i}=\frac{1}{\sqrt2}+\frac{1}{\sqrt2}i$ (use binomial theorem). Another pole is at $x=(-1)^{3/4}$ (note that we are considering poles above the real axis). The residue of this pole is the same as the residue of the other pole (which is $-\frac{1}{4\sqrt2}+\frac{1}{4\sqrt2}i$). Plugging these into the residue theorem formula, we get $\frac{-\pi}{\sqrt2}$.

This seems contradictory, since the function is greater than $0$ (because the denominator has no real roots). So this means that if the integral exists, it should be positive. I put this into a graphing calculator called GraphCalc and it put the same negative answer (up to four decimal places). Then I put it in desmos and did the absolute value of our answers.

So who is right? Is it possible for a function that is always positive to have an integral that is negative? Or do we have to take the absolute value of the answer (if the function is positive) before we call it a day?

Edit: As a note, the GraphCalc app makes the answer negative, whatever the bounds of integration are.

Kamal Saleh
  • 6,497
  • https://www.wolframalpha.com/input?i=integral+1%2F%281+%2B+x%5E4%29+from+x+%3D+-inf+to+inf – joaopfg Jan 31 '23 at 17:09
  • @JohnDoe So there is something wrong with my solution? – Kamal Saleh Jan 31 '23 at 17:11
  • 1
    https://math.stackexchange.com/questions/4034667/a-different-way-to-calculate-int-0-infty-tfrac11xn-dx/4628256#4628256 I think you'd like this question. I added a different solution a few days ago – Sine of the Time Jan 31 '23 at 20:12

3 Answers3

2

I realised that for odd $n$, this is zero

Really? For odd $n$, the integral doesn't exist. That's because $1+(-1)^n=0$.

Moving on, here you can find a more general integral. Your integral becomes that one with $m=0$ and noting that, if $x$ is even, the integrand is also even so we may as well integrate from $0\to\infty$.

A function with integrand $\ge0$ on the whole domain cannot integrate to a strictly negative quantity (unless you're doing Riemann integration and you've integrated, e.g. $\int_2^1$ instead of $\int_1^2$).

To find the residues, let's use the limit formula (these are simple poles): $$\frac{z-\zeta}{1+z^4}\to\frac{1}{4\zeta^3}$$By L'Hopital's rule, where $\zeta$ is a pole. The two poles you need to consider are $e^{\pi i/4}$ and $e^{3\pi i/4}$. The residue theorem tells: $$\frac{1}{4}2\pi i\cdot(e^{-3\pi i/4}+e^{-9\pi i/4})=\frac{\pi i}{2}e^{-6\pi i/4}(e^{3\pi i/4}+e^{-3\pi i/4})=\pi ie^{-3\pi i/2}(\cos(3\pi /4))=\frac{\pi}{\sqrt{2}}$$

And all is well. I'm not sure where you went wrong, but check your signs carefully.


Exercise: show that: $$\mathrm{P.V.}\,\,\int_\Bbb R\frac{1}{1+x^n}\,\mathrm{d}x=\begin{cases}\frac{2\pi}{n}\csc\left(\frac{\pi}{n}\right)&n\text{ is even }\\\frac{2\pi}{n}\csc\left(\frac{\pi}{n}\right)\cos^2\left(\frac{\pi}{2n}\right)&n\text{ is odd }\end{cases}$$

Holds true for all integers $n\ge2$, using a residue method.

FShrike
  • 40,125
  • I wonder how GraphCalc got it wrong too. I am pretty sure that graphing calculators use Riemann sums to get approximations, so it couldn't be some random bug. – Kamal Saleh Jan 31 '23 at 20:16
  • @KamalSaleh Could I see a screenshot of what exactly is going on? – FShrike Jan 31 '23 at 20:36
  • I just tried it again and put the correct answer. My bad. I really do remember that it gave a negative answer yesterday though. – Kamal Saleh Jan 31 '23 at 20:45
  • 1
    I just realized what happened. The calculator makes me drag the region where I want it to integrate and not put bounds into and integral sign. Since I was dragging from right to left, it made a negative answer. But when I dragged from left to right at first, it made a positive answer. – Kamal Saleh Feb 01 '23 at 15:51
1

$$ \begin{aligned} I =\int_{-\infty}^{\infty} \frac{1}{1+x^4} d x \stackrel{x\mapsto\frac{1}{x}}{=} \int_{-\infty}^{\infty} \frac{x^2}{1+x^4} d x \end{aligned} $$ Averaging them yields $$ 2 I=2 \int_0^{\infty} \frac{1+x^2}{1+x^4} d x $$ Dividing both numerator and denominator by $2x^2$ gives $$ \begin{aligned} I & =\int_0^{\infty} \frac{\frac{1}{x^2}+1}{\frac{1}{x^2}+x^2} d x \\ & =\int_0^{\infty} \frac{d\left(x-\frac{1}{x}\right)}{\left(x-\frac{1}{x}\right)^2+2} \\ & =\frac{1}{\sqrt{2}}\left[\tan ^{-1}\left(\frac{x-\frac{1}{x}}{\sqrt{2}}\right)\right]_0^{\infty} \\ & =\frac{\pi}{\sqrt{2}} \end{aligned} $$

In general, the integral doesn’t exist for odd integer $n$. For even integer $n$, we have $$ \begin{aligned} \text { Let } & \quad y=x^n, \textrm{ then } \quad x=y^{\frac{1}{n}} \quad \textrm{ and } \quad d x=\frac{1}{n} y^{\frac{1}{n}-1} d y \\ I& =2 \int_0^{\infty} \frac{1}{1+y} \cdot \frac{1}{n} y^{\frac{1}{n}-1} d y \\ & =\frac{2}{n} \int_0^{\infty} \frac{y^{\frac{1}{n}-1}}{1+y} d y \\ & =\frac{2}{n} B\left(\frac{1}{n}, 1-\frac{1}{n}\right) \\ & =\frac{2 \pi}{n} \csc \left(\frac{\pi}{n}\right) \end{aligned} $$ In particular,$$ \int_{-\infty}^{\infty} \frac{1}{1+x^4} d x = \frac{2 \pi}{n} \csc \left(\frac{\pi}{n}\right)= \frac{\pi}{\sqrt{2}} $$

Lai
  • 20,421
1

For odd $n$, the integral does not exist, but it does have a Cauchy principal value. Let's try $n=3$. The Cauchy principal value is $$ \lim_{\epsilon \to 0+} \left(\int_{-\infty}^{-1-\epsilon} \frac{dx}{1+x^3} + \int_{-1+\epsilon}^\infty \frac{dx}{1+x^3}\right)$$ which according to Maple is $\pi/\sqrt{3}$. Not $0$.

Robert Israel
  • 448,999