# Evaluating an improper integral $\int_{0}^{\infty}\frac{x^2}{(x^4+1)^2}dx$

I tried to solve the integral: $$\int_{0}^{\infty}\frac{x^2}{(x^4+1)^2}dx$$ using $$x = \sqrt{\tan(u)}$$ and $$dx = \frac{ \sec^2(u)}{2\sqrt{\tan(u)}} du,$$

but I ended up with an even worse looking integral $$\int_{0}^{\frac{\pi}{2}}\frac{\sqrt{\tan(u)}}{\sec^2(u)}du.$$

Wolfram gave an answer of $$\dfrac{\pi}{8\sqrt{2}},$$ but how would one get to that answer?

• Are you familiar with either the Beta function or the Residue Theorem? – Zachary Jan 4 at 1:29
• @Zachary Unfortunately no I'm in bc calc and we haven't learned any of the fancier integration techniques – Jessca Jan 4 at 1:33
• Jess you should be able to use partial fractions, using $$x^4+1 = (x^2 + x \sqrt 2 + 1) (x^2 - x \sqrt 2 + 1)$$ – Will Jagy Jan 4 at 1:41

## 5 Answers

Let us start with a step of integration by parts: $$\int_{0}^{+\infty}\frac{1}{4x}\cdot\frac{4x^3}{(x^4+1)^2}\,dx =\int_{0}^{+\infty}\frac{1}{4x^2}\left(1-\frac{1}{1+x^4}\right)\,dx=\frac{1}{4}\int_{0}^{+\infty}\frac{dx}{x^2+\frac{1}{x^2}}$$ and finish with Glasser's master theorem: $$\frac{1}{8}\int_{-\infty}^{+\infty}\frac{dx}{\left(x-\frac{1}{x}\right)^2+2}\stackrel{\text{GMT}}{=}\frac{1}{8}\int_{-\infty}^{+\infty}\frac{dx}{x^2+2} = \frac{\pi}{8\sqrt{2}}.$$

• I was actually just thinking about if it was possible to use GMT to evaluate that integral! – Zachary Jan 4 at 1:57
• Quite impressive! Since the OP mentioned in the comments that hasn't learnt any fancier tricks I just want to mention that on the integral obtained after integrating by parts, we can do a $x=\frac{1}{t}$ thus: $$J=\int_0^\infty \frac{x^2} {1+x^4} dx=\int_0^\infty \frac{dt} {1 +t^4}dt$$And if we add those two we get:$$2J=\int_0^\infty \frac{x^2 +1}{x^4 +1}dx=\int_0^\infty \frac{\frac{1} {x^2} +1}{x^2 +\frac{1} {x^2} }dx$$ And now completing the square in the denominator and letting $x-\frac{1} {x} =t$ yields the same thing as by GMT. – LeBlanc Jan 4 at 2:03
• I'm a little confused on how $\int_{0}^{\infty}\frac{1}{4x}\cdot\frac{4x^3}{(x^4+1)^2}\,dx =\int_{0}^{\infty}\frac{1}{4x^2}\left(1-\frac{1}{1+x^4}\right)\,dx$ after integrating by parts becuase I got $\frac{1}{4x}(\frac{-1}{x^4+1})\vert_{0}^{\infty} - \int_{0}^{\infty}\frac{1}{4x^2(x^4+1)}$ how are these two equivalent? – Jessca Jan 4 at 2:26
• @Jessca: it is better to take $1-\frac{1}{1+x^4}$ as antiderivative of $\frac{4x^3}{1+x^4}$, otherwise you end up with the difference of two divergent objects, not very useful. – Jack D'Aurizio Jan 4 at 2:40

Write $$\frac{x^2}{(1+x^4)^2} = \frac{4x^3}{(1+x^4)^2} \cdot \frac{1}{4x}.$$ Then integration by parts with the choice $$u = \frac{1}{4x}, \quad du = -\frac{1}{4x^2} \, dx, \\ dv = \frac{4x^3}{(1+x^4)^2} \, dx, \quad v = -\frac{1}{1+x^4},$$ yields $$I_1(x) = \int \frac{x^2}{(1+x^4)^2} \, dx = -\frac{1}{4x(1+x^4)} - \int \frac{1}{4x^2(1+x^4)} \, dx.$$ Now write $$\frac{1}{x^2(1+x^4)} = \frac{1}{x^2} - \frac{x^2}{1+x^4},$$ thus $$I_1(x) = -\frac{1}{4x(1+x^4)} + \frac{1}{4x} + \frac{1}{4} \int \frac{x^2}{1+x^4} \, dx = \frac{x^3}{4(1+x^4)} + \frac{1}{4} I_2(x),$$ where we now seek to evaluate $$I_2(x)$$. This is accomplished in a number of ways; one is to perform the factorization $$1+x^4 = (1 + \sqrt{2} x + x^2)(1 - \sqrt{2} x + x^2),$$ and compute the partial fraction decomposition $$\frac{x^2}{1+x^4} = \frac{1}{2\sqrt{2}} \left( \frac{x}{1 - \sqrt{2} x + x^2} - \frac{x}{1 + \sqrt{2} x + x^2} \right).$$ Then each term is integrable in closed form. This is not the easiest or most elegant approach, but it is perhaps the most elementary, requiring no knowledge beyond AP Calculus BC.

Consider the integral $$I(a,b)=\int_0^{\pi/2}\sin(x)^a\cos(x)^b\mathrm{d}x$$ Applying the substitution $$t=\sin(x)^2$$, we see that $$I(a,b)=\frac12\int_0^1t^{\frac{a-1}2}(1-t)^{\frac{b-1}2}\mathrm{d}t$$ $$I(a,b)=\frac12\int_0^1t^{\frac{a+1}2-1}(1-t)^{\frac{b+1}2-1}\mathrm{d}t$$ Recall the definition of the Beta function $$\mathrm B(x,y)=\int_0^1t^{x-1}(1-t)^{y-1}\mathrm{d}t=\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}$$ Where $$\Gamma(s)$$ is the Gamma Function.

Hence we see that $$I(a,b)=\frac{\Gamma(\frac{a+1}2)\Gamma(\frac{b+1}2)}{2\Gamma(\frac{a+b}2+1)}$$ From $$\frac{\tan(x)^{1/2}}{\sec(x)^2}=\sin(x)^{1/2}\cos(x)^{3/2}$$ We see that your integral is $$I(1/2,3/2)=\frac{\Gamma(3/4)\Gamma(5/4)}{2\Gamma(2)}$$ $$I(1/2,3/2)=\frac{\Gamma(1/4)\Gamma(3/4)}{8}$$ And from $$\Gamma(s)\Gamma(1-s)=\frac\pi{\sin\pi s},\qquad s\not\in\Bbb Z$$ We have $$I(1/2,3/2)=\frac{\pi}{8\sqrt2}$$

• seems fine, but you will need some tool to compute the last expression. Note that $\Gamma(3/4)\Gamma(5/4)=-\frac14\Gamma(-1/4)\Gamma(5/4)$, then you can use the reflection formula – Masacroso Jan 4 at 1:54
• I would maybe at least give the definition of the Gamma function the OP may not be familiar with it – Zachary Jan 4 at 1:55
• you last expression seems wrong, note that $\Gamma(2)=1$ and so $$\frac{\Gamma(3/4)\Gamma(5/4)}{2\Gamma(2)}=\frac{\Gamma(3/4)\Gamma(1/4)}{8}$$ where we used the functional equation $\frac14\Gamma(1/4)=\Gamma(1/4+1)=\Gamma(5/4)$ – Masacroso Jan 4 at 2:09

We could do it with contour integration.

take the contour from 0 to R along the real axis.

$$\int_0^R \frac {x^2}{(x^4+1)^2} \ dx$$

The quater circle.

$$\int_0^{\frac \pi 2} \frac {R^2e^2it}{(R^4e^{4it}+1)^2}(iRe^{it}) \ dt$$

$$\lim_\limits{R\to \infty} \frac {R^2e^2it}{(R^4e^{4it}+1)^2}(iRe^{it}) = 0$$

And down the imaginary axis.

$$\int_R^0 \frac {(e^{\frac {\pi}{2} i} x)^2}{((e^{\frac {\pi}{2} i} x)^4+1)^2} (e^{\frac {\pi}{2} i})\ dx\\ \int_R^0 \frac {-x^2}{x^4+1)^2} (i)\ dx\\$$

$$(1+i)\int_0^\infty \frac {x^2}{(x^4+1)^2} \ dx = (2\pi i) \text{ Res}_{\left(x=e^{\frac\pi4i}\right)}\frac {x^2}{(x^4+1)^2}$$

The pole is of order 2.

$$\frac {d}{dx}\frac {x^2}{(x^3 + x^2e^{\frac \pi4 i} + xe^{\frac {2\pi}{4} i}+e^{\frac {3\pi}{4} i})^2} = \frac {2x(x^3 + x^2e^{\frac \pi4 i} + xe^{\frac {2\pi}{4} i}+e^{\frac {3\pi}{4} i}) - 2x^2(3x^2 + 2xe^{\frac \pi4 i} + e^{\frac {2\pi}{4} i})}{(x^3 + x^2e^{\frac \pi4 i} + xe^{\frac {2\pi}{4} i}+e^{\frac {3\pi}{4} i})^3}$$

Evaluated at $$e^{\frac {\pi}{4} i}$$

$$\frac {4}{(4e^{\frac {3\pi}4 i})^3} = \frac {1}{16e^{\frac {\pi}4 i}}$$

$$\int_0^\infty \frac {x^2}{(x^4+1)^2} \ dx = \frac {2\pi i}{16\sqrt 2 i} = \frac {\pi}{8\sqrt 2}$$

Using the method I employed here: we observe that

$$$$\int_{0}^{\infty} \frac{x^2}{\left(x^4 + 1\right)^2}\:dx = \frac{1}{4} \cdot 1^{\frac{2 + 1}{4} - 2} \cdot B\left(2 - \frac{2 + 1}{4}, \frac{2 + 1}{4} \right) = \frac{1}{4}B\left(\frac{5}{4}, \frac{3}{4}\right)$$$$

\begin{align} \int_{0}^{\infty} \frac{x^2}{\left(x^4 + 1\right)^2}\:dx &= \frac{1}{4}B\left(\frac{5}{4}, \frac{3}{4}\right) = \frac{1}{4}\frac{\Gamma\left(\frac{5}{4}\right)\Gamma\left(\frac{3}{4}\right)}{\Gamma\left(\frac{5}{4} + \frac{3}{4}\right)} \\ &= \frac{1}{4}\frac{\Gamma\left(\frac{5}{4}\right)\Gamma\left(\frac{3}{4}\right)}{\Gamma\left(2\right)} =\frac{\Gamma\left(\frac{5}{4}\right)\Gamma\left(\frac{3}{4}\right)}{8} \end{align}