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}$?

If you let $$\sqrt{1+i}=x+iy$$, then $$(x^2-y^2)+i2xy=1+i$$. then $$x^2-y^2=1$$ and $$2xy=1$$. Hence $$(x^2+y^2)^2=(x^2-y^2)^2+4x^2y^2=2$$. Hence $$x^2+y^2=\sqrt{2}$$. Now adding this two terms $$x^2=\frac{1+\sqrt{2}}{2}$$ and $$y^2=\frac{\sqrt{2}-1}{2}$$. So $$\sqrt{1+i} =\sqrt{\frac{1+\sqrt{2}}{2}}+i\sqrt{\frac{\sqrt{2}-1}{2}}$$
You already have $$\sqrt{1+i} = 2^{1/4}e^{i\pi/8}=2^{\frac{1}{4}}\left(\cos \frac{2\pi}{8}+ i\sin \frac{2 \pi}{8}\right)$$
Comparing both these $$\cos \frac{ \pi}{8}=\frac{1}{2^{\frac{1}{4}}}\sqrt{\frac{\sqrt{2}+1}{2}}$$ and $$\sin \frac{ \pi}{8}=\frac{1}{2^{\frac{1}{4}}}\sqrt{\frac{\sqrt{2}-1}{2}}$$
Then you have your answer
