# Spivak Calculus chapter 1 problem 13 proof critique

Question paraphrased: Prove that the maximum between two numbers $$x$$ and $$y$$ is given by:
$$\max(x,y)=\frac{x+y+|y-x|}{2}$$ Proof: Let $$x$$ and $$y$$ be two arbitrary numbers. Then, one and only one holds true: $$x \ge y$$ or $$x \le y$$
If $$x \ge y$$, $$x=x+(y-y)=(x-y)+y=|x-y|+y$$
Also, $$x=\frac {x+x}{2}=\frac{|x-y|+y+x}{2}=\frac{|x-y|+x+y}{2}$$

If $$y \ge x$$, $$y=y+(x-x)=(y-x)+y=|y-x|+y$$
Also, $$y=\frac {y+y}{2}=\frac{|y-x|+x+y}{2}=\frac{|x-y|+x+y}{2}$$
Thus, $$\max(x,y)=\frac{x+y+|y-x|}{2}$$
How can I improve this proof? I am not very convinced with $$y=\frac {y+y}{2}$$ and $$x=\frac {x+x}{2}$$ technique because it feels as if I have done this to satisfy the answer.

• This is correct and it is usually the case that we do things to satisfy the answer, and many discoveries were done that way. Nothing to be ashamed of. – Bcpicao Jun 3 at 9:12
• It's fine that you were detailed, but one way to shorten the proof is to just note that the equation is symmetric in $x$ and $y$, so proving just one case (say, $x \geq y$) is sufficient. Another remark: to be nit-picky, it is not true that "one and only one holds", since we could have $x = y$. Anyways, in this case, you didn't need to use the fact that one and only one holds, but only that one or the other (or both) holds. In general, so long as you cover all cases, it's ok if they overlap. – twosigma Jun 3 at 9:16
• @twosigma, you mentioned that I could invoke the fact that the equation in symmetrical in $x$ and $y$. But how would I know it beforehand without deriving the second case? Isn't it possible that the second identity that I derive is a different one from first one?? – Richard Jun 3 at 15:37
• I mean, you see that you can exchange $x$ and $y$. One way to look at it is: The function $\text{max}(x,y)$ outputs $x$ if $x\geq y$ and outputs $y$ if $y \geq x$, so max($x,y$) = max($y,x$). Now if $x\geq y$ (i.e. the 1st coordinate is $\geq$ the 2nd coordinate), we've shown that max($x,y$) = $x$ = RHS ("RHS" means the right hand side of the formula). If $y \geq x$, then max($x,y$) = max($y,x$) = $\frac{y+x+|x-y|}{2}$ = RHS, where the 2nd equality holds because the argument just involves switching the roles of $x$ and $y$, and the 3rd equality holds since the RHS is symmetric in $x$ and $y$. – twosigma Jun 3 at 20:59
• But you raise a good point. In general, it may not be obvious why a symmetry argument really holds. In which case it is probably better to just check. – twosigma Jun 3 at 21:00

Geometrically, suppose that $$p$$ and $$q$$ lie on real $$x$$ axis then,
max$$(p, q)$$= middle point + half the distance between $$(p, 0)$$ and $$(q, 0)$$
$$= \frac{p+q} {2} + \frac{|p-q|} {2}$$

A quicker way to the proof would be to show LHS=RHS. If $$x\geq y,$$ then LHS$$=x$$ and $$|y-x|=-(y-x)=x-y$$ which gives $$\text{RHS }=\frac{x+y+(x-y)}{2}=\frac{x+x}{2}=x.$$

The case $$y> x$$ is similar.

Rephrasing:

1) Let $$y\ge x$$:

Then $$\max(x,y)=y$$ and

$$\dfrac{y+x+|y-x|}{2}=2y/2=y$$, since $$|y-x|=y-x$$.

2) Let $$y :

Then $$\max(x,y)=x$$ and

$$\dfrac{y+x+|y-x|}{2}=x$$ since $$|y-x|=x-y$$.