Show $\max{\{a,b\}}=\frac1{2}(a+b+|a-b|)$

Here is another approach:

$\max(x,y)+\min(x,y) = x+y$, and $\max(x,y)-\min(x,y) = |x-y|$.

Adding/subtracting gives $\max(x,y) = {1 \over 2}(x+y+|x-y|)$, $\min(x,y) = {1 \over 2}(x+y-|x-y|)$


There are $3$ separate cases you must cover.

  1. $a \lt b$

  2. $a = b$ and

  3. $a \gt b$

You've covered (1). But this is just one possibility. You must also show that the equality holds for $a = b$. Again, would not be too difficult. And you can argue that case (3) can be shown pretty much the same way as the first one.

The fallacy in the logic is this: "Not all real numbers are such that $a \lt b$ and you are required to prove the identity for every real number"


The "without loss of generality $a<b$" assumes we know that $|a-b|=|b-a|$. I would usually skip that, but not if the topic of discussion is the $|\cdot|$ absolute value function itself.

You also need to cover the case $a=b$.