ALGEBRAIC DEFINITION OF ABSOLUTE VALUE

Sometimes we don't care if a number is positive (i.e., lies to the right of zero) or negative (i.e., lies to the left of zero),
we just want to know its size—its distance from zero.

In these situations, the concept of absolute value comes to the rescue.
The notation $\,|x|\,$ denotes the absolute value of $\,x\,$.

The number $\,|x|\,$ gives the distance between $\,x\,$ and $\,0\,$.
This definition of absolute value as distance from zero is often the easiest one to use.

Whenever you see those two vertical bars that denote absolute value,
I like to have my students do two ‘karate chops’ on them, saying: $$\overset{\text{karate chop #1:}}{\overset{\text{DISTANCE}}{\overbrace{\ \ \ \ |\ \ \ \ }}} \overset{\text{from}}{\ \ \ \ \ \strut\ \ \ \ \ } \overset{\text{karate chop #2:}}{\overset{\text{ZERO}}{\overbrace{\ \ \ \ |\ \ \ \ }}}$$

However, there is also an algebraic definition of absolute value.
In particular, the algebraic definition is needed in the derivation of the quadratic formula.

PIECEWISE-DEFINED FUNCTIONS

The algebraic definition of absolute value uses a piecewise-defined function.
A piecewise-defined function is used whenever different output formulas are needed for different inputs;
that is, more than one piece is needed to give a full description of what the function does!

Whenever you need one rule for one set of inputs, and another rule for a different set of inputs,
then a piecewise-defined function comes to the rescue.

As you'll observe in the definition below, the following notation is used for piecewise-defined functions:

• a single large left brace is used to gather together the different rules;
there is no closing right brace
• to the right of this brace, each rule is given its own line:
two ‘pieces’ result in two lines;
three ‘pieces’ result in three lines, and so on
• each line has this pattern:
• state the rule, followed by an optional comma;
• followed by the word ‘ if ’ or the word ‘ for ’;
• followed by the input(s) to which the rule applies;
• followed by an optional comma (for all except the last line)
I tend to prefer the simplest notation that clearly conveys meaning, so I opted for no commas in the definition below.
However, some alternate presentations are offered following the definition.

Algebraic Definition of Absolute Value
Let $\,x\,$ be a real number. $${|x|} = \begin{cases} x &\text{if }\ x\ge 0 \\ -x &\text{if }\ x\lt 0 \end{cases}$$

Here are some alternate presentations of this piecewise-defined function:

 $${|x|} = \begin{cases} x &\text{for }\ x\ge 0 \\ -x &\text{for }\ x\lt 0 \end{cases}$$ $${|x|} = \begin{cases} x\,, &\text{if }\ x\ge 0 \\ -x\,, &\text{if }\ x\lt 0 \end{cases}$$ $${|x|} = \begin{cases} x\,, &\text{if }\ x\ge 0\,, \\ -x\,, &\text{if }\ x\lt 0 \end{cases}$$ $${|x|} = \begin{cases} x\,, &\text{for }\ x\ge 0\,, \\ -x\,, &\text{for }\ x\lt 0 \end{cases}$$

COMMENTS ON THE ALGEBRAIC DEFINITION OF ABSOLUTE VALUE
• How to use the formula
Here's how you'll use the formula to find $\,|x|\,$:
Start by looking inside the absolute value, at the number $\,x\,$.
• If $\,x\,$ is greater than or equal to zero, then use the first rule, $\,|x| = x\,$.
That is, if a number is nonnegative, then its absolute value is itself.
For example, $\,|3| = 3\,$.
• If $\,x\,$ is less than zero, then use the second rule, $\,|x| = -x\,$.
That is, if a number is negative, then its absolute value is its opposite.
For example, $\,|-3| = -(-3) = 3\,$.
• The second line is most troublesome
The second line of the rule is most troublesome:
$|x| = -x\,, \text{ if }\ x \lt 0$
One thing that leads to confusion is that people often read ‘$\,-x\,$’ as ‘negative $\,x\,$’,
which makes it sound like the result is negative.
NOT SO!!
If $\,x\,$ is negative, then its opposite, $\,-x\,$, is positive!
If you find yourself getting confused, just read ‘$\,-x\,$’ as ‘the opposite of $\,x\,$’,
and this may clear up any difficulty.

The absolute value makes a useful appearance in the following formula:

For all real numbers $\,x\,$: $$\sqrt{x^2} = {|x|}$$

So, what is $\,\sqrt{x^2}\,$?
There are two numbers which, when squared, give $\,x^2\,$:   $\,x\,$ and $\,-x\,$.
Which one do we want?
Unless we happen to know the sign of $\,x\,$, then we won't know which one is nonnegative.
Absolute value comes to the rescue!
The number $\,|x|\,$ has the same size (distance from zero) as both $\,x\,$ and $\,-x\,$, and is always nonnegative.

Don't ever fall into a common trap and think that $\,\sqrt{x^2}\,$ is just $\,x\,$.
Sure, this ‘formula’ works if we know, ahead of time, that $\,x\,$ is nonnegative.
But, usually we're in situations where $\,x\,$ is allowed to be any real number.
For example, let $\,x = -5\,$.
Then, $\,x^2 = (-5)^2 = 25\,$.
Is $\,\sqrt{x^2}\,$ equal to $\,x\,$ in this case?
No! $\,\sqrt{25}\ne -5\,$
However, it is true that $\,\sqrt{x^2} = \sqrt{(-5)^2} = \overset{=\, |x|}{\overbrace{|-5|}} = 5\,$.

EXAMPLES:
Question:
Let $\,x = 3\,$.
Is $\,|x|\,$ equal to $\,x\,$ or $\,-x\,$?
Solution:
Since $\,x\,$ is positive, $\,|x| = x\,$.
Question:
Let $\,x = -3\,$.
Is $\,|x|\,$ equal to $\,x\,$ or $\,-x\,$?
Solution:
Since $\,x\,$ is negative, $\,|x| = -x\,$.
Master the ideas from this section
$\,x\,$
$\,-x\,$