[Math] Absolute value problem $|x-y|=|y-x|$

absolute valueinequality

My question is from Apostol's Vol. 1 One-variable calculus with introduction to linear algebra textbook.

Page 43. Problem 1 Prove each of the following properties of absolute values.

(c) $|x-y|=|y-x|$.

The attempt at a solution: I solved similar problem, which was this: $|x|-|y|\le|x-y|$, by manipulating triangle inequality, I guess this one might be similar but I don't see it. Please help.

So far I have proven following properties:

$|x|=0$ if and only if $x=0$.

$|-x|=|x|$.

Also, absolute value is defined in such way: If $x$ is a real number, the absolute value of $x$ is a nonnegative real number denoted by $|x|$ and defined as follows: $|x|=\begin{cases}
x, & \text{if $x\ge0$,} \\
-x, & \text{if $x\le0$.}
\end{cases}$.

Best Answer

$$|x-y|=|x-y|$$ $$|x-y|=|1|\cdot|x-y|$$ $$|x-y|=|-1|\cdot|x-y|$$ $$|x-y|=|-1\cdot(x-y)|$$ $$|x-y|=|y-x|$$


Without $|x||y|=|xy|$

If $x>y$
Since $y-x<0$ that means $|y-x|=-(y-x)=x-y$ $$|y-x|=x-y$$ Since $x-y>0$ that means $|x-y|=x-y$ $$|x-y|=x-y$$ Equality is transitive $$|x-y|=|y-x|$$

If $y>x$
Since $x-y<0$ that means $|x-y|=-(x-y)=y-x$ $$|x-y|=y-x$$ Since $y-x>0$ that means $|y-x|=y-x$ $$|y-x|=y-x$$ Equality is transitive $$|x-y|=|y-x|$$

The case of $x=y$ is left as an exercise for the reader.