TITLE: Maximum value of $p+q+r$ where $p=q(4-q), q=r(4-r), r=p(4-p)$ and $p,q,r\in R$
QUESTION [6 upvotes]: I would be grateful if somebody could please help me out.

Let $p,q,r\in R$. If $p=q(4-q), q=r(4-r), r=p(4-p)$, find the maximum value of $$p+q+r$$

My attempt:
$$p+q+r$$
$$=q(4-q)+(4-r)+(4-p)$$
$$=-(p^2+q^2+r^2-4p-4q-4r)$$
$$=-[(p-2)^2+(q-2)^2+(r-2)^2-12]$$
$$=12-[(p-2)^2+(q-2)^2+(r-2)^2]$$
$$$$
$$\Rightarrow p+q+r=12-[(p-2)^2+(q-2)^2+(r-2)^2]$$
$$$$
Thus it remains to minimize $[(p-2)^2+(q-2)^2+(r-2)^2]$
This clearly attains its minimum value at $p=2,q=2,r=2$. Hence, it seems that the minimum value of $$p+q+r=12-[0]=12$$
This does not match with the given answer. 
$$$$
Additionally, I seem to be arriving at a contradiction since if $q=2$, $p=q(4-q)=2(4-2)=4$ (which clearly doesn't match with $p=2$) and so on for $r$ and $p$.

REPLY [2 votes]: Let $f:\Bbb R\to\Bbb R$ be the function $f(x)=x(4-x)$.
Then the given conditions are now
$$
p=f(q)\ ,\ q=f(r)\ ,\ r=f(p)\ .
$$
So $p,q,r$ are solutions for the equation
$$
x = f(f(f(x)))\ ,
$$
taken compatibly.
Let us find all roots of this polynomial equation.
This is explicitly, and i wanted to do it explicitly:
sage: f(x) = x*(4-x)
sage: factor( f(f(f(x))) - x )
-(x^3 - 6*x^2 + 9*x - 3)*(x^3 - 7*x^2 + 14*x - 7)*(x - 3)*x

(Computer aided information, sage. The computations are above and below exact,
although the prints may involve some floating-points-like prints.)
For the roots $p$ of the above polynomial we have the corresponding sums:
sage: for p in ( f(f(f(x))) - x ).roots(ring=AA, multiplicities=False):
....:     print "p     = %s\np+q+r = %s\n" % ( p, p+f(p)+f(f(p)) )
....:     
p     = 0
p+q+r = 0

p     = 0.4679111137620440?
p+q+r = 6.000000000000000?

p     = 0.7530203962825330?
p+q+r = 7.000000000000000?

p     = 1.652703644666140?
p+q+r = 6

p     = 2.445041867912629?
p+q+r = 7.000000000000000?

p     = 3
p+q+r = 9

p     = 3.801937735804839?
p+q+r = 7.000000000000000?

p     = 3.879385241571817?
p+q+r = 6.000000000000000?

So the possible sums are (exactly computed) $0,6,7,9$, and the maximal sum is $9$, obtained for $p=q=r=3$.

With the above information it is maybe simpler to get a human proof.
Let $p,q,r$ be such that $S=p+q+r$ is maximal. Obviously, $S\ge 9$, since instance $p+q+r=9$ for $p+q+r=3$.
The function $f$ is concave on $\Bbb R$, (a $\cap$-parabola,) so we can apply Jensen's inequality,
$$
\begin{aligned}
S&=p+q+r
\\
&=f(p)+f(q)+f(r)
\\
&\le 3\cdot f\left(\frac {p+q+r}3\right)
\\
&=3\cdot\frac S3\left(4-\frac S3\right)
\\
&=S\left(4-\frac S3\right)\ .
\end{aligned}
$$
Since $S>0$ (at maximality) we get from $S\le S\left(4-\frac S3\right)$, 
first $1\le 4-\frac S3$, then $-3\le -\frac S3$, i.e. $9\ge S$.
This was the converse inequality.