\(tan \frac{x}{2} =\pm \sqrt{\frac{1-cos x}{1+cos x}}\)
Find cos using trig identities:
\(sec x = \frac{1}{cos x} \\ tan^2 x = sec^2 x -1\)
Therefore
\(cos x = \frac{1}{sec x} =\pm \frac{1}{\sqrt{tan^2 x +1}}\)
Sub in tan x = 3, (Note that x is in 3rd quadrant, cos x < 0)
\(cos x =- \frac{1}{\sqrt{3^2 +1}} = -\frac{1}{\sqrt{10}}\)
Finally, sub into Half-angle formula:(Note x/2 is in 2nd quadrant, tan x<0)\(tan \frac{x}{2} = -\sqrt{\frac{1+\frac{1}{\sqrt{10}}}{1-\frac{1}{\sqrt{10}}}} = - \sqrt{\frac{\sqrt{10} +1}{\sqrt{10}-1}}\)