tan π/12 = tan ((4π-3π)/12) =tan( 4π/12 - 3π/12)= tan( π/3- π/4)
The formula for tangent subtraction is
tan(a-b) = ( tan(a)-tan(b))/(1+tan(a)tan(b))
Let a= π/3 and b = π/4
tan(π/3 -π/4) = ( tan(π/3 )-tan(π/4))/(1+tan(π/3 )tan(π/4))
=(√3-1)/(1+ √3)
Now multiply top and bottom by the conjugate of the bottom
(√3-1)/(1+ √3) x (1- √3)/(1- √3) =(2√3-4)/(-2) = (2(√3-2))/(-2) = -(√3-2)