<s>[INST] Proof for inequality with $a,b,c,d$ with $d =\max(a,b,c,d)$ 
Let $a,b,c,d$ positive real numbers with $d= \max(a,b,c,d)$. Proof
  that 
$$a(d-c)+b(d-a)+c(d-b)\leq d^2$$



*

*I believe that the GM-AM inequality with $n=4$ variables  might be helpful. 


$$\sqrt[n]{x_1 x_2 \dots x_n} \le \frac{x_1+ \dots + x_n}{n}$$
We also know that the Geometric mean is bounded as follows :
$$ \min \{x_1, x_2, \dots x_n\} \le \frac{x_1+ \dots + x_n}{n}
\le \max \{x_1, x_2, \dots x_n\}$$
** I also tried to draw an square and some rectangles, but nothing worked out.
 [/INST] Divide both sides by $d^2$ to get an equivalent inequality:
$\dfrac{a}{d}\cdot \left(1 - \dfrac{c}{d}\right) + \dfrac{b}{d}\cdot \left(1 - \dfrac{a}{d}\right) + \dfrac{c}{d}\cdot \left(1 - \dfrac{b}{d}\right) \leq 1$.
Now let $x = \dfrac{a}{d}$, $y = \dfrac{b}{d}$, and $z = \dfrac{c}{d}$, then : $0 \leq x, y, z \leq1$, and we are to prove:
$x(1 - z) + y(1 - x) + z(1 - y) \leq 1$.
Consider $f(x,y,z) = x(1 - z) + y(1 - x) + z(1 - y) - 1 = x + y + z - xy - yz - zx - 1$. We find the critical points of $f$. So take partial derivatives: 
$f_x = 1 - y - z = 0 \iff y + z = 1$
$f_y = 1 - x - z = 0 \iff x + z = 1$
$f_z = 1 - x - y = 0 \iff x + y = 1$.
Thus $\nabla{f} = 0 \iff x + y = y + z = z + x = 1 \iff x = y = z = \dfrac{1}{2}$. Thus the maximum of $f$ occurs at either the critical values or the boundary points which are: $(x,y,z) = (0,0,0), (0,1,1), ..., (1,1,1)$. Of these values, the max is $0$. So $f(x,y,z) \leq 0$ which is what we are to prove.
</s>