Given $x+y+z=3$, how do I maximize $xy+yz+zx-xyz$? Given non-negative numbers $x,y,z$ such that $x+y+z=3$. How do I maximize $xy+yz+zx-xyz$. I found out that the maximum is 2 and equality holds when one of the numbers is 1 and the other two sum up to 2 but had no idea how to prove it. Can someone help please?
 A: Since the expression is symmetric, we can assume $z \leq 1$. Note that $xy+yz+zx-xyz=xy(1-z) + z(x+y) = xy(1-z)+z(3-z)$. It means that for given fixed $z \leq 1$, the maximum is reached when $xy$ is maximized (as $1-z\geq0$), and since $x+y=3-z$ is fixed, it happens when $x=y=\frac{3-z}{2}$. Therefore the expression now becomes a polynomial in $z$: $$P(z)=(\frac{3-z}{2})^2(1-z)+z(3-z)=(3-z)(\frac{(3-z)(1-z)}{4}+z)=(3-z)(\frac{z^2}{4}+\frac{3}{4})=\frac{-z^3+3z^2-3z+9}{4}$$ And we want to find it's maximum where $z \in [0,1]$. However it is easy to see that $P$ is positive and decreasing on $[0,1]$, therefore the maximum is when $z=0$ and $P(0)=\frac{9}{4}$ is the maximum. From the proof it follows that the maximum is reached when two of $x,y,z$ are equal to $\frac{3}{2}$ and the other is $0$.
A: Suppoose $x  = \max \{x,y,z\},$ then $x \geqslant 1,$ therefore
$$xy+yz+zx-xyz \leqslant xy+yz+zx-xyz + yz(x-1) = x(y+z).$$
By the AM-GM inequality, we have
$$x(y+z)  \leqslant \left(\frac{x+y+z}{2}\right)^2 = \frac94.$$
Equality hold for $x=y=\frac{3}{2},\,z=0.$
A: We can equivalently want to maximize:
$$
\begin{aligned}
(1-x)(1-y)(1-z)
&=1-\underbrace{(x+y+z)}_{=3}+(xy+yz+zx)-xyz\\
&=-2 + (xy+yz+zx)-xyz\\[3mm]
&\qquad\text{ so let us substitute }\\
X&=1-x\ ,\\
Y&=1-y\ , \\
Z&=1-z\ .\qquad\text{ These variables satisfy:}\\
X+Y+Z &= 3-(x+y+z)=0\ ,\text{ and}\\
(*)\qquad 1&\ge X,Y,Z\ .
\end{aligned}
$$
The maximum of $XYZ$ is of course positive, obtained when we arrange for two of the variables to be negative, and one positive. We will assume (w.l.o.g) for this $X,Y\le 0$, so $Z\ge 0$.
The positive variable $Z$ is then the only one suffering from the restriction $(*)$, and we have only the condition $Z\le 1$. If $Z< 1$, we can change multiplicatively $X,Y,Z$ by multiplying them each by $1/Z$, the sum remains zero, the product gets bigger by the factor $(1/Z)^3>1$. So we may and do assume $Z=1$ while maximizing. This implies $X+Y=-1$, and of course the product $XY$ is maximal for $X=Y=-\frac12$.
We come back to the $(x,y,z)$ world and obtain a maximal value for $x=y=1-\left(-\frac 12 \right)=\frac 32$ and $z=1-1=0$. Since $z=0$, the only term surviving is $xy$, the maximal value is thus $\left(\frac 32\right)^2=\frac 94>2$.
