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?

We have $$\sum_{k=0}^{n-1} (1+i\tan{x})^k=\sum_{k=0}^{n-1} \left(\frac{\cos x+i\sin x}{\cos x}\right)^k=\sum_{k=0}^{n-1}\frac{\cos kx+i\sin kx}{(\cos x)^k}$$
The real part of this expression is $$\sum_{k=0}^{n-1}\cos kx(\sec x)^k$$ and we have to show that it is equal to $$\cot{x}\sin{nx}(\sec{x})^n=\frac{\sin nx}{\sin x(\cos x)^{n-1}}$$ By induction it is clear that it is true for $n=1$ ( in whose case we have $1=1$). Let it true for $n-1$ and prove so is for $n$. Is it true that
$$\frac{\sin nx}{\sin x(\cos x)^{n-1}}+\frac{\cos nx}{(\cos x)^n}=\frac{\sin (n+1)x}{\sin x(\cos x)^n}\large?$$ Yes because LHS is equivalent to
$$\frac{\sin nx\cos x+\cos nx\sin x}{\sin x(\cos x)^n}=\frac{\sin(nx+x)}{\sin x(\cos x)^n}$$ which is equal to RHS.
