The Absolute Value Function

· by

Contents

I was never really taught how to deal with the absolute value function, but I need it from time to time. So here are a few hints.

Solving Equations

Let's say you want to solve the equation

$$|x - a | = b$$

for \(x\). Then you need to realize that this equation is equivalent to two equations:

$$x - a = b \qquad \text{ and } \qquad -(x-a) = b$$

you can solve both of them independently. You can get 0, 1 or 2 solutions when the absolute function is involved:

$$x = a + b \qquad \text{ and } \qquad x = a - b$$

or shorter

$$x = a \pm b$$

Solving Inequalities

Let's say you want to solve the inequality

$$|a - x| \leq b$$

for \(x\). Again, this inequality is equivalent to the two inequalities

$$a - x \leq b \qquad \text{ and } \qquad -(a-x) \leq b$$

You can solve both of them independently for \(x\):

$$a - b \leq x \qquad \text{ and } \qquad x \leq a + b$$

leading to

$$a - b \leq x \leq a + b$$

Note that both inequalities have to be fulfilled at the same time! Just try it for \(a = 0\) and \(b = -5\)!

Derivatives

The function \(f(x) = |x|\) is equivalent to \(f(x) = \sqrt{x^2}\). Hence you can differentiate the absolute value by differentiating the root of the square of its argument. And the chain rule, of course:

\begin{align} f'(x) &= (\sqrt{x^2})'\\ &= \frac{1}{2 \sqrt{x^2}} \cdot (2 x)\\ &= \frac{x}{\sqrt{x^2}}\\ &= \frac{x}{|x|}\\ &= \text{sign}(x) \end{align}

Note that the derivative is not defined at 0.

See also