Can you apply generalized binomial theorem on $(1+e^{i\theta})^n$ where $\theta\in\mathbb R$?

64 Views Asked by At

While solving a definite integral, I have done this myself i.e, expand $(1+e^{i\theta})^n$ for real $\theta$.

enter image description here

The generalized binomial expansion of $(1+x)^n$ requires that $|x|<1$.

I ended up with correct answer in that integral. However, when I look back, what bugs me is that $|e^{i\theta}| = 1$, so binomial theorem shouldn't be applicable. Can anyone help me clear my confusion?