By considering $$ \sum_{k=0}^{n-1}(1+i\tanθ)^k\tag{1}$$ Show that $$ \sum_{k=0}^{n-1}\cos(kθ)\sec^kθ=\cotθ\sin(nθ)\sec^nθ\tag{2}$$ Provided $θ$ is not an integer multiple of $\frac{π}{2}$.
My take on this was by taking the real part of $(1)$ and simplifying, I get the left hand side of $(2)$. Then, by noticing $(1)$ is a geometric progression, the sum of the first $n-1$ terms is: $$\frac{(1+i\tanθ)^n-1}{i\tanθ}$$ I'm stuck here, as I do not know how to expand this, and multiplying by its conjugate did nothing I am aware of.