Find the maximum value of $xy+yz+xz-2xyz$ 
If $x+y+z=1$ and $0\le x,y,z\le1$ then find the maximum value of expression $$xy+yz+xz-2xyz$$

Solution that I have
$$(1-2x)(1-2y)(1-2z)=1-2\sum x+4\sum xy-8xyz=4\sum xy-8xyz-1$$
$\implies$
$$\sum xy-2xyz=\frac{1+(1-2x)(1-2y)(1-2z)}{4}$$
Now
$$\frac{\sum(1-2x)}{3}\ge\{(1-2x)(1-2y)(1-2z)\}^{\frac13}$$
$$\implies (1-2x)(1-2y)(1-2z)\le\frac{1}{27}$$
$$\implies xy+yz+xz-2xyz\le\frac{1+\frac{1}{27}}{4}=\frac{7}{27}$$
My own solution
Consider $f(x,y,z)=xy+yz+zx-2xyz$
Since $f(x,y,z)$ is symmetric, it will achieve it's maximum value when $x=y=z=\frac13$ thereby giving $\frac{7}{27}$ as the answer.
What I want to know, is whether there is any other practical method to solve this question as considering $(1-2x)(1-2y)(1-2z)$ seems somewhat impractical and unimpressive to me. Like how will one think of such expression.
Any help is greatly appreciated.
 A: Here is a way to use symmetry.
Using symmetry, WLOG let  $x > \max(y,z)$.  Consider replacing both $x$ and $y$ with $s = \frac{x+y}2$ in $f(x) = xy(1-2z)+(x+y)z$. The constraint is unchanged, and the value of $xy$ increases (why?). This means $f(x)$ increases, as $1-2z$ is positive in this case (why).
Hence at any maximum for this problem, we cannot have any one variable larger than the others, or the maximum can only be when $x=y=z$.  As the function $f$ is continuous and the domain is compact, we must have a maximum, viz. $f_{\max} = \frac7{27}$ when $x=y=z=\frac13$.
A: By continuity, $f$ has indeed a maximum on this compact triangle $\overline T.$ By Lagrange, if it is attained at some interior point $(x,y,z)\in T$ (the open triangle), then the three partial derivatives of $f$ must coincide at this point, i.e.
$$y+z-2yz=x+z-2xz=y+x-2xy.$$
One quickly finds that the only solution $(x,y,z)\in T$ (i.e. $x+y+z=1$ and $x,y,z>0$) is $x=y=z=\frac13$, and the value of $f$ at this point is $\frac7{27}.$
There remains to check that the values on $\partial T$ are less: e.g. if $0\le y\le1,$
$$f(0,y,1-y)=y-y^2\le\frac14<\frac7{27}.$$
A: The reasons for posting this answer are:

*

*The answers posted are difficult to follow. Maybe not by everyone, but at least by myself. They don’t inspire in the sense that do not follow a natural, progressive, intuitive approach. Somewhere there lies a catch and it feels reading this answers that I am not ready. I can live with that, I just can’t do well not knowing where the disconnect is.

*The answers (most or all?) employ the concept of averages which I find as elusive as were the irrationals on the times of the Greeks. Or matrices in our time. We could all agree that $p\rightarrow q$ while the axiomatic foundation remains elusive, incomplete.

*If we ended up using averages to solve an inequality then we might as well use calculus and scalar fields, because learning those concepts is still less difficult than understanding averages.

*Look at the answer proposed by the OP: is magic. You don’t know the trick, don’t bet your life then.

*Look at the agreed answer: another magic of distraction from mathematical analysis. “This increases (but why?) so that stays positive (is it?)” is the sort of phrasing that makes sense in a church of some sorts.

*Then look at my answer: breaking the boundaries of what is accepted, using forbidden mathematical tools for the sake of getting an intuitive and straightforward response.

*Truth is not a commodity. Never was in the past when Greeks learned from Egyptians who learned from Assyrians and all reached India then back to Algebra and Bonacci’s son. Let’s not rely on magic tricks without even trying to show the straight path to answer.

Let $F(x,y,z)=xy+yz+zx-2xyz$ be a scalar function defined on the bounded plane $x+y+z=1, 0\le x,y,z\le1$
The vector normal (perpendicular) to the plane is $\vec n=(1,1,1)$.
The function F has a local maximum or minimum in any point where the gradient is perpendicular to $x+y+z=1$.
The previous condition is equivalent to solving $\nabla F\times \vec n=\vec0$, leading to 3 symmetrical sets of solutions of the kind: $z=\frac{1}{2}\lor x=y$.
For $z=\frac{1}{2}\Rightarrow F(x,y,z)=\frac{1}{4}$
For $x=y\Rightarrow F(x,y,z)=x^2+2xz-2x^2z=x^2+2x(1-2x)-2x^2(1-2x), z=1-x-y=1-2x$
Therefore we need to find the local extremes for a cubic polynomial function,
$$f(x)=4x^3-5x^2+2x$$
$$f\prime(x)=0\Rightarrow 6x^2-5x+1=0, x=\frac{5\pm 1}{12}$$
Out of the two values retain $x=\frac{1}{3}$ rendering the maximum value $F(\frac{1}{3},\frac{1}{3}, \frac{1}{3})=\frac{7}{27}$.
A: Another way for proving that $f(x,y,z)=xy+yz+zx-2xyz\leq \frac{7}{27}$ if $x,y,z\in(0,1)$ and $x+y+z=1.$ We denote $x=X+1/3,y=Y+1/3, z=Z+1/3$ with $X,Y,Z\in [-1/3.2/3]$ and $X+Y+Z=0.$ We denote
$$A=-2(XY+YZ+ZX)=X^2+Y^2+Z^2$$ leading to
$$f(x,y,z)=\frac{7}{27}-\frac{1}{6}(A+12XYZ).$$ If 2 of the three numbers $X, Y,Z$ are negative we have $A+12XYZ\geq 0.$ If not, without loss of generality we assume $Y$ and $Z$ non negative. As a consequence $0\leq Y+Z=-X\stackrel{(*)}
{\leq} 1/3$ and we get
$$A+12XYZ=(Y+Z)^2+Y^2+Z^2-12 (Y+Z)YZ\stackrel{(*)}
{\geq }2(Y^2+Z^2+YZ) -4YZ=2((Y-Z)^2+YZ)\geq 0.$$
