Proof of $ |a-b| = |b-a| $ While working out some intriguing qualities of absolute values for my studies of calculus, I frequently used the formula below. 
I know that the formula below is clearly correct but how would I prove it?
$$ |a-b| = |b-a| $$ $$ a,b \in\mathbb R $$
Believing that I require an actual proof for the formula I used so often I attempted to prove that formula "by cases". It appeared, however, that there is a more elegant proof somewhere out there.
Thanks in advance.
 A: Hint:
$$|a-b| = \begin{cases}
a-b, & a - b > 0 \\
-(a-b), & a - b \leq 0
\end{cases}$$
$$|b-a| = \begin{cases}
b-a, & b-a > 0 \\
-(b-a), & b-a \leq 0
\end{cases}$$
A: If $a=b$, this is trivial. WLOG, suppose $a<b$. Now $|a-b|=-(a-b)=b-a=|b-a|$.
A: I like to use that $|x| = \sqrt{x^{2}}$. Then 
$$|a-b|=\sqrt{(a-b)^{2}}=\sqrt{(a^2-2ab+b^2)}=\sqrt{(b-a)^{2}}=|b-a|.$$
A: You just need to have a look, how the absolute value is defined: For $x \in \Bbb R$, 
$$ \vert x \vert := \begin{cases} x \; , & \text{if $x \geq 0$} \\ -x \; , & \text{if } x < 0\end{cases} \; .$$
So let $a, b \in \Bbb R$. Let's first assume that $a > b$, then $a - b > 0$, and by the defintion of the absolute value we get 
$$ \vert a - b \vert = a - b \; . $$
Since $b - a < 0$, we get by the definition of the absolute value 
$$\vert b - a \vert = -(b-a) = a - b \; ,$$
so we conclude that 
$$\vert a-b \vert = \vert b - a\vert \; ,$$
if $a > b$. Do the same for the case $b > a$ and note, that the case $a=b$ is trivial.
A: Use the definition of absolute value. If $a-b \geq 0$, then: $$|a-b| = a-b = -(b-a) = |b-a|,$$ where the last step is given because $a-b \geq 0 \implies b-a \leq 0$ and so $-(b-a) = |b-a|$. You treat the other case similarly.
A: 
$|a - b|$


= $|-b + a|$ (commutative)


= $|-(b - a)|$ (distributive)


= $||-(b - a)||$ (identity)


= $|(b - a)|$ (absolute value)


= $|b - a|$ (associative)


Q.E.D.

A: I recently proved this statement using only a few basic properties of real numbers and the definition of absolute value. So it may be a bit easier to grasp than some of the other proofs presented here.
Proof:
Suppose a and b are real numbers.
By trichotomy law only one of the following relation holds:
a = b, a > b, or a < b.
Case 1: a = b
|a - b| = |0 - 0| = |0| = 0.
|b - a| = |0 - 0| = |0| = 0.
Because |0| = 0 by definition of absolute value.
Hence |a - b| = |b - a|
Case 2: a > b
Starting with a > b,
a - b > b - b
a - b > 0
Starting with a > b,
a - a > b - a
0 > b - a
By definition of absolute value, |a - b| = a - b because a - b > 0. And |b - a| = -(b - a) = a - b because b - a < 0.
Hence |a - b| = |b - a|
Case 3: a < b
Starting with a < b,
a - b < b - b
a - b < 0
Starting with a < b,
a - a < b - a
0 < b - a
By definition of absolute value, |a - b| = -(a - b) = b - a because a - b < 0. And |b - a| = b - a because b - a > 0.
Hence |a - b| = |b - a|
In all three cases |a - b| = |b - a|, therefore for any real numbers a and b, |a - b| = |b - a|.
Q.E.D.
References:

*

*https://mathworld.wolfram.com/TrichotomyLaw.html

*https://en.wikipedia.org/wiki/Absolute_value#Real_numbers
