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.

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$$
