4. Find all pairs of real numbers $a, b$ for which the equation

$$
\frac{a x^{2}-24 x+b}{x^{2}-1}=x
$$

has exactly two solutions in the set of real numbers, and the sum of these solutions is 12. (P. Černek)
Solution. After multiplying both sides of the equation by the expression $x^{2}-1$ (which is equal to zero precisely when $x \in\{-1,1\}$) and moving all terms to one side, we obtain the cubic equation

$$
x^{3}-a x^{2}+23 x-b=0 .
$$

As we well know, every cubic equation with real coefficients has either one or three real roots (counting multiplicities) in the set of real numbers. Since both solutions of the original equation are roots of equation (1), this equation must have three real roots. For these numbers $x_{1}, x_{2}, x_{3}$ and the coefficients of equation (1), the well-known Viète's formulas hold

$$
\begin{aligned}
x_{1}+x_{2}+x_{3} & =a, \\
x_{1} x_{2}+x_{1} x_{3}+x_{2} x_{3} & =23, \\
x_{1} x_{2} x_{3} & =b .
\end{aligned}
$$

To avoid some trials, let us recall the known fact that every solution of the system of equations (2) is a triplet of roots of equation (1), and all solutions of (2) are permutations of the same triplet of numbers.

The assumption of two solutions of the original equation means that either exactly one of the roots $x_{1}, x_{2}, x_{3}$ belongs to the set $\{-1,1\}$ and the other two roots are different, or one of the roots $x_{1}, x_{2}, x_{3}$ is a double root and none of them belong to the set $\{-1,1\}$. The solutions of the original equation can therefore be denoted as $s$ and $12-s$ such that one of the following cases occurs: $\left(x_{1}, x_{2}, x_{3}\right)=(-1, s, 12-s),\left(x_{1}, x_{2}, x_{3}\right)=(1, s, 12-s)$, or $\left(x_{1}, x_{2}, x_{3}\right)=(s, s, 12-s)$; in each case, $s \notin\{-1,1,6,11,13\}$. We will now evaluate the listed possibilities.

(i) $\left(x_{1}, x_{2}, x_{3}\right)=(-1, s, 12-s)$. The system (2) has, after substitution and simplification, the form

$$
a=11, \quad s^{2}-12 s-35=0, \quad b=-s(12-s) .
$$

The second equation has two roots $s=5$ and $s=7$, to which the third equation corresponds the same value $b=-35$. The pair $(a, b)=(11,-35)$ is a solution to the problem.

(ii) $\left(x_{1}, x_{2}, x_{3}\right)=(1, s, 12-s)$. The system (2) has, after substitution and simplification, the form

$$
a=13, \quad s^{2}-12 s+11=0, \quad b=s(12-s) .
$$

(see above).

(iii) $\left(x_{1}, x_{2}, x_{3}\right)=(s, s, 12-s)$. The system (2) has, after substitution and simplification, the form

$$
a=s+12, \quad s^{2}-24 s+23=0, \quad b=s^{2}(12-s) .
$$

The second equation has roots $s=1$ and $s=23$. The value $s=1$ is inadmissible, the value $s=23$ corresponds, according to the first and third equations, to the values $a=35$ and $b=-11 \cdot 23^{2}=-5819$. The pair $(a, b)=(35,-5819)$ is a solution to the problem.

The sought pairs $(a, b)$ are the pairs $(11,-35)$ and $(35,-5819)$.