# How to get the general form of functions in the ring of trigonometric polynomials

The ring of trigonometric functions over $\mathbb{R}$ is the ring generated by $\sin{x}$ and $\cos{x}$.

What's the reason for why any function $f$ in this ring can be written as $$f(x)=a_0+\sum_{k=1}^n(a_k\cos{kx}+b_k\sin{kx})$$ for $a_0,a_k,b_k\in\mathbb{R}$?

-

Observe that $\mathbb{R}[\sin x, \cos x] \subset \mathbb{C}[e^{ix}].$ Hence for any element $f \in \mathbb{R}[\sin x, \cos x]$ there exist elements $a_i\in\mathbb{C}$
$$f(x) = \sum_{i=0}^{n} a_n(e^{ix})^n = \sum_{i=0}^{n} a_n(\cos nx + i \sin nx).$$
$$f(x) = \sum_{i=0}^n \operatorname{Re}(a_n)\cos nx + \operatorname{Re}(ia_n) \sin nx,$$