<s>[INST] Find the maximum of a sum Given $x + y + z = 0, x + 1 > 0, y + 1 > 0, z + 4 > 0$, find the maximum of $$Q=\frac{x}{x+1} + \frac{y}{y+1} + \frac{z}{z+4}$$
The answer is $\frac{1}{3}$
I've tried inverting each of the fractions then using AM-GM on them, but it doesn't give me the correct answer
 [/INST] By C-S
$$\frac{x}{x+1}+\frac{y}{y+1}+\frac{z}{z+4}=3+\frac{x}{x+1}-1+\frac{y}{y+1}-1+\frac{z}{z+4}-1=$$
$$=3-\left(\frac{1}{x+1}+\frac{1}{y+1}+\frac{4}{z+4}\right)=$$
$$=3-\frac{1}{6}(x+1+y+1+z+4)\left(\frac{1}{x+1}+\frac{1}{y+1}+\frac{4}{z+4}\right)\leq$$
$$\leq3-\frac{1}{6}(1+1+2)^2=\frac{1}{3}.$$
The equality occurs for $$(x+1,y+1,z+4)||(1,1,2)$$ or for
$$(x,y,z)=\left(\frac{1}{2},\frac{1}{2},-1\right),$$ which says that we got a maximal value.
</s>