What am I supposed to do here now? $\tan(\pi/8) = \sqrt{2} -1$ complex analysis 
Find $\sqrt{1+i}$, and hence show $\tan(\pi/8) = \sqrt{2}-1$

Okay so I know that $\sqrt{1+i} = 2^{1/4}e^{i\pi/8}$ and I know $\sin x = \frac{e^{ix} - e^{-ix}}{2i}$ and $\cos x = \frac{e^{ix} + e^{-ix}}{2}$
If i directly substitute those definitions of sine and cosine into $$\tan(x) = \frac{\sin(x)}{\cos(x)}$$
then I am going to end up with a complex number in the form of $x + iy$. My key says 
$$\tan \pi/8 = \sqrt{\frac{\sqrt{2}-1}{\sqrt{2}+1}} = \sqrt{2}-1.$$
Did they just use $\Re(\tan \pi/ 8) = \frac{\Re (\sin )}{\Re \cos}$?

You can work it out by rationalizing *
You can use a half-angle formula for Tan, i.e., a formula for Tan(B/2)
$tan(B/2)  =  (1 − cos B) / sin B  =  sin B / (1 + cos B)$
For CosB=SinB =$\sqrt \frac{2}{2}$, then , $Tan \pi/8= \frac{\frac{\sqrt{2}}{2}}{1+\frac{\sqrt{2}}{2}}=\frac{\sqrt2}{2+\sqrt2}=\frac{2\sqrt2-2}{2}=\sqrt{2}-1$
If you want to arrive at the actual values of $\sqrt{2}-1, \sqrt{2}+1$ for sin, cos, you can use DeMoivre's theorem:
$(Cos\theta+iSin\theta)^{1/2}=(Cos\theta/2+ iSin \theta/2)$, and then you can use half-angle formulas for each of sine and cosine:
$cos(B/2) = ± \sqrt{([1 + cos B] / 2)}$
$Sin(B/2) = ±\sqrt{([1 - cos B] / 2})$
And in this case, $SinB=CosB= \frac{\sqrt{2}}{2}$
