3. The sequence of polynomials is defined by the conditions:

$$
P_{0}(x)=1, P_{1}(x)=x, P_{n+1}(x)=x P_{n}(x)-P_{n-1}(x), n=1,2, \ldots
$$

How many distinct real roots does the polynomial $P_{2018}(x)$ have?
3. The sequence of polynomials is defined by the conditions:

$$
P_{0}(x)=1, P_{1}(x)=x, P_{n+1}(x)=x P_{n}(x)-P_{n-1}(x), n=1,2, \ldots
$$

How many distinct real roots does the polynomial $P_{2018}(x)$ have?

$\square$ We will prove by induction that the polynomial $P_{n}(x)=x^{n}+\ldots$ has exactly $n$ distinct real roots, and that between any two consecutive roots of $P_{n}(x)$ there is exactly one root of the polynomial $P_{n-1}(x)$. Indeed, $P_{2}(x)=x^{2}-1, P_{3}(x)=x\left(x^{2}-2\right)$, and this statement is true for $n=3$. Suppose $x_{1}<x_{2}<\ldots<x_{n}$ are the roots of $P_{n}(x)$, and $y_{1}<y_{2}<\ldots<y_{n-1}$ are the roots of $P_{n-1}(x)$. By the induction hypothesis, $x_{1}<y_{1}<x_{2}<y_{2}<\ldots<x_{n-1}<y_{n-1}<x_{n}$. Consider the interval $\left(x_{i}, x_{i+1}\right)$. On this interval, $P_{n}(x)$ changes sign, and $P_{n-1}(x)$ does not change sign. Therefore, $P_{n+1}(x)=x P_{n}(x)-P_{n-1}(x)$ changes sign on this interval, and hence has a root. Since $P_{n}(x)$ changes sign between $x_{n}$ and $a$ if $a$ is sufficiently large, there is a root of $P_{n+1}(x)$ on the interval $\left(x_{n}, a\right)$. Similarly, the interval $\left(-\infty, x_{1}\right)$ is considered. Thus, the polynomial $P_{n+1}(x)$ has exactly $n+1$ roots.