Modus Operandi. Formulae for Maximum and Minimum of two numbers with a + b and $|a - b|$ I came across the following problem in my self-study of real analysis:

For any real numbers $a$ and $b$, show that $$\max \{a,b \} = \frac{1}{2}(a+b+|a-b|)$$ and $$\min\{a,b \} = \frac{1}{2}(a+b-|a-b|)$$

So $a \geq b$ iff $a-b \ge0$ and $b \ge a$ iff $b-a \ge 0$. At first glance, it seems like an average of distances. For the first case, go to the point $a+b$, add $|a-b|$ and divide by $2$. Similarly with the second case. 
Would you just break it up in cases and verify the formulas? Or do you actually need to come up with the formulas? 

I know this is a little bit late, but here another way to get into that formula.
If we want to know $\min(a,b)$ we can know which is smaller by taking the sign of $b-a$. The sign is defined as $sign(x)=\frac{x}{|x|}$ and $msign(x)=\frac{sign(x)+1}{2}$ to get the values $0$ or $1$; if $msign(a-b)$ is $1$ it means that $a$ is bigger, if it is $0$, $a$ is smaller. To get the minimum value, we need to sum all values that $sign(x-y)$ is $1$ (which means that $x$ is bigger than $y$) for $y=a$ and $x=b$. So we have
$$\min(a,b)=msign(b-a)a+msign(a-b)b$$
and
$$\max(a,b)=msign(a-b)a+msign(b-a)b$$
and simplifying
$$\min(a,b)=\frac{1}{2}\left(a+b-|a-b|\right)$$
$$\max(a,b)=\frac{1}{2}\left(a+b+|a-b|\right)$$
All this come from this equations:
$$\min(a,b)= \begin{cases} 
      a & msign(a-b)==0\\
      b & msign(a-b)==1
   \end{cases}
$$
$$\max(a,b)= \begin{cases} 
      a & msign(a-b)==1\\
      b & msign(a-b)==0
   \end{cases}
$$
