1. Let $x, y$ and $a$ be real numbers such that $x+y=a-1$ and $x y=a^{2}-7 a+12$. For which $a$ does the expression $x^{2}+y^{2}$ attain its maximum possible value? What are $x$ and $y$ then?
The solution.

The expression $x^{2}+y^{2}$ is expressed using $a$:

$$
\begin{aligned}
x^{2}+y^{2} & =(x+y)^{2}-2 x y \\
& =(a-1)^{2}-2\left(a^{2}-7 a+12\right) \\
& =-a^{2}+12 a-23
\end{aligned}
$$

The quadratic expression $-a^{2}+12 a-23$ attains its maximum value for

$a=\frac{-12}{2 \cdot(-1)}=6$. Then, $x^{2}+y^{2}=-36+72-23=13$.

Now, let's determine the numbers $x$ and $y$. From the conditions, we get: $x+y=5$ and $x y=6$. The desired numbers are the solutions to the quadratic equation $t^{2}-5 t+6=0$, from which it follows that $x=2$ and $y=3$ or $x=3$ and $y=2$.

(5 points)

Note. The sum whose maximum needs to be determined can also be determined in this way.

From $y=(a-1)-x$ it follows that

$$
\begin{aligned}
x((a-1)-x) & =a^{2}-7 a+12, \quad \text{i.e.} \\
x^{2}-(a-1) x+a^{2}-7 a+12 & =0
\end{aligned}
$$

The solutions to this quadratic equation are expressions for $x$ and $y$, i.e.,

$$
x=\frac{a-1 \pm \sqrt{-3 a^{2}+26-47}}{2}, \quad y=\frac{a-1 \mp \cdot \sqrt{-3 a^{2}+26-47}}{2}
$$

Now, we get $x^{2}+y^{2}=-a^{2}+12 a-23$.