9.2. The real numbers $x, y, z$ satisfy the relation $x+y+z=a$, where $a$ is a fixed real number. Determine the maximum possible value of the sum $S=xy+yz+zx$. For which values of $x, y, z$ is this maximum value achieved?
Solution. $x+y+z=a \Rightarrow z=a-x-y \quad \Rightarrow \quad S=x y+y(a-x-y)+x(a-x-y)=$ $=x y+a y-x y-y^{2}+a x-x^{2}-x y=-x^{2}+(a-y) x+y(a-y)$.

We consider $S$ as a quadratic function in $x$ with the leading coefficient -1, the constant term $y(a-y)$, and the coefficient of $x$ equal to $a-y$. Thus, $S(x)=-x^{2}+(a-y) x+y(a-y)$. Since $-1<0$, $S$ has a maximum at $x=\frac{-(a-y)}{-2}=\frac{a-y}{2}$. We calculate this maximum.

$$
\begin{aligned}
& S\left(\frac{a-y}{2}\right)=-\left(\frac{a-y}{2}\right)^{2}+(a-y)\left(\frac{a-y}{2}\right)+y(a-y)=-\left(\frac{a-y}{2}\right)^{2}+\frac{(a-y)^{2}}{2}+y(a-y)= \\
= & \frac{(a-y)^{2}}{4}+y(a-y)=\frac{a^{2}}{4}-\frac{2 a y}{4}+\frac{y^{2}}{4}+a y-y^{2}=-\frac{3}{4} \cdot y^{2}+\frac{a}{2} \cdot y+\frac{a^{2}}{4} .
\end{aligned}
$$

We consider this expression as a quadratic function $g(y)$ in $y$ with the leading coefficient $-\frac{3}{4}$, the constant term $\frac{a^{2}}{4}$, and the coefficient of $y$ equal to $\frac{a}{2}$. Thus, $g(y)=-\frac{3}{4} \cdot y^{2}+\frac{a}{2} \cdot y+\frac{a^{2}}{4}$. The maximum value of this function is at $y=-\frac{a}{2}: 2 \cdot\left(-\frac{3}{4}\right)=\frac{a}{3}$, and it is $g\left(\frac{a}{3}\right)=-\frac{3}{4} \cdot\left(\frac{a}{3}\right)^{2}+\frac{a}{2} \cdot \frac{a}{3}+\frac{a^{2}}{4}=\frac{a^{2}}{3}$.

Since $x=\frac{a-y}{2}=\frac{a-\frac{a}{3}}{2}=\frac{a}{3}$, then $z=a-x-y=a-\frac{a}{3}-\frac{a}{3}=\frac{a}{3}$.

Therefore, the maximum of the sum $x y+y z+z x$ is $\frac{a^{2}}{3}$ and it is achieved for $x=y=z=\frac{a}{3}$.