Find the value of the integral $\int_{0}^{\frac{\pi}{12}}\frac{\tan^2x-3}{3\tan^2x-1}dx$ Find the value of the integral $\int_{0}^{\frac{\pi}{12}}\frac{\tan^2x-3}{3\tan^2x-1}dx$

$\int_{0}^{\frac{\pi}{12}}\frac{\tan^2x-3}{3\tan^2x-1}dx$
$=\int_{0}^{\frac{\pi}{12}}\frac{1}{3}\frac{\tan^2x-\frac{1}{3}+\frac{1}{3}-3}{\tan^2x-\frac{1}{3}}dx$
$=\frac{1}{3}-\frac{8}{9}\int_{0}^{\frac{\pi}{12}}\frac{dx}{\tan^2x-\frac{1}{3}}dx$
$=\frac{1}{3}-\frac{8}{9}\int_{0}^{\frac{\pi}{12}}\frac{\cot^2x dx}{1-\frac{1}{3}\cot^2x}dx$
$=\frac{1}{3}-\frac{8}{9}\int_{0}^{\frac{\pi}{12}}\frac{\cot^2x dx}{\frac{4}{3}-\frac{1}{3}\csc^2x}dx$
I am stuck here and could not solve further.Please help me.
 A: $$u=\tan(x)$$
$$du=(\tan^2x+1) dx$$
$$\int_{0}^{\frac{\pi}{12}}\frac{\tan^2x-3}{3\tan^2x-1}dx=\int_{0}^{\tan\frac{\pi}{12}}\frac{u^2-3}{(3u^2-1)(u^2+1)}du$$
$$=\int_{0}^{\tan\frac{\pi}{12}}(\frac1{u^2+1}-\frac2{3u^2-1})du$$
$$=\int_{0}^{\tan\frac{\pi}{12}}(\frac1{u^2+1}+\frac{\sqrt3}{3u+\sqrt3}-\frac{\sqrt3}{3u-\sqrt3})du$$
$$=(\tan^{-1}u+\frac{\sqrt3}3\ln |\frac{1}{3u+\sqrt3}|-\frac{\sqrt3}3\ln |\frac{1}{3u-\sqrt3}|)~~|_0^{\tan\frac{\pi}{12}}$$
$$=(\tan^{-1}u+\frac{\sqrt3}3\ln |\frac{1}{3u+\sqrt3}|-\frac{\sqrt3}3\ln |\frac{1}{3u-\sqrt3}|)~~|_0^{\tan\frac{\pi}{12}}$$
$$=\tan^{-1}\tan\frac{\pi}{12}-\frac{\sqrt3}{3}\ln \frac{\sqrt3-3\tan\frac{\pi}{12}}{\sqrt3+3\tan\frac{\pi}{12}}$$
$$=\frac{\pi}{12}-\frac{\sqrt3}{3}\ln \frac{\sqrt3-3\tan\frac{\pi}{12}}{\sqrt3+3\tan\frac{\pi}{12}}$$
$$\approx 0.8420667415917798898282846513866$$
Notice that different methods of solving lead into the same result but maybe with different formats. They must be numerically equal. As an example $\frac1{12}(\pi - 8 \sqrt3 \tanh^{-1}(3 - 2 \sqrt3))$ seems to be different but in fact is equal to the answer obtained above.
A: HINT: convert your integrand into $\frac{4\cos(x)^2-1}{4\cos(x)^2-3}$ and use the tan-half angle formulas
the result should be $$2/3\,\sqrt {3}{\rm arctanh} \left(\cot \left( {\frac {5\,\pi }{12}}
 \right) \sqrt {3}\right)+\pi /12
$$
