<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] First Way
Break down the $\sec^3{x}$ and integrate by parts
$$ I = \int \sec^3{x} dx = \int \sec^2{x} \sec{x} dx $$
Recalling:
$$ \int u dv = uv - \int vdu$$
Useful tip: Always try to recognize famous derivatives. Note that $ \sec^2{x}$ seems familiar so lets
use $dv = \sec^2{x} dx$ and $ u = \sec{x}$ then $v = \tan{x}$ and $ du = \sec{x} \tan{x} dx$.
$$ I = \tan{x} \sec{x} - \int \tan^2{x} \sec{x} dx$$
break up the $ tan^2{x} $ as $ \sec^2{x} - 1$
$$I =  \tan{x} \sec{x} - \int (\sec^2{x} - 1) \sec{x}  dx = \tan{x} \sec{x} + \int \sec{x} dx - \int \sec^3{x} dx$$
Note that $ \int \sec^3{x} = I$ so we added up for both sides and divide by two.
$$ I = \frac{1}{2} (\tan{x} \sec{x} + \int \sec{x} dx ) =\frac{1}{2} (\tan{x} \sec{x} + \ln{|\sec{x} + \tan{x}} |) + C $$
Second way :
You can also directly  apply integration by parts at the very beginning.
In fact, using integration by parts can also be applied. Let $ dv = \frac{x}{\sqrt{x^2 -1}} \,dx $ and $u = x$
then:
$$ \int dv = v = \int  \frac{x}{\sqrt{x^2 -1}} dx    $$
Use $z^2 = x^2 - 1$ and $2zdz = 2x dx$
$$ \int dv = v = \int \frac{z dx}{z} = \int dz = z = \sqrt{x^2 - 1} $$
Finally plugging v, u, dv, and du in the integration by parts formula.
$$ \int \frac{x^2}{\sqrt{x^2 -1}} dx = x \sqrt{x^2 - 1} - \int \sqrt{x^2 - 1}dx$$
$ x = \sec{\theta} $, $dx = \sec{\theta}\tan{\theta} d\theta$
$$ \int \sqrt{x^2 - 1} dx = \int \sqrt{\sec^2{\theta} - 1}  \sec{\theta}\tan{\theta}  d\theta = \int \tan^2{\theta} \sec{\theta} d\theta = J $$
And then we apply the same method used in the first way, for that.
Hence, if you find J you get that
$$ \int \frac{x^2}{\sqrt{x^2 -1}} dx = x \sqrt{x^2 - 1} - J $$
</s>