Recall the half angle identities for sine and cosine:
[tex]\sin^2x=\dfrac{1-\cos2x}2[/tex]
[tex]\cos^2x=\dfrac{1+\cos2x}2[/tex]
So you have
[tex]\tan^2x=\dfrac{1-\cos2x}{1+\cos2x}[/tex]
This is useful because we have
[tex]\tan^2\dfrac\pi{24}=\dfrac{1-\cos\dfrac\pi{12}}{1+\cos\dfrac\pi{12}}[/tex]
Unfortunately, we need to know the value of [tex]\cos\dfrac\pi{12}[/tex] to continue. But we can use either of the half-angle identities to figure this out.
[tex]\cos^2\dfrac\pi{12}=\dfrac{1+\cos\dfrac\pi6}2[/tex]
[tex]\cos^2\dfrac\pi{12}=\dfrac{1+\dfrac{\sqrt3}2}2[/tex]
[tex]\cos^2\dfrac\pi{12}=\dfrac{2+\sqrt3}4[/tex]
[tex]\cos\dfrac\pi{12}=\dfrac{\sqrt{2+\sqrt3}}2[/tex]
where you take the positive root since [tex]\cos x[/tex] is positive when [tex]0\le x<\dfrac\pi2[/tex].
So, you have
[tex]\tan^2\dfrac\pi{24}=\dfrac{1-\dfrac{\sqrt{2+\sqrt3}}2}{1+\dfrac{\sqrt{2+\sqrt3}}2}[/tex]
[tex]\tan^2\dfrac\pi{24}=\dfrac{2-\sqrt{2+\sqrt3}}{2+\sqrt{2+\sqrt3}}[/tex]
[tex]\tan\dfrac\pi{24}=\sqrt{\dfrac{2-\sqrt{2+\sqrt3}}{2+\sqrt{2+\sqrt3}}}[/tex]
again taking the positive root because [tex]\tan x[/tex] is positive when [tex]0<x<\dfrac\pi2[/tex].