Summation of Complex Number By considering $\sum_{k=0}^{n-1} (1+i\tan{x})^k$ , show that $\sum_{k=0}^{n-1}(\cos{kx}(\sec{x})^{k} = \cot{x}\sin{nx}(\sec{x})^n$. Provided that $x$ is not a multiple of 0.5π
I know that the show part is just the real part of the first sum given, but I have no idea how to compute that. Any suggestions?

Hint:
$$1+i \tan x = 1+i \frac{\sin x }{\cos x}$$
Thus
\begin{align}
\left(1+i \tan x \right)^{k} &= \left( 1+i \frac{\sin x }{\cos x} \right)^{k} \\
                             &= \sec^{k}x \left(\cos x + i \sin x\right)^{k} \\
&= e^{ikx} \sec ^{k}x
\end{align}
