<s>[INST] Calculate the integral of $\frac{1}{x^2 +x + \sqrt x}$ How to correctly calculate the integral:
$$\int_0^\infty \frac{1}{x^2 +x + \sqrt x}dx$$
Edit: I tried to figure out if the limit exists:
Step 1: break the integral to two parts: from 0 to 1, from 1 to infinity.
Step 2: use limit comparison test for both of the integral: the first integral compared at 1 to 1/sqrt(x) and the second is compared at infinity to 1/x^2.
Step 3: conclude that both converge, hence the original integral also converges.
Step 4: (this is the one im trying to figure out, how to actually calculate it, because the limit exists).
 [/INST] We have
\begin{align*}
I &= \int_0^\infty \frac{1}{x^2 + x + \sqrt{x}} \ \mathrm{d}x\\
&= \int_0^\infty \frac{2}{y^3 + y + 1} \ \mathrm{d}y && \text{using $y = \sqrt{x}$}\\
\end{align*}
Clearly, this only has one real root, denoted $r$, where $r < 0$. Since $r^3 + r + 1 = 0$, we have $r^{-1} = -r^2 - 1$, so $y^3 + y + 1 = (y - r)\left (y^2 + ry + (r^2 + 1) \right)$. Then we have
\begin{align*}
\frac{2}{y^3 + y + 1} &= \frac{A}{y - r} + \frac{By + C}{y^2 + ry + (r^2 + 1)}\\
2 &= A\left (y^2 + ry + (r^2 + 1) \right ) + \left (By + C \right )(y - r)\\
y=r \implies A &= -\frac{2r}{2r + 3}\\
B &= \frac{2r}{2r + 3}\\
C &= \frac{4r^2}{2r+3}\\
\implies \frac{2}{y^3 + y + 1} &= \frac{2r}{2r + 3}\left (\frac{y + 2r}{y^2 + ry + (r^2 + 1)} - \frac{1}{y - r} \right )
\end{align*}
Thus we have
\begin{align*}
I &= \frac{2r}{2r + 3} \int_0^\infty \frac{y + 2r}{y^2 + ry + (r^2 + 1)} - \frac{1}{y - r} \ \mathrm{d}y\\
&= \frac{2r}{2r + 3} \int_0^\infty \frac{y + \frac{r}{2}}{y^2 + ry + (r^2 + 1)} + \frac{\frac{3r}{2}}{\left ( y + \frac{r}{2}\right )^2 + \left (\frac{3r^2}{4} + 1\right )} - \frac{1}{y - r} \ \mathrm{d}y\\
&= \frac{6r}{2r + 3} \left ( \frac{1}{2} \ln(-r) - \frac{(-r)^{\frac{3}{2}}}{\sqrt{3 - r}} \left (\frac{\pi}{2} + \tan^{-1}\left ( \frac{(-r)^{\frac{3}{2}}}{\sqrt{3 - r}}\right )\right )\right )
\end{align*}
Taking $r = -\frac{2}{\sqrt{3}}\sinh\left ( \frac{1}{3} \sinh^{-1} \left (\frac{3\sqrt{3}}{2}\right ) \right )$ gives a numerical evaluation for the above term of about $1.8435267\dots$.
</s>