<s>[INST] How to proceed with evaluating $\int\frac{dx}{\sqrt{9+4x^2}}$ and $\int\tan^2(3x)dx$ 
*

*$\displaystyle\int\frac{dx}{\sqrt{9+4x^2}}$

*$\displaystyle\int\tan^2(3x)dx$



For the first one i'm not sure if I did it correctly, here is what I did:
Let $2x=3\tan(t)$, so $x=\frac{3}{2}\tan(t)$ and $dx=\frac{3}{2}\sec^2(t)dt$. So by substitution,
$$\begin{align}\displaystyle\int\frac{dx}{\sqrt{9+4x^2}}&=\int\frac{\frac{3}{2}\sec^2(t)}{3\sec(t)}dt\\
&=\frac{1}{2}\int\sec(t)dt\\
&=\frac{1}{2}\left(\ln|\sec(t)+\tan(t)| + C\right)\\
&=\frac{1}{2}\left(\ln\bigg|\frac{\sqrt{9+4x^2}}{3}+\frac{2x}{3}\bigg|+C\right)\\
\end{align}$$
For the second one, i'm unable to proceed, what I did was
$\displaystyle\int\tan^2(3x)dx=\int\frac{\sin^2(3x)}{\cos^2(3x)}dx=\int\frac{\frac{1}{2}(1-\cos(6x)}{\frac{1}{2}(1+\cos(6x)}dx=\int\frac{(1-\cos(6x)}{(1+\cos(6x)}dx$
is this the right way to proceed?
Thanks
 [/INST] For the first one, rewrite the integral as follows:
$$ \int \frac{1}{\sqrt{9+4x^2}} \, \mathrm{d} x =  \frac{1}{3} \int \frac{1}{\sqrt{1+4x^2/9}} \, \mathrm{d} x  =  \frac{1}{3} \int \frac{1}{\sqrt{1+(2x/3)^2}} \, \mathrm{d} x, $$ now let $v = 2x/3$ so we have:
$$ \int \frac{1}{\sqrt{9+4x^2}} \, \mathrm{d} x = \frac{1}{2} \int \frac{1}{\sqrt{1 + v^2} } \, \mathrm{d}v = \frac{1}{2} \textrm{asinh}{v},$$
where for the last integral we recall that [link].
</s>