Finding $\tan \pi/8$ from $\sqrt{1+i}$. I want to prove that $\tan \pi/8 = \sqrt{2} - 1$ using $\sqrt{1+i}$ in some way.
Write: $\sqrt{1+i} = a+bi$, and let's find $a$ and $b$. We have: $$1+i = a^2+b^2 + 2abi,$$ so $a^2+b^2 = 1$ and $ab = 1/2$. This already seems wrong to me, because we know that $|1+i| = \sqrt{2} \implies |\sqrt{1+i}| = \sqrt[4]{2},$ regardless of what root we choose. Let's pretend everything is ok. Substituition gives $$a^2 + \frac{1}{4a^2} = 1 \implies a^4 - a^2 + \frac{1}{4} = 0 \implies a^2 = \frac{1}{2} \implies a = \pm \frac{\sqrt{2}}{2},$$ and $$b = \pm\frac{1}{2\frac{\sqrt{2}}{2}} = \pm\frac{\sqrt{2}}{2} = a.$$ 
And writing $1+i = re^{i((\pi/4)+2k\pi)}$, we get the roots are given by $\sqrt[4]{2}e^{i((\pi/8)+k\pi)}$.
Now, $z = x+iy \implies \tan \arg(x+iy) = y/x$ would give us $\tan \pi/8 = 1$!
Can someone give me a light here? It must be simple, but I'm failing to make sense of this. Thanks.

Yes, I know better ways to find $\tan \pi/8$. I want to do it this way.

Another path could start with
$$\displaystyle \tan(2x)=\frac{2\tan x}{1-\tan^2 x},$$
putting $x=\pi/8$, using $\displaystyle \tan(\pi/4)=1$, then solving easily
$$
\frac{2y}{1-y^2 }=1
$$ to get
$$
\displaystyle \tan(\pi/8)=\sqrt{2}-1.
$$
