<s>[INST] Given $\tan 3x=4$, find the value of $\tan^2 x+\tan ^2(120+x)+\tan^2 (60+x)$ Given $\tan 3x=4$, find the value of $S=\tan^2 x+\tan ^2(120+x)+\tan^2 (60+x)$
I expanded each of $\tan (120+x)$ and $\tan (60+x)$ getting as
$$S=\tan^2 x+\left(\frac{\tan 120+\tan x }{1-\tan 120 \tan x}\right)^2+\left(\frac{\tan 60+\tan x }{1-\tan 60 \tan x}\right)^2$$ so
$$S=\tan^2 x+\left(\frac{-\sqrt{3}+\tan x }{1+\sqrt{3} \tan x}\right)^2+\left(\frac{\sqrt{3}+\tan x }{1-\sqrt{3} \tan x}\right)^2$$
so
$$S=\tan^2 x+\frac{\left(4\tan x-\sqrt{3}(1+\tan^2x)\right)^2+\left(4\tan x+\sqrt{3}(1+\tan^2x)\right)^2}{(1-3\tan^2 x)^2}$$ so
$$S=\tan^2 x+\frac{\left(32 \tan^2 x+6(1+\tan^2 x)^2\right)}{(1-3\tan^2 x)^2}$$
but if i proceed further i dot think i will get an expression in terms of $\tan 3x$.
 [/INST] As $a=\tan x,$
$b=\tan(60^\circ+x),\tan3(60^\circ+x)=\cdots=\tan3x,$  
and $c=\tan(120^\circ+x),\tan3(120^\circ+x)=\cdots=\tan3x$
The roots of 
$$4=\tan3y=\dfrac{3\tan y-\tan^3y}{1-3\tan^2y}$$
$$\iff\tan^3y-12\tan^2y-3\tan y+4=0$$ are $a,b,c$
We need $a^2+b^2+c^2=(a+b+c)^2-2(ab+bc+ca)$
</s>