Is there a formula for $(1+i)^n+(1-i)^n$?
I'm wondering if there is a formula for the value of $(1+i)^n+(1-i)^n$?
I calculated the first terms starting with $n=1$ to be, in order, $2$, $0$, $-4$, $-8$, $-8$, $0$, $16$, $\dots$
So it seems to be some sequence of positive and negative powers of $2$ with $0$s thrown in. Is there a more explicit formulation of what $(1+i)^n+(1-i)^n$ is, based on $n$?
With the binomial theorem, I get it equal to $$ \sum_{k=0}^n\binom{n}{k}i^{n-k}(1+(-1)^{n-k}). $$ Can this be made nicer? Thanks.
Let us avoid the binomial theorem.
Since $1-\mathrm i$ is the conjugate of $1+\mathrm i$, the number $\color{red}{x_n=(1+\mathrm i)^n+(1-\mathrm i)^n}$ is twice the real part of $(1+\mathrm i)^n$.
Since $\frac{1+\mathrm i}{\sqrt2}=\mathrm e^{\mathrm i\pi/4}$, $(1+\mathrm i)^n$ is $(\sqrt2)^n$ times $\mathrm e^{\mathrm in\pi/4}$.
The real part of $\mathrm e^{\mathrm in\pi/4}$ is $\cos(n\pi/4)$.
Thus, $\color{red}{x_n=\ldots}$
First, notice that $1+i = \sqrt2(\cos\frac{\pi}{4} + i \sin\frac{\pi}{4}$) and $1-i = \sqrt2(\cos(-\frac{\pi}{4}) + i \sin(-\frac{\pi}{4}))$.
Using de Moivre's formula and the fact that $\sin$ is odd and $\cos$ is even, we get
\begin{align*} (1+i)^n + (1-i)^n &= 2(\sqrt2)^n\cos\frac{n\pi}{4} \end{align*}
This is not a particularly elegant solution, but an alternative route is to simply note that $(1 \pm i)^2 = \pm 2i$. I will show a lot of steps, but this method involves only very easy calculations. If $n$ is even, then
$$ (1\pm i)^n = \left((1+i)^2\right)^{ \frac{n}{2}}= (\pm 2i)^{n/2} = \left\{ \begin{array}{ccl} 2^{n/2} & & n = 8k \\ \pm i \cdot 2^{n/2}& & n = 8k +2 \\ i \cdot 2^{n/2} & & n = 8k + 4 \\ \mp i 2^{n/2} & & n = 8k + 6 \end{array} \right. $$
Hence,
$$(1+i)^n + (1-i)^n = \left\{ \begin{array}{ccl} 2^{\frac{n}{2}+1} & & n = 8k \\ 0 & & n = 8k+2 \text{ or } n = 8k+6 \\ i \cdot 2^{\frac{n}{2}+1} & & n = 8k + 4 \end{array} \right. $$
This is all you need since if $n$ is odd, then $n-1$ is even. For example, when $n = 8k + 1$, we have $$\begin{align} (1+i)^n + (1 - i)^n &= (1+i)^{n-1}(1+i) + (1 -i)^{n-1}(1-i) \\ &= 2^{\frac{n-1}{2}}(1+i) + 2^{\frac{n-1}{2}} (1-i) \\ &= 2^{\frac{n-1}{2}} + i 2^{\frac{n-1}{2}} + 2 ^{\frac{n-1}{2}} - i 2^{\frac{n-1}{2}} \\ &= 2\cdot 2^{\frac{n-1}{2}} \\ &= 2^{\frac{n+1}{2}}. \end{align}$$
The cases $n = 8k+3$, $n=8k+5$, and $n = 8k + 7$ follow similarly.
$(1+i)^n+(1-i)^n = 2 \Re ((1+i)^n)$. Now expand $(1+i)^n$ using the binomial theorem. The real part is formed by the odd-numbered terms.
Another approach is to note that $(1+i)/\sqrt{2}$ is an 8-th root of unity and so $(1+i)^n$ depends only on $n \bmod 8$ except for a power of $\sqrt{2}$.