<s>[INST] How can i solve $\int \frac{x^3+2x-7}{\sqrt{x^2+1}}\ dx?$ How can i solve following $$\int \frac{x^3+2x-7}{\sqrt{x^2+1}}\ dx?$$
My work:
I substituted $x=\tan\theta$, $dx=\sec^2\theta d\theta $
integral becomes
$\int \dfrac{\tan^3\theta+2\tan \theta-7}{\sqrt{\tan^2\theta+1}}\ \sec^2\theta d\theta$
$\int \dfrac{\tan\theta(\tan^2\theta+1)+\tan \theta-7}{\sec\theta}\sec^2\theta d\theta$
$\int (\tan\theta(\sec^2\theta)+\tan \theta-7)\sec\theta d\theta$
$\int \tan\theta\sec^3\theta\ d\theta+\int \sec\theta \tan \theta\ d\theta-7\int \sec\theta d\theta$
$\int \tan\theta\sec^3\theta+\sec\theta -7\ln|\sec\theta+\tan\theta|+C$
I got stuck here in solving first part of above integral. I can't see the way to solve it. please help me solve it by substitution or other method. thanks
 [/INST] You're almost there.
$$\int \tan \theta \sec^3 \theta d \theta = \int \frac {\sin \theta}{\cos^4 \theta} d \theta = -\int \frac{du}{u^4}=\frac 13 u^{-3} = \frac {\sec^3 \theta}{3}+ C$$
Since $x= \tan \theta, x^2+1=\sec^2 \theta$, so
$$\frac{\sec^3 \theta}{3} + C = \frac{\sqrt{(x^2+1)^3}}{3}+C.$$
</s>