How find this maximum of the value $\sum_{i=1}^{6}x_{i}x_{i+1}x_{i+2}x_{i+3}$? Let 
$$x_{1},x_{2},x_{3},x_{5},x_{6}\ge 0$$ such that
$$x_{1}+x_{2}+x_{3}+x_{4}+x_{5}+x_{6}=1$$
Find the  maximum of the value of
$$\sum_{i=1}^{6}x_{i}\;x_{i+1}\;x_{i+2}\;x_{i+3}$$
where 
$$x_{7}=x_{1},\quad x_{8}=x_{2},\quad x_{9}=x_{3}\,.$$

Let $B=(x_2+x_6)/2,C=(x_3+x_5)/2,tR=(x_2-x_6)/2,tS=(x_3-x_5)/2$.
The numbers are now $A,B(1+tR),C(1+tS),D,C(1-tS),B(1-tR)$.  The sum is
$$2AB^2C+2BC^2D+2ABCD-2t^2(AB^2CR^2+BC^2DS^2-ABCDRS)$$
Let $t$ vary.  The maximum is either when $t=0$ or when $t$ is as large as possible.  
$t$ is at its largest when $B(1-tR)$ or $C(1-tS)$ has reached zero.  It is simple to calculate the sum's maximum when one value is zero; that maximum is $1/256$.  
If the maximum is when $t=0$, then the numbers are $A,B,C,D,C,B$.  That is, $x_2=x_6$ and $x_3=x_5$.
A similar argument shows that any maximum other than $1/256$ has $x_2=x_4$ and $x_1=x_5$.
So the numbers are $C,B,C,B,C,B$ and the sum is $6B^2C^2$.  That is maximum when $B=C=1/6$, and the sum is $1/216$.  
