Example 1. Expand the function $y=x+1$ into a Fourier series on the interval $(0,1)$ with respect to the system $1, \cos \pi x, \cos 2 \pi x, \ldots, \cos n \pi x, \ldots$
Solution. The required Fourier series expansion of the function $y=x+1$ on the interval $(0,1)$ with respect to the system $1, \cos \pi x, \cos 2 \pi x, \ldots, \cos n \pi x, \ldots$ is given by (2).

1. We check that

$$
\int_{0}^{1} f(x)^{2} d x<\infty
$$

The inequality holds because the function $y=x+1$ is bounded on $(0,1)$.

2. We compute the coefficients $a_{0}, a_{1}, \ldots$ using the Euler-Fourier formulas $(3)-\left(3^{\prime}\right)$. We have

$$
\begin{aligned}
& a_{0}=\frac{1}{1} \int_{0}^{1}(x+1) d x=\frac{3}{2} \\
& a_{n}=\frac{2}{1} \int_{0}^{1}(x+1) \cos n \pi x d x=\frac{2}{\pi^{2}} \frac{\cos n \pi-1}{n^{2}}=\frac{2}{\pi^{2}} \frac{(-1)^{n}-1}{n^{2}} .
\end{aligned}
$$

3. We substitute the found values of the coefficients $a_{0}, a_{1}, \ldots$ into (2). We obtain

$$
x+1=\frac{3}{2}+\frac{2}{\pi^{2}} \sum_{n=1}^{\infty} \frac{(-1)^{n}-1}{n^{2}} \cos n \pi x
$$

Answer. $x+1=\frac{3}{2}+\frac{2}{\pi^{2}} \sum_{n=1}^{\infty} \frac{(-1)^{n}-1}{n^{2}} \cos n \pi x, x \in(0, l)$.