Example 2. Expand the function $y=x^{3}$ into a Fourier series on the interval $(-1,1)$ using the system of Legendre polynomials.
Solution. The Legendre polynomials are defined by the formula

$$
P_{n}(x)=\frac{1}{2^{n} n!} \frac{d^{n}}{d x^{n}}\left(x^{2}-1\right)^{n}, \quad n=0,1,2, \ldots
$$

They form an orthogonal basis in the space of functions defined on the interval $(-1,1)$, with the scalar product

$$
(u, v)=\int_{-1}^{1} u(x) v(x) d x
$$

The desired expansion of the function $y=x^{3}$ in a Fourier series on the interval $(-1,1)$ with respect to the system $P_{0}(x), P_{1}(x), P_{2}(x), \ldots$ is given by

$$
x^{3}=\sum_{n=0}^{\infty} a_{n} P_{n}(x), \quad x \in(-1,1)
$$

where the coefficients $a_{0}, a_{1}, a_{2}, \ldots$ are determined by the Euler-Fourier formulas:

$$
a_{n}=\frac{\left(x^{3}, P_{n}(x)\right)}{\left(P_{n}(x), P_{n}(x)\right)}=\frac{\int_{-1}^{1} x^{3} P_{n}(x) d x}{\int_{-1}^{1} P_{n}(x)^{2} d x}
$$

1. We check that

$$
\int_{-1}^{1} x^{6} d x3$ are equal to zero.

The integrals

$$
\int_{-1}^{1} P_{n}(x)^{2} d x
$$

can also be computed using formula (6) and integrating by parts. It was established that

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

Substituting the computed integrals into (8), we get

$$
a_{0}=0, \quad a_{1}=\frac{3}{5}, \quad a_{2}=0, \quad a_{3}=\frac{2}{5}, \quad a_{4}=0, \quad a_{5}=0, \ldots
$$

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

$$
x^{3}=\frac{3}{5} P_{1}(x)+\frac{2}{5} P_{3}(x)
$$

We perform a check using the fact that by formula (6) $P_{1}(x)=x$ and $P_{3}(x)=5 x^{3} / 2-3 x / 2$.

$$
\text { Answer. } \quad x^{3}=\frac{3}{5} P_{1}(x)+\frac{2}{5} P_{3}(x), x \in(-1,1)
$$