# Prove that if x and y are real numbers, then max(x,y) + min(x,y) = x+y. [duplicate]

Prove that if x and y are real numbers, then max(x,y) + min(x,y) = x+y. [Hint: Use a proof by cases, with the two cases corresponding to x≥y and x<y, respectively.]

Using hint, I supposed two cases where: x≥y or x<y.

Thus, if x≥y, then max(x,y) = x or y (since x and y might be the same), min(x,y) = y. Therefore, it is equal to 2y or x+y. Since it covers all of the cases, the equality always holds.

If x<y, then max(x,y) = y, min(x,y) = x. Thus, it is equal to x+y.

But the answer is slightly different from my solution. The answer is:

If x≤y, then max(x,y) + min(x,y) = y+x = x+y. If x≥y, then max(x,y)+min(x,y) = x+y. Because there are only two cases, the equality always holds.

You can notice that the answer supposed two different cases, x≤y or x≥y.

But I supposed x≥y or x<y.

I want to know whether these two different answers are both correct or not.

On the other hand, is it correct if I make three cases, where x > y, x = y, and x < y?

When x > y, max(x,y) = x, min(x,y) = y. Thus, x + y.

When x = y, max(x,y) = x or y, min(x,y) = x or y. Thus, 2x or 2y or x + y.

When x < y, max(x,y) = y, min(x,y) = x. Thus, x + y.

Is this answer correct? It seems clearer for me.

• If $x=y$ then the max equals the min so the result is true. If $x\ne y$ then one of them is the max and the other is the min so max+min is $x+y$. Jun 5, 2023 at 13:34
• The three ways you report are equally correct. It is a matter of taste. Personally, I would write only: "wlog $x\ge y$, then $\max(x,y)+\min(x,y)=x+y$". Jun 5, 2023 at 13:35
• They are the same. Your three way approach works, but the $x=y$ case can be incorporated into both of the others: when $x \ge y, \max(x,y) = x, \min(x,y) = y$, thus $x + y$; and when $x \le y, \max(x,y) = y, \min(x,y) = x$, thus $y + x$. It does not matter that when $x=y$ you have $\max(x,y) = x =y$ as you can use whichever is more helpful Jun 5, 2023 at 13:46
If $$x=y$$, then $$max\{ x,y \} + min\{x,y\}=x+y$$ as desired.