Evaluate: $u =\int_0^\infty\frac{dx}{x^4 +7x^2+1}$

Evaluate:

$u =\displaystyle\int_0^\infty\dfrac{dx}{x^4 +7x^2+1}$

Attempt:

$$u = \int_0^\infty \dfrac{dx}{\left(x^2+ \left(\dfrac{7 - \sqrt {45}}{2}\right)\right)\left(x^2+ \left(\dfrac{7 + \sqrt {45}}{2}\right)\right)}$$

$$u = \int_0^\infty \dfrac{dx}{(x^2+a^2)(x^2+b^2)}$$

After partial fraction decomposition and simplifying I get:

$u = \dfrac{\pi}{2(a+b)}$

But answer is $\frac \pi 6$.

Where have I gone wrong?

\newcommand{\I}{\mathfrak{I}}$$\newcommand{\dx}{\mathrm dx\,}Let’s take the time to generalize this. Denote the generalized integral as$$\I=\int\limits_0^{\infty}\dx\frac 1{x^4+ax^2+b^2}$$Now factor out an x^2 from the denominator and complete the square to get$$\I=\int\limits_0^{\infty}\frac {\dx}{x^2}\frac 1{\left(x-\frac bx\right)^2+a+2b}$$Make the transformation x\mapsto\tfrac bx so that$$\I=\frac 1b\int\limits_0^{\infty}\dx\frac 1{\left(x-\frac bx\right)^2+a+2b}$$Therefore, it’s easy to see that$$b\I=\int\limits_0^{\infty}\frac {\dx}{x^2}\frac b{\left(x-\frac bx\right)^2+a+2b}=\int\limits_0^{\infty}\dx\frac 1{\left(x-\frac bx\right)^2+a+2b}$$Add the two integrals together to get$$\begin{align*}\I & =\frac 1{2b}\int\limits_0^{\infty}\dx\left(1+\frac b{x^2}\right)\frac 1{\left(x-\frac bx\right)^2+a+2b}\\ & =\frac 1{2b}\int\limits_{-\infty}^{\infty}\frac {\dx}{x^2+a+2b}\\ & \color{blue}{=\frac {\pi}{2b\sqrt{a+2b}}}\end{align*}$$Now set a=7 and b=1 to get the answer. Hint:$$\dfrac2{x^4+ax^2+1}=\dfrac{1-1/x^2}{x^2+a+1/x^2}+\dfrac{1+1/x^2}{x^2+a+1/x^2}x^2+1/x^2=(x-1/x)^2+?=(x+1/x)^2-2\dfrac{7 - \sqrt {45}}{2}=\left(\dfrac{3 - \sqrt {5}}{2}\right)^2$$and ... I'm not sure you have done anything wrong. You have a+b in your answer, but a is specifically \sqrt{\frac{7-\sqrt{45}}{2}}=\frac{3-\sqrt{5}}{2}. And b=\frac{3+\sqrt{5}}{2}. So a+b=3, making your answer agree with what you are expecting. A slightly different approach: you have a^2+b^2=7 and a^2 b^2=1 with a,b\in\mathbb{R}^+, such that$$ \operatorname*{Res}_{x=ia}\frac{1}{(x^2+a^2)(x^2+b^2)} = \lim_{x\to ia}\frac{1}{(x+ia)(x^2+b^2)} = \frac{1}{2i}\cdot \frac{1}{a(b^2-a^2)}$$and similarly$$ \operatorname*{Res}_{x=ib}\frac{1}{(x^2+a^2)(x^2+b^2)} = \lim_{x\to ib}\frac{1}{(x+ib)(x^2+a^2)} = \frac{1}{2i}\cdot \frac{1}{b(a^2-b^2)}$so$\pi i$times the sum of the residues at$ia$and$ib$equals$\frac{\pi}{2ab(a+b)}$. On the other hand the integral is blatantly positive, such that$ab(a+b)$is the square root of$a^2 b^2(a^2+b^2+2\sqrt{a^2 b^2}) = 9$and voilà the wanted outcome$\frac{\pi}{6}$. Notice that the fraction could be written as $${\displaystyle\int}\dfrac{1}{\left(x^2-\frac{3\cdot\sqrt{5}-7}{2}\right)\left(x^2+\frac{3\cdot\sqrt{5}+7}{2}\right)}\,\mathrm{d}x$$ After performing partial fraction decomposition, we get $${\displaystyle\int}\left(\dfrac{2}{3\cdot\sqrt{5}\left(2x^2-3\cdot\sqrt{5}+7\right)}-\dfrac{2}{3\cdot\sqrt{5}\left(2x^2+3\cdot\sqrt{5}+7\right)}\right)\mathrm{d}x$$ Let's solve $${\displaystyle\int}\dfrac{1}{2x^2-3\cdot\sqrt{5}+7}\,\mathrm{d}x$$ Use the change of variable $$u=\dfrac{\sqrt{2}x}{\sqrt{7-3\cdot\sqrt{5}}}$$ This gives $$\mathrm{d}x=\dfrac{\sqrt{7-3\cdot\sqrt{5}}}{\sqrt{2}}\,\mathrm{d}u$$ The integral in the third equation becomes $$={\displaystyle\int}\dfrac{\sqrt{7-3\cdot\sqrt{5}}}{\sqrt{2}\left(\left(7-3\cdot\sqrt{5}\right)u^2-3\cdot\sqrt{5}+7\right)}\,\mathrm{d}u$$ It simplifies to $${{\dfrac{1}{\sqrt{2}\sqrt{7-3\cdot\sqrt{5}}}}}{\displaystyle\int}\dfrac{1}{u^2+1}\,\mathrm{d}u$$ The integral above evaluates as $${{\dfrac{1}{\sqrt{2}\sqrt{7-3\cdot\sqrt{5}}}}}{\displaystyle\int}\dfrac{1}{u^2+1}\,\mathrm{d}u = \dfrac{\arctan\left(u\right)}{\sqrt{2}\sqrt{7-3\cdot\sqrt{5}}}$$ Using$u$in the fourth equation gives $${{\dfrac{1}{\sqrt{2}\sqrt{7-3\cdot\sqrt{5}}}}}{\displaystyle\int}\dfrac{1}{u^2+1}\,\mathrm{d}u = \dfrac{\arctan\left(u\right)}{\sqrt{2}\sqrt{7-3\cdot\sqrt{5}}}$$= \dfrac{\arctan\left(\frac{\sqrt{2}x}{\sqrt{7-3\cdot\sqrt{5}}}\right)}{\sqrt{2}\sqrt{7-3\cdot\sqrt{5}}} Now let's solve the second integral appearing in the second equation, i.e. $${\displaystyle\int}\dfrac{1}{2x^2+3\cdot\sqrt{5}+7}\,\mathrm{d}x$$ Change of variable as $$u=\dfrac{\sqrt{2}x}{\sqrt{3\cdot\sqrt{5}+7}}$$ i.e. $$\mathrm{d}x=\dfrac{\sqrt{3\cdot\sqrt{5}+7}}{\sqrt{2}}\,\mathrm{d}u$$ We get $${\displaystyle\int}\dfrac{\sqrt{3\cdot\sqrt{5}+7}}{\sqrt{2}\left(\left(3\cdot\sqrt{5}+7\right)u^2+3\cdot\sqrt{5}+7\right)}\,\mathrm{d}u$$ which is $${\displaystyle\int}\dfrac{\sqrt{3\cdot\sqrt{5}+7}}{\sqrt{2}\left(\left(3\cdot\sqrt{5}+7\right)u^2+3\cdot\sqrt{5}+7\right)}\,\mathrm{d}u$$= {{\dfrac{1}{\sqrt{2}\sqrt{3\cdot\sqrt{5}+7}}}}{\displaystyle\int}\dfrac{1}{u^2+1}\,\mathrm{d}u =\dfrac{\arctan\left(u\right)}{\sqrt{2}\sqrt{3\cdot\sqrt{5}+7}} Use$u$in the$11^{th}\$ equation, i.e. $${\displaystyle\int}\dfrac{\sqrt{3\cdot\sqrt{5}+7}}{\sqrt{2}\left(\left(3\cdot\sqrt{5}+7\right)u^2+3\cdot\sqrt{5}+7\right)}\,\mathrm{d}u$$= {{\dfrac{1}{\sqrt{2}\sqrt{3\cdot\sqrt{5}+7}}}}{\displaystyle\int}\dfrac{1}{u^2+1}\,\mathrm{d}u =\dfrac{\arctan\left(\frac{\sqrt{2}x}{\sqrt{3\cdot\sqrt{5}+7}}\right)}{\sqrt{2}\sqrt{3\cdot\sqrt{5}+7}} Substituting the results we have in the second equation which is $${{\dfrac{2}{3\cdot\sqrt{5}}}}{\displaystyle\int}\dfrac{1}{2x^2-3\cdot\sqrt{5}+7}\,\mathrm{d}x-{{\dfrac{2}{3\cdot\sqrt{5}}}}{\displaystyle\int}\dfrac{1}{2x^2+3\cdot\sqrt{5}+7}\,\mathrm{d}x$$ gives $$\dfrac{\sqrt{2}\arctan\left(\frac{\sqrt{2}x}{\sqrt{7-3\cdot\sqrt{5}}}\right)}{3\cdot\sqrt{5}\sqrt{7-3\cdot\sqrt{5}}}-\dfrac{\sqrt{2}\arctan\left(\frac{\sqrt{2}x}{\sqrt{3\cdot\sqrt{5}+7}}\right)}{3\cdot\sqrt{5}\sqrt{3\cdot\sqrt{5}+7}}$$ Evaluating at the limits gives: $$-\dfrac{\sqrt{3\cdot\sqrt{5}+7}\left(7\cdot\sqrt{2}\cdot\sqrt{5}-15\cdot\sqrt{2}\right){\pi}+\sqrt{7-3\cdot\sqrt{5}}\left(-7\cdot\sqrt{2}\cdot\sqrt{5}-15\cdot\sqrt{2}\right){\pi}}{120} = \frac{\pi}{6}$$