<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] $$\int \frac{x^3+2x-7}{\sqrt{x^2+1}}\ dx$$
$$=\int \frac{x(x^2+1)+x-7}{\sqrt{x^2+1}}\ dx$$
$$=\int x\sqrt{x^2+1}\ dx+\int \frac{x}{\sqrt{x^2+1}}\ dx-\int \frac{7}{\sqrt{x^2+1}}\ dx$$
$$=\frac12\int \sqrt{x^2+1}\ d(x^2+1)+\frac12\int \frac{d(x^2+1)}{\sqrt{x^2+1}}-7\int \frac{dx}{\sqrt{x^2+1}}$$
$$=\frac13(x^2+1)^{3/2}+\sqrt{x^2+1}-7\sinh^{-1}(x)+C$$
</s>