In our lecture, we were ask to simplify the expression $x+y+|x-y|$.
This is how I simplified it:
If $x\ge y$, $|x-y|=x-y$ and $x+y+|x-y|=x+y+(x-y)=2x$.
If $x<y$, $|x-y|=y-x$ and $x+y+|x-y|=x+y+(y-x)=2y$.
Now
$x+y+|x-y|=\begin{cases}2x&\text{if}~x\geq y\\ 2y&\text{if}~x<y\end{cases}$ .
The solution was correct but our lecturer also continued this by telling that we can now also conclude from the solution that
$x+y+|x-y|=2max(x,y)$.
I'm not sure, however, how we came to this conclusion?