<s>[INST] Question about $I = \int x^3 \sqrt{x^2+2} \, dx$ I'm trying to find the result of the following integral:
$$I = \int x^3 \sqrt{x^2+2} \, dx$$
This integral appears in MIT OCW 18.01SC course
I try to make a substitution as follow :
Let $x = \sqrt{2}\tan(u), \quad dx = \sqrt{2}\sec^2(u)\, du$
If we substitute that in our integral and use the trig identity which tells as that $\sec^2(u) = 1 + \tan^2(u)$
We found that :
$$I = 4\sqrt{2} \int\tan^3(u)\sec^3(u) \, du$$
Using the previous trig identity we can write it as follow :
$$I = 4\sqrt{2}  \int\sec^2(u)(\sec^2(u) - 1)\sec(u)\tan(u) \,du$$
Now we can make a substitution as follow :
Let $v = \sec(u),\quad dv = \sec(u)\tan(u)\,du$
After doing that the integral is easy to calculate and we  can get the result :
$$I = 4\sqrt{2} \left(\frac{1}{5}v^5 - \frac{1}{3}v^3\right) + c$$
And after reverse all previous trig substitution we should get :
$$I = \frac{4}{5}(x^2+2)^{5/2} - \frac{4}{3}(x^2+2)^{3/2} + c$$
The professor uses another way to get the result using another substitution in the first which is :
$$u = x^2 + 2, x^2 = u - 2$$
$$du = 2x\,dx, x\,dx = du/2$$
And his answer is :
$$I = \frac{1}{5}(x^2+2)^{5/2} - \frac{2}{3}(x^2+2)^{3/2} + c$$
Can anyone tell me where the wrong is in my solution?
 [/INST] You have made an error in simplification after "reverse all previous trig substitution".
\begin{align*}
    &\left. \left. 4\sqrt{2}\left( \frac{1}{5}v^5 - \frac{1}{3}v^3 \right) + C \right|_{v = \sec u} \right|_{u = \arctan(x/\sqrt{2})}  \\
    &= \left. 4\sqrt{2}\left( \frac{1}{5}\sec^5 u - \frac{1}{3}\sec^3 u \right) + C \right|_{u = \arctan(x/\sqrt{2})}  \\
    &= 4\sqrt{2}\left( \frac{1}{5} \left( \frac{x^2}{2}+1 \right)^{5/2} - \frac{1}{3}\left( \frac{x^2}{2}+1 \right)^{3/2} \right) + C   \\
    &= \frac{4\sqrt{2}}{5 \cdot 2^{5/2}} \left( x^2 + 2 \right)^{5/2} - \frac{4\sqrt{2}}{3 \cdot 2^{3/2}}\left( x^2 + 2  \right)^{3/2} + C   \\
    &= \frac{4\sqrt{2}}{5 \cdot 4 \sqrt{2}} \left( x^2 + 2 \right)^{5/2} - \frac{4\sqrt{2}}{3 \cdot 2\sqrt{2}}\left( x^2 + 2  \right)^{3/2} + C   \\
    &= \frac{1}{5} \left( x^2 + 2 \right)^{5/2} - \frac{2}{3}\left( x^2 + 2  \right)^{3/2} + C  \text{.}
\end{align*}
</s>