Evaluate $\int \sqrt {3 \tan^2 \theta - 1} d \theta$ Evaluate $I=\int \sqrt {3  \tan^2 \theta - 1} d \theta$
My attempt
$\tan \theta = t, $ then $I = \int \frac{\sqrt {3t^2-1}}{1+t^2} dt   $
Now integrating by parts,
I = $\sqrt {3t^2-1} \tan^{-1} t- \int( \frac{6t}{2\sqrt {(3t^2-1)}} \tan^{-1} t) dt$
Now i am struck... How to proceed.
 A: Hints :
$$=\int \frac {(2\tan \theta\sec^2\theta)(\sqrt {3\tan ^2\theta-1})}{(2\tan \theta\sec^2\theta)} d\theta$$
Let $$\tan^2\theta=\frac {x^2+1}{3}$$ hence $$2\tan \theta\sec^2\theta=2x/3$$
And then change the integral to $$\sqrt 3\int \frac {x^2}{(x^2+4)\sqrt {x^2+1}}dx= \sqrt 3\int \frac {1}{\sqrt {x^2+1}}dx-4\sqrt 3\int \frac {1}{(x^2+4)\sqrt {x^2+1}}dx$$
Evaluate the first integral using the substitution $x=\tan \alpha$ and end the second one with the substitution $x=\frac 1t$ which further can be evaluated by the substitution $$t^2+1=u^2$$
A: The result of @Manthanein can be obtained without much difficulty.
The integral can also be written as $$\int \sqrt{3\sec^2 \theta -4} \, \mathrm d\theta$$
Now, substitute $$\begin{align}3\sec^2 \theta -4 &=x^2\\ \implies 3\sec^2 \theta \tan \theta \, \mathrm d\theta &= x \, \mathrm dx \\ \implies (x^2+4)\sqrt{\dfrac{x^2+1}3}\,\mathrm d\theta &=x\,\mathrm dx \\ \implies \mathrm d\theta &=\dfrac{\sqrt 3 x\,\mathrm dx}{(x^2+4)\sqrt{x^2+1}}\end{align}$$
Hence the integral now becomes $$\int\dfrac{\sqrt3 x^2 \mathrm dx}{(x^2+4)\sqrt{x^2+1}}$$
and the rest follows.
