<s>[INST] Complete $\int \frac{x^2}{\sqrt{9x^2-1}}dx$ I am trying to solve the integral $$\int \frac{x^2}{\sqrt{9x^2-1}}dx,$$ but I am not sure how to solve it.
I have thought substitute $x$ by $\frac{\sec(u)}{3}$. Then $dx = \frac{1}{3} \tan(u)\sec(u)$,
$\sqrt{9x^2 -1} = \sqrt{\sec^2(u) - 1} = \tan(u)$ and $u = \sec^{-1}$(3x)
$$\int \frac{x^2}{\sqrt{9x^2-1}}dx = \int \frac{\sec^3(u)}{9}du$$
I am just not sure how to finish that? Can someone help me with that?
 [/INST] There is a specific formula that helps in your case that helps "remove" the powers on a secant integral.
$$\int \sec ^n\left(x\right)dx=\frac{\sec ^{n-1}\left(x\right)\sin \left(x\right)}{n-1}+\frac{n-2}{n-1}\int \sec ^{n-2}\left(x\right)dx$$
Also I think you missed a 3 somewhere, during the substitution the dx should give you 1 three but the x squared should give you an additional 2.
Using this formula at $n=3$ we have:
$$\frac{1}{27}\int \sec ^3\left(u\right)du=\frac{1}{27}\left(\frac{\sec ^{2}\left(u\right)\sin \left(u\right)}{2}+\frac{1}{2}\int \sec\left(u\right)du\right)$$
$$=\frac{1}{27}\left(\frac{\sec ^{2}\left(u\right)\sin \left(u\right)}{2}+\frac{1}{2}\ln \left|\tan \left(u\right)+\sec \left(u\right)\right|\right)$$
$$=\frac{1}{27}\left(\frac{1}{2}\sec \left(u\right)\tan \left(u\right)+\frac{1}{2}\ln \left|\tan \left(u\right)+\sec \left(u\right)\right|\right)$$
Finally, $u=sec^{−1}(3x)$ and the $+C$:
$$=\frac{1}{27}\left(\frac{3}{2}x\sqrt{9x^2-1}+\frac{1}{2}\ln \left|\sqrt{9x^2-1}+3x\right|\right) + C$$
</s>