TITLE: Evaluate $I=\int_{0}^{\infty}\frac{(x^2+x+1)dx}{(x^3+x+1)\sqrt{x}}$
QUESTION [9 upvotes]: Evaluate $$I=\int_{0}^{\infty}\frac{(x^2+x+1)dx}{(x^3+x+1)\sqrt{x}}$$
My try:
Letting $\sqrt{x}=t$ we get
$$I=2\int_{0}^{\infty} \frac{t^4+t^2+1}{(t^6+t^2+1)}\,dt$$
Now
$$t^4+t^2+1=(t^2+1)^2-(t^2+1)+1$$
$$t^6+t^2+1=(t^2+1)^3-2(t^2+1)^2+(t^2+1)+1$$
Any clue then?

REPLY [10 votes]: Let me attack the original problem, as stated in Brilliant.org.

Question. If
$$ \alpha = \frac{1}{\pi} \int_{0}^{\infty} \frac{x^2 + x + 1}{x^3 + x + 1} \frac{\mathrm{d}x}{\sqrt{x}}, $$
then what is the value of $31\alpha^4 - 40\alpha^2 - 24\alpha$?

Remark. Once we identify the value of $31\alpha^4 - 40\alpha^2 - 24\alpha$, the problem of determining $\alpha$ reduces to solving the quartic equation. Since such formula is known, it suffices to answer to the question.

Step 1 - Reduction to algebraic sum. First, write $p(x) = x^2 + x + 1$ and $q(x) = x^3 + x + 1$ for simplicity. Then $\alpha$ is written as
$$ \alpha = \frac{1}{\pi} \int_{0}^{\infty} \frac{p(x)}{q(x)\sqrt{x}} \, \mathrm{d}x. $$
Let $\operatorname{Log}$ denote the complex logarithm so that $\Im\operatorname{Log}(z) \in [0, 2\pi)$. In other words, the branch cut is chosen as $[0, \infty)$. Then by employing the standard keyhole contour, we may write
\begin{align*}
\alpha
&= \frac{1}{2\pi} \left( \int_{\infty-i0^+}^{-i0^+} \frac{p(z)}{q(z)}e^{-\frac{1}{2}\operatorname{Log}(z)} \, \mathrm{d}z + \int_{i0^+}^{\infty+i0^+} \frac{p(z)}{q(z)}e^{-\frac{1}{2}\operatorname{Log}(z)} \, \mathrm{d}z \right) \\
&= i \sum_{q(x) = 0} \frac{ p(x)}{q'(x)} e^{-\frac{1}{2}\operatorname{Log}(x)}, \tag{1}
\end{align*}
where the sum in the last line runs over all complex $x$'s solving $p(x)=0$, which itself is a consequence of the residue theorem.
Step 2 - Identifying the nature of the sum. Since $q(x)$ is a cubic polynomial with only simple zeros, the sum in $\text{(1)}$ involves 3 terms, which we write as $z_1, z_2, z_3$. Then
$$\alpha = z_1 + z_2 + z_3. $$
Also, consider
$$ y = \left( \frac{i p(x)}{q'(x)} e^{-\frac{1}{2}\operatorname{Log}(x)} \right)^2 = -\frac{p(x)^2}{xq'(x)^2} $$
and let $\mathcal{Z} = \{z_1^2, z_2^2, z_3^2\}$ be the set of all possible values of $y$ given $q(x) = 0$. Rearranging this equality, we obtain $ yxq'(x)^2 + p(x)^2 = 0 $, and so, we observe that

$ q(x) $ and $yxq'(x)^2 + p(x)^2$ shares a root whenever $y \in \mathcal{Z}$.

On the other hand, if we regard both as polynomials with coefficients in $\mathbb{C}[y]$, then the resultant between them is given by
$$ \operatorname{res}\left(q(x), yxq'(x)^2 + p(x)^2 \right) = 961y^3 - 620y^2 + 131y - 9. $$
Since the resultant between two complex polynomials is zero exactly when they share a root, it follows that $\mathcal{Z} = \{ y : 961y^3 - 620y^2 + 131y - 9 \}$, or equivalently,
$$ 961y^3 - 620y^2 + 131y - 9 = 961(y - z_1^2)(y - z_2^2)(y - z_3^2). $$
In particular, by Vieta's formulas, we check that
$$
z_1^2 + z_2^2 + z_3^2 = \frac{620}{961} = \frac{20}{31}, \qquad
z_1^2 z_2^2 + z_2^2 z_3^2 + z_3^2 z_1^2 = \frac{131}{961}, \\
z_1^2 z_2^2 z_3^2 = \frac{9}{961} = \left(\frac{3}{31}\right)^2.
$$
Moreover, although not immediate from the previous computation, we can in fact check that $z_1 z_2 z_3$ is not a negative real number, and so, $z_1 z_2 z_3 = \frac{3}{31}$.
Step 3 - Conclusion. From the conclusion of the previous step, we can identify the equation that $\alpha$ satisfies. Indeed,
\begin{align*}
\alpha^2
= \left( z_1^2 + z_2^2 + z_3^2 \right) + 2\left( z_1z_2 + z_2z_3 + z_3z_1 \right) 
= \frac{20}{31}+ 2\left( z_1z_2 + z_2z_3 + z_3z_1 \right)
\end{align*}
and
$$ \left( \alpha^2 - \frac{20}{31} \right)^2
= 4 \left( z_1^2 z_2^2 + z_2^2 z_3^2 + z_3^2 z_1^2 \right) + 8 z_1 z_2 z_3 (z_1 + z_2 + z_3) = \frac{524}{961} + \frac{24}{31}\alpha.$$
Rearranging, we obtain
$$ 31 \alpha^4 - 40\alpha^2 - 24\alpha = 4. $$
Moreover, it turns out that this equation has the unique positive zero, which is exactly $\frac{1}{\pi}$ times what WolframAlpha yields (as demonstrated in @Infiaria's answer).