Upper bound for $2(x+y+z)-3(xy+yz+zx)+4xyz$ Let $x,y,z\geq 0$ and $x+y+z\leq\frac12$. What is the maximum of $$S=2(x+y+z)-3(xy+yz+zx)+4xyz?$$
When $x=y=z\leq\frac{1}{6}$, we have $S=6x-9x^2+4x^3$, which is an increasing function in $[0,\frac16]$, so the maximum is attained when $x=y=z=\frac16$, which is $83/108$.
When $x=\frac12, y=z=0$, we have $S=1$. Is this the maximum?
It is not clear if we can assume without loss of generality that $x+y+z=\frac12$, since the effect of increasing one variable on $S$ is unclear.
 A: Consider the following sets: 
$A$ be all triples $(x,y,z)$ where $x,y,z\neq 0$. 
$B_z$ be all triples that $x,y\neq 0$ and $z=0$.
$B_x$ be all triples that $y,z\neq 0$ and $x=0$.
$B_y$ be all triples that $x,z\neq 0$ and $y=0$.
$C_z$ be all triples that $x,y = 0$ and $z\neq 0$.
$C_x$ be all triples that $y,z = 0$ and $x\neq0$.
$C_y$ be all triples that $x,z = 0$ and $y\neq0$.
It is obvious that $A\cup (\cup B) \cup (\cup C)$ are all possible triples of $(x,y,z)$
Let $f(x,y,z)=2(x+y+z)-3(xy+yz+zx)+4xyz$
We can show that for all triples $x, y, z>0$
$f(x+z,y,0)-f(x,y,z)=2(x+y+z)-3(xy+zy)-2(x+y+z)+3(xy+yz+zx)-4xyz$
$=3zx-4xyz=zx(3-4y)>0$
Hence for any $x,y,z\neq 0$ we can find a triple namely $x+z,y,0$ that will result in a larger $S$.
Hence the triple that maximize $S$ cannot be in set $A$.
Now let $g(x,y)=2(x+y)-3xy$.
We can show that for all tuples $x,y>0$
$g(x+y,0)-g(x,y)=2(x+y)-2(x+y)+3xy>0$
Hence any tuple $x,y\neq0$ has a corresponding $x+y,0$ that will result in a larger $S$.
Hence the triple that maximizes $S$ cannot be in set $B_z$. Similarly we can show it cannot be in set $B_x,B_y$ as well.
So it must be in set $C_x$ or $C_y$ or $C_z$.
WLOG assume it is in $C_z$ then $x=y=0$ and $S=2z\leq 1$.
To show this is indeed the maximum, assume there exist another triple $(x,y,z)$ that result in a larger $S>1$. By applying our process, we can find an even larger triple $(0,0,x+y+z)$ in set $C_z$ and this would mean $2(x+y+z)>1$ contradiction.
A: For $y=z=0$ and $x=\frac{1}{2}$ we get a value $1$.
We'll prove that it's a maximal value.
Indeed, let $x=\frac{a}{6}$, $y=\frac{b}{6}$ and $z=\frac{kc}{6}$, where $k>0$ and $a+b+c=3$.
Hence, the condition gives $$\frac{a}{6}+\frac{c}{6}+\frac{kc}{6}\leq\frac{1}{2}$$ or
$$3-c+kc\leq3,$$
which gives $k\leq1$ and we need to prove that
$$\frac{a+b+kc}{3}-\frac{ab+kac+kbc}{12}+\frac{kabc}{54}\leq1$$ or
$$36(a+b+kc)-9(ab+kac+kbc)+2kabc\leq108$$ or
$$k(36c-9ac-9bc+2abc)+36(a+b)-9ab\leq108.$$
But $36c-9ac-9bc+2abc=12c(a+b+c)-9ac-9bc+2abc\geq0$ 
and since $k\leq1$, it's enough to prove that
$$36(a+b+c)-9(ab+ac+bc)+2abc\leq108$$ or
$$4(a+b+c)^3-3(ab+ac+bc)(a+b+c)+2abc\leq4(a+b+c)^3,$$
which is obviously true.
Done!
