We have
0 < π/12 < π/2
and
tan(π/12) = sin(π/12) / cos(π/12)
Both sin(x) and cos(x) are positive for 0 < x < π/2, so we expect tan(π/12) to also be positive.
Recall the double-angle identities for cosine,
cos²(x) = (1 + cos(2x)) / 2
as well as the Pythagorean identity,
tan²(x) = sec²(x) - 1
and by definition,
sec(x) = 1 / cos(x)
Putting everything together, we have
tan(x) = √(1 / cos²(x) - 1)
tan(x) = √(2 / (1 + cos(2x)) - 1)
Let x = π/12. Then 2x = π/6, and cos(π/6) = √3 / 2, so that
tan(π/12) = √(2 / (1 + cos(π/6)) - 1)
tan(π/12) = √(2 / (1 + √3 / 2) - 1)
tan(π/12) = √(4 / (2 + √3) - 1)
tan(π/12) = √(4 / (2 + √3) - (2 + √3) / (2 + √3))
tan(π/12) = √((2 - √3) / (2 + √3))
tan(π/12) = √(7 - 4 √3)