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

1. We check that

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

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

2. We compute the coefficients $a_{0}, a_{1}, \ldots$ using the Euler-Fourier formulas (7). We have

$$
\begin{aligned}
a_{n}=\frac{2}{\pi} \int_{0}^{\pi}(x+1) \cos \frac{2 n+1}{2} x d x= & \frac{4(\pi+1)}{\pi} \frac{\sin (\pi / 2+n \pi)}{2 n+1}= \\
& =\frac{4(\pi+1)}{\pi} \frac{(-1)^{n}}{2 n+1}, \quad n=0,1, \ldots
\end{aligned}
$$

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

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

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

Conditions of the Problems. Expand the function $y=f(x)$ into a Fourier series on the interval $(0, \pi)$ with respect to the specified system.

1. $f(x)=x+1$ with respect to $\sin x, \sin 2 x, \ldots, \sin n x, \ldots$
2. $f(x)=x+1$ with respect to $\sin \frac{1}{2} x, \sin \frac{3}{2} x, \ldots, \sin \frac{2 n+1}{2} x, \ldots$
3. $f(x)=x(\pi-x)$ with respect to $1, \cos x, \cos 2 x, \ldots, \cos n x, \ldots$
4. $f(x)=x(\pi-x)$ with respect to $\sin x, \sin 2 x, \ldots, \sin n x, \ldots$
5. $f(x)=x^{2}$ with respect to $\cos \frac{1}{2} x, \cos \frac{3}{2} x, \ldots, \cos \frac{2 n+1}{2} x, \ldots$
6. $f(x)=x^{2}$ with respect to $\sin \frac{1}{2} x, \sin \frac{3}{2} x, \ldots, \sin \frac{2 n+1}{2} x, \ldots$
7. $f(x)=e^{x}$ with respect to $1, \cos x, \cos 2 x, \ldots, \cos n x, \ldots$
8. $f(x)=e^{x}$ with respect to $\sin x, \sin 2 x, \ldots, \sin n x, \ldots$
9. $f(x)=e^{x}$ with respect to $\cos \frac{1}{2} x, \cos \frac{3}{2} x, \ldots, \cos \frac{2 n+1}{2} x, \ldots$
10. $f(x)=e^{x}$ with respect to $\sin \frac{1}{2} x, \sin \frac{3}{2} x, \ldots, \sin \frac{2 n+1}{2} x, \ldots$

## Answers.

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