2. For which values of the parameter $a$ is the difference of the roots of the equation

$$
2 x^{2}-(a+1) x+(a-1)=0
$$

equal to their product?
Solution. Let $x_{1}$ and $x_{2}$ be the roots of the given equation. According to Vieta's formulas, we have

$$
x_{1}+x_{2}=\frac{a+1}{2}, x_{1} x_{2}=\frac{a-1}{2}
$$

By the condition of the problem, we have $x_{1}-x_{2}=x_{1} x_{2}$, so, solving the system

$$
\left\{\begin{array}{l}
x_{1}+x_{2}=\frac{a+1}{2} \\
x_{1}-x_{2}=\frac{a-1}{2}
\end{array}\right.
$$

we get $x_{1}=\frac{a}{2}, x_{2}=\frac{1}{2}$. If we substitute one of these roots into the equation, we get $a=2$.