Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I am being told that $a + b + |a - b|$ is equal to $2\max(a,b)$.

What is the reasoning behind this?

share|cite|improve this question

marked as duplicate by Milo Brandt, Mark S., Live Forever, RecklessReckoner, Martin Sleziak Jan 30 at 23:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Consider the two cases $a>b$ and $a\leq b$, and see what happens. – Augustin Jan 30 at 12:24
Duplicate. – Workaholic Jan 30 at 18:59

Adding $|a-b|$ to the smaller of the numbers makes it equal to the larger; then adding the original larger number yields twice that.

share|cite|improve this answer

By considering cases $a>b$ and $a\le b$, it's easy to see that $$ |a-b| = \max(a,b) - \min(a,b), \tag{$note\colon |a-b| = |b-a|$} $$ and $$ a+b = \max(a,b) + \min(a,b). $$ Now add them.

share|cite|improve this answer

Intuitively, notice that $\frac{a + b}{2}$ is the midway point between $a$ and $b$, and $\frac{|a - b|}{2}$ is half the distance between the two numbers, so $$\frac{a + b}{2} + \frac{|a - b|}{2}$$ is the mid way point between the two points plus half of the distance between them, which brings you to the larger of the two numbers, thus $$\frac{a+b + |a-b|}{2} = \max(a,b).$$

share|cite|improve this answer

$$a+b+|a-b|=\begin{cases}a+b+a-b =2a & \text{when} \:a\ge b\\ a+b+b-a = 2b & \text{when} \:b>a\end{cases}$$

Hence we can say that $$a+b+|a-b|=2 \max(a,b)$$

share|cite|improve this answer
@BrianO Corrected. Thanks for helping. – SchrodingersCat Jan 30 at 12:45

The set $\{a,b\}$ will have maximum either $a$ or $b$. You can argue the equality you want to show by first assuming $b$ is the maximum (then do the same argument if $a$ is the maximum). So suppose $a < b$ (this same argument would work in reverse if $b < a$).

$|a - b|$ is the distance between $a$ and $b$, i.e., how many units you have to walk from the smaller, $a$, to get to the larger, $b$.

Now, if you take $a$ and add $|a - b|$, i.e., you add the number of units you need to get from $a$ to $b$, where do you end up? Well, at $b$ of course! So $a + |a - b| = b$, where $b$ is the maximum of $\{a,b\}$.

Ok, so $$\begin{split} a + b + |a - b| &= (a + |a - b|) + b \\ &= b + b \\ &= \max\{a, b\} + \max\{a, b\} \end{split}$$

share|cite|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.