In a book$^1$ (pp. 451), it is written that "...It is known that from the theory of Fourier series that if the function is reducible to a trigonometric polynomial, then to know its Fourier coefficients it is sufficient to know the values of this function at certain points only."
My question is, in the same book, we have the following functions of $u_m$,
$$u_1=\sum_{k=0}^{\frac{m}{2}}\left(a_k\cos\frac{2\pi}{m}k-b_k\sin\frac{2\pi}{m}k\right)$$ $$\dots\dots$$ $$u_n=\sum_{k=0}^{\frac{m}{2}}\left(a_k\cos\frac{2\pi}{m}nk-b_k\sin\frac{2\pi}{m}nk\right)$$ $$\dots\dots$$ $$u_m=\sum_{k=0}^{\frac{m}{2}}\left(a_k\cos 2\pi k-b_k\sin2\pi k\right)$$
where $m$ divides the angle $2\pi$ of a unit circle into $m$ equal parts. It is written that the coefficient $a_k$ and $b_k$ can be solved using the following formulas, $$a_k=\frac{2}{m} \sum_{n=1}^{m} u_n \cos \frac{2\pi}{m}nk$$ $$b_k =-\frac{2}{m} \sum_{n=1}^{m} u_n \sin \frac{2\pi}{m}nk $$ $$a_0=\frac{1}{m} \sum_{n=1}^{m} u_n$$ $$a_{\frac{m}{2}} = \frac{1}{m} \sum_{n=1}^{m} (-1)^nu_n$$ $$b_0 = -\sum_{k=1}^{\frac{m}{2}} b_k$$
Can someone help me how to derive this equations, i.e., from the first formulae to the second formulae?
Reference: 1. KANTOROVICH, L. & KRYLOV, V. 1958. Approximate Methods of Higher Analysis, Noordhoff.