Let $g(x)$ $=$ $1/2$ $p_0$ + $\sum_{k=1}^{n}$ $(p_k \cos(kx)+ q_k \sin(kx))$ be a trigonometric polynomial.
How can I explain why its Fourier coefficients are $a_k$ $=$ $p_k$ and $b_k$ $=$ $q_k$ for $k$ $≤$ $n$,
while $a_k$ $=$ $b_k$ $=$ $0$ for $k$ $>$ $n$ $?$
Someone gave me the hint to solve the equations I have shown down here
1) $$\int_{0}^{2\pi}\sin(k_1x)\cos(k_2x)dx = 0$$
and that
2) $$\int_{0}^{2\pi}\sin(k_1x)\sin(k_2x)dx=\int_{0}^{2\pi}\cos(k_1x)\cos(k_2x)dx=0$$ unless $k_1 = k_2$
I found for 1) $k_1 = 0$ and then $k_2$ $\in$ ${R}$ and for 2) I found $k_1 = k_2$ but I doubt that this is correct.
Someone who’s able to help me?