<s>[INST] maximum value of $\sum ab-2abc$ If $a+b+c=1$ and $a,b,c\in(0,1)$, then what is the maximum value of $(ab+bc+ca-2abc)$?
What I've tried:
$(a+b+c)^2=a^2+b^2+c^2+2(ab+bc+ca)\geq 4(ab+bc+ca)$
$(a-b)^2=a^2+b^2-2ab\geq 0$
$a^2+b^2\geq 2ab,b^2+c^2\geq 2bc,c^2+a^2\geq 2ca$
$ab+bc+ca\leq\frac14$
How do I solve it help me please.
 [/INST] Fixing the value of $a$, we want to find the maximum of
$$
S=ab+bc+ca-2abc=(1-2a)bc+a(1-a).
$$ For $a>\frac 12$, we want to choose $b,c$ with $b+c=1-a$ that makes $bc$ as small as possible. The optimum can be achieved as one of $b$ and $c$ goes arbitrarily close to $0$, but this contradicts $b,c>0$ (But we need to check this case to make sure that $S$ indeed achieves it maximum in the interior). On the other hand, for $a\le \frac12$, we want to choose $b,c$ that makes $bc$ as large as possible. Given that $b+c=1-a$, the maximum value of $bc$ is given by AM-GM; $2\sqrt{bc}\le b+c=1-a\implies bc\le \frac{(1-a)^2}4$ with the equality attained when $b=c=\frac{1-a}2$. Inserting this, we have
$$
S=\frac{(1-2a)(1-a)^2}4+a(1-a)=\frac{(1-a)(2a^2+a+1)}{4}.
$$ By differentiating $S$ with respect to $a$, we have
$$
S'=\frac{a(1-3a)}{2}.
$$ Since $S'>0$ on $(0,\frac13)$ and $S'<0$ on $(\frac13,1)$, we know that $a=\frac 13$, $b=c=\frac{1-a}2=\frac 13$ is optimal. This gives $S\le \frac13-\frac2{27}=\frac7{27}$.
</s>