Introduction
The derivative of absolute value of x, often denoted as ( \frac{d}{dx}|x| ), is a cornerstone concept in calculus that measures how the absolute value function changes as (x) varies. The absolute value function, ( |x| ), returns the non‑negative magnitude of a real number, making its derivative particularly interesting because it behaves differently on each side of zero. Mastering this derivative is essential for solving problems in mathematics, physics, engineering, and any field that relies on rates of change of non‑negative quantities.
Definition of the Absolute Value Function
The absolute value of a real number (x) is defined piecewise:
[ |x| = \begin{cases} x, & \text{if } x \ge 0,\[4pt] -x, & \text{if } x < 0. \end{cases} ]
This definition tells us that for non‑negative inputs the function simply returns the input, while for negative inputs it returns the opposite sign, effectively reflecting the number across the horizontal axis. Because the function is not smooth at (x = 0), its derivative must be examined separately on the intervals (x > 0) and (x < 0).
Derivative of (|x|) Using the Piecewise Definition
Since (|x|) is defined piecewise, we can differentiate each branch individually.
For (x > 0)
When (x > 0), (|x| = x). The derivative is straightforward:
[ \frac{d}{dx}|x| = \frac{d}{dx}x = 1. ]
For (x < 0)
When (x < 0), (|x| = -x). Differentiating (-x) yields:
[ \frac{d}{dx}|x| = \frac{d}{dx}(-x) = -1. ]
Thus, the derivative of the absolute value function is:
[ \frac{d}{dx}|x| = \begin{cases} 1, & x > 0,\[4pt] -1, & x < 0. \end{cases} ]
At (x = 0) the derivative does not exist because the left‑hand limit ((-1)) and the right‑hand limit ((1)) are not equal. This point is a classic example of a corner or cusp in a function’s graph.
Derivative from First Principles
We can also derive the result using the limit definition of a derivative:
[ \frac{d}{dx}|x| = \lim_{h \to 0} \frac{|x+h| - |x|}{h}. ]
Consider three cases:
-
(x > 0): For sufficiently small (h), both (x) and (x+h) remain positive, so (|x+h| = x+h) and (|x| = x). The limit simplifies to (\lim_{h \to 0} \frac{x+h - x}{h} = \lim_{h \to 0} \frac{h}{h} = 1).
-
(x < 0): For small (h), both (x) and (x+h) stay negative, giving (|x+h| = -(x+h)) and (|x| = -x). The limit becomes (\lim_{h \to 0} \frac{-(x+h) + x}{h} = \lim_{h \to 0} \frac{-h}{h} = -1).
-
(x = 0): The limit from the right is (\lim_{h \to 0^+} \frac{|h| - 0}{h} = \lim_{h \to 0^+} \frac{h}{h} = 1). The limit from the left is (\lim_{h \to 0^-} \frac{|h| - 0}{h} = \lim_{h \to 0^-} \frac{-h}{h} = -1). Since the two one‑sided limits differ, the derivative at zero is undefined.
Using the Chain Rule with (|u|)
When the argument of the absolute value is a function (u(x)), the derivative follows a generalized rule:
[ \frac{d}{dx}|u| = \frac{u'}{|u|} \cdot u, ]
or more compactly:
[ \frac{d}{dx}|u| = \frac{u(x)}{|u(x)|} \cdot u'(x), ]
provided (u(x) \neq 0). But the factor (\frac{u(x)}{|u(x)|}) equals (1) when (u(x) > 0) and (-1) when (u(x) < 0). This formulation is especially useful for differentiating composite functions such as (|\sin x|) or (|x^2 - 4|).
Example: Derivative of (|\sin x|)
Let (u = \sin x). Then (u' = \cos x). Applying the rule:
[ \frac{d}{dx}|\sin x| = \frac{\sin x}{|\sin x|} \cdot \cos x. ]
For intervals where (\sin x > 0), the derivative simplifies to (\cos x); where (\sin x < 0), it becomes (-\cos x). At points where (\sin x = 0), the derivative does not exist (another corner).
Common Applications
The derivative of the absolute value function appears in many practical contexts:
- Optimization: In problems involving distances or magnitudes, the absolute value often models the objective function. Its derivative helps locate minima or maxima using gradient‑based methods.
- Signal Processing: The absolute value of a signal’s amplitude is used to compute envelope detection. The derivative of this envelope informs how quickly the signal’s strength changes.
- Physics: When dealing with speed (the absolute value of velocity), the derivative of speed with respect to time yields acceleration only when velocity does not change sign. The piecewise nature of the derivative captures direction changes.
- Economics: Cost functions that involve absolute deviations (e.g., mean absolute error) rely on the derivative of (|x|) for gradient descent algorithms.
Step‑by‑Step Calculation Guide
Below is a practical workflow for differentiating expressions containing absolute values:
- Identify the inner function (u(x)).
- Check for zeros of (u(x)). Points where (u(x) = 0) are potential non‑differentiable points.
- Apply the piecewise rule:
- If (u(x) > 0), treat (|u|) as (u) and differentiate normally.
- If (u(x) < 0), treat (|u|) as (-u) and differentiate.
- Combine results using the sign factor (\frac{u}{|u