<s>[INST] Issues with integrating $\int x^2 \sqrt{x^3 +1}$ via integration by parts I want to integrate
$$\int x^2 \sqrt{x^3 +1}~dx$$
I tried it with integration by parts (because we have a product here), but an online calculator did it with integration by substition.
Would this still be correct?
$$\frac{1}{3}x^3  (x^3+1)^\frac{1}{2} - \int \frac{1}{3} x^3 \frac{1}{2} (x^3+1)^{-\frac{1}{2}} \cdot 3~dx \\
= \frac{1}{3}x^3  (x^3+1)^\frac{1}{2} - \int x^3 \frac{1}{2} (x^3+1)^{-\frac{1}{2}} ~dx\\
= \frac{1}{3}x^3  (x^3+1)^\frac{1}{2} - \frac{1}{4} x^4\cdot 2(x^3 +1)^{-\frac{1}{2}} \\
= \frac{1}{3}x^3  \sqrt{x^3+1} - \frac{1}{2} x^4 \frac{1}{\sqrt{x^3+1}}$$
I think this is wrong because when $x=1$ I get a different result than when I insert $x=1$ into

Can someone tell me where I went wrong and why we rather use integration by substition instead of integration by parts here?
 [/INST] The first line of your calculation is missing a factor of $x^2$, which arises when using the chain rule to compute $d(\sqrt{x^3 + 1})$.
Instead, applying integration by parts with $$u = \sqrt{x^3 + 1}, \qquad dv = x^2$$ gives
$$\left(\frac{1}{3} x^3\right) \left(\sqrt{x^3 + 1}\right) - \int \left(\frac{1}{3} x^3\right) \left( \frac{3 x^2 \,dx}{2 \sqrt{x^3 + 1}} \right)
= \frac{\sqrt{x^3 + 1}}{3 x^3} - \frac{1}{2} \int \frac{x^5 \,dx}{\sqrt{x^3 + 1}} .$$
At this point the remaining integral is arguably worse than the one we started with, but we can still evaluate it using the same substitution the online calculator used, $$w = x^3 + 1, \qquad dw = 3 x^2;$$
we have
$$\int \frac{x^5 \,dx}{\sqrt{x^3 + 1}} = \int \frac{[(x^3 + 1) - 1] \cdot x^2 \,dx}{\sqrt{x^3 + 1}} = \frac{1}{3} \int \frac{(w - 1) \,dw}{\sqrt{w}},$$ and the lattermost integrand is a sum of power functions. But it's easier just to apply that substitution to the original integral instead:
$$\int x^2 \sqrt{x^3 + 1} \,dx = \frac{1}{3} \int \sqrt{w} \,dw .$$
</s>