$(1+i)$ to the power $n$ 
Possible Duplicate:
Complex number: calculate $(1 + i)^n$. 

I came across a difficult problem which I would like to ask you about:
Compute
$ (1+i)^n $ for $ n \in \mathbb{Z}$
My ideas so far were to write out what this expression gives for $n=1,2,\ldots,8$, but I see no pattern such that I can come up with a closed formula.
Then I remember that one can write any complex number $a+bi$ like:
$$(a+bi)=\sqrt{a^2+b^2} \cdot \left( \frac{a}{\sqrt{a^2+b^2}}+\frac{b}{\sqrt{a^2+b^2}}\cdot i\right)$$
and $\frac{a}{\sqrt{a^2+b^2}} = \cos(\phi)$ and $\frac{b}{\sqrt{a^2+b^2}} = \sin(\phi)$  where $\phi$ is $\arctan{\frac{b}{a}} $
So it becomes, 
$(a+bi)=\sqrt{a^2+b^2} \cdot ( \cos(\phi)+\sin(\phi)\cdot i)$ Taking this entire thing to the power $n$ using De Moivre
$$(a+bi)^n=(\sqrt{a^2+b^2})^n \cdot ( \cos(n\phi)+\sin(n\phi)\cdot i)$$
Substituting my $a=1$ and $b=1$
$(1+i)^n=(\sqrt{2})^n \cdot ( \cos(n\cdot\frac{\pi}{4})+\sin(n\cdot\frac{\pi}{4})\cdot i)$
$\phi$ is 45 degrees hence $\frac{\pi}{4}$
But now I don't know how to continue further and I would really appreciate any help! Again, Im looking for a closed formula depending on n.
Best regards

You have a closed form already if you do just a little more work:
$$\begin{align*}
(1+i)^n&=\left(\sqrt{2}\right)^n\left(\cos\frac{n\pi}4+i\sin\frac{n\pi}4\right)\\
&=2^{n/2}\left(\cos\frac{n\pi}4+i\sin\frac{n\pi}4\right)\\
&=\begin{cases}
2^{n/2},&\text{if }n\equiv 0\pmod 8\\
2^{n/2}\left(\frac{\sqrt2}2+\frac{\sqrt2}2i\right),&\text{if }n\equiv 1\pmod 8\\
2^{n/2}i,&\text{if }n\equiv 2\pmod 8\\
2^{n/2}\left(\frac{\sqrt2}2-\frac{\sqrt2}2i\right),&\text{if }n\equiv 3\pmod 8\\
-2^{n/2},&\text{if }n\equiv 4\pmod 8\\
-2^{n/2}\left(\frac{\sqrt2}2+\frac{\sqrt2}2i\right),&\text{if }n\equiv 5\pmod 8\\
-2^{n/2}i,&\text{if }n\equiv 6\pmod 8\\
-2^{n/2}\left(\frac{\sqrt2}2-\frac{\sqrt2}2i\right),&\text{if }n\equiv 7\pmod 8\;.
\end{cases}\\
\end{align*}$$
A function defined by cases is still a closed form. You can do better, though, if you allow the exponential form of the complex number: $1+i=\sqrt2 e^{i\pi/4}$, so 
$$(1+i)^n=2^{n/2}e^{in\pi/4}\;.$$
