Example 1. Suppose that $f(x)$ is a function continuous on the entire real line and periodic with period $2 \pi$. Derive the formulas for computing the coefficients of its Fourier series.
Solution. Suppose the given function is represented by a trigonometric series that converges uniformly on the entire line, in particular on the interval $[-\pi ; \pi]$, and write this series as: $f(x)=\frac{\alpha_{0}}{2}+\alpha_{\mathrm{I}} \cos x+\beta_{\mathrm{I}} \sin x+$

$$
+\alpha_{2} \cos 2 x+\beta_{2} \sin 2 x+\alpha_{3} \cos 3 x+\beta_{3} \sin 3 x+\ldots
$$

1) Integrate this equality term by term on the interval $[-\pi ; \pi]$ (this is possible due to the uniform convergence of the series). Since

$\int_{-\pi}^{\pi} \cos m x d x=\left.\frac{1}{m} \sin m x\right|_{-\pi} ^{\pi}=0, \int_{-\pi}^{\pi} \sin m x d x=-\left.\frac{\cos m x}{m}\right|_{-\pi} ^{\pi}=0, m \in N$,

we arrive at the equality: $\int_{-\pi}^{\pi} f(x) d x=\int_{-\pi}^{\pi} \frac{\alpha_{0}}{2} d x=\left.\frac{\alpha_{0}}{2} x\right|_{-\pi} ^{\pi}=\pi \cdot \alpha_{0}$. Thus, $\alpha_{0}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) d x$. This gives us the first coefficient of the Fourier series (see point $1^{\circ}$).

2) Multiply both sides of the equality (*) by $\cos n x$ (where $n$ is some fixed number) and integrate the resulting expression term by term on the interval $[-\pi ; \pi]$. Since

$\int_{-\pi}^{\pi} \cos m x \cos n x d x=\frac{1}{2} \int_{-\pi}^{\pi}[\cos (m+n) x+\cos (m-n) x] d x=0, \quad m \neq n$

$\int_{-\pi}^{\pi} \cos n x \sin m x d x=\frac{1}{2} \int_{-\pi}^{\pi}[\sin (m+n) x+\sin (m-n) x] d x=0, \quad m \neq n ;$

$$
\int_{-\pi}^{\pi} \cos ^{2} n x d x=\frac{1}{2} \int_{-\pi}^{\pi}(1+\cos 2 n x) d x=\frac{1}{2} \cdot 2 \pi=\pi
$$

we arrive at the equality $\int_{-\pi}^{\pi} f(x) \cos n x d x=\pi \cdot \alpha_{n}$.

Thus, $\alpha_{n}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos n x d x$, and we have obtained all the coefficients of the Fourier series for the cosines.

3) Multiply the equality (*) by $\sin n x$ (where $n$ is fixed), integrate term by term on the interval $[-\pi ; \pi]$ taking into account 2) and the equalities

$$
\begin{gathered}
\int_{-\pi}^{\pi} \sin n x \sin m x d x=\frac{1}{2} \int_{-\pi}^{\pi}[\cos (n-m) x-\cos (n+m) x] d x=0, m \neq n \\
\int_{-\pi}^{\pi} \sin ^{2} n x d x=\frac{1}{2} \int_{-\pi}^{\pi}(1-\cos 2 x) d x=\pi
\end{gathered}
$$

We obtain $\beta_{n}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin n x d x$, i.e., all the coefficients of the Fourier series for the sines.
Note. Similarly, one can obtain generalized formulas for the Fourier coefficients for functions with an arbitrary period $2 l$.