Euclidean division exercise

Write the reminder $aX+b$. You have

$$P(X) = (\cos \omega + \sin\omega X)^n =Q(X)(X^2+1) +aX+b.$$

Substitute in this equation $X$ by $i$. You get $$e^{in \omega} = ai+b.$$ Substitute now $X$ by $-i$. You get

$$e^{-in \omega} = -ai+b$$

Solving in $a,b$ you finally get $b =\cos n\omega$ and $a = \sin n\omega$.


This is essentially the same answer as mathcounterexamples.net's answer, but it's a slightly different explanation and thought process, which seems to me to be slightly more natural (though I did upvote mce.net's answer). Hence I'll give my thought process on seeing this question.

We can calculate the remainder on division by a polynomial $f\in k[x]$ by working in the ring $k[x]/(f)$, since the remainder of a polynomial $a$ on division by $f$ is the unique representative of $a$ in $k[x]/(f)$ of degree less than the degree of $f$.

Then recognize that $\Bbb{R}[X]/(X^2+1)\cong \Bbb{C}$ via $X\mapsto i$. Thus $(\cos \omega +X\sin \omega)^n\mapsto (e^{i\omega})^n=e^{i\omega n} = \cos(n\omega) + i \sin(n\omega)$. Thus the remainder on division by $X^2+1$ must be $\cos(n\omega)+X\sin(n\omega)$.