The derivative of absolute value of x, written as (\frac{d}{dx}|x|), is a classic example in calculus that shows how a simple piecewise‑defined function can have a derivative everywhere except at a single point where the graph changes direction abruptly. Understanding this derivative helps students grasp the concepts of continuity, differentiability, and the role of limits in defining slopes of curves that are not smooth everywhere Easy to understand, harder to ignore..
Introduction
The absolute value function, (|x|), maps any real number to its non‑negative magnitude. Because the function changes its formula at (x=0), the derivative does not exist in the traditional sense at that point, yet we can describe the derivative piecewise and discuss the behavior using one‑sided limits. Its graph consists of two straight lines meeting at the origin: a line with slope (-1) for (x<0) and a line with slope (+1) for (x>0). This article walks through the computation, provides a scientific explanation of why the derivative behaves as it does, answers common questions, and summarizes the key takeaways.
Worth pausing on this one.
Steps to Compute the Derivative
To find (\frac{d}{dx}|x|) we follow a systematic approach that treats the function as two separate linear pieces.
-
Rewrite the absolute value as a piecewise function
[ |x| = \begin{cases} -x, & x < 0 \ 0, & x = 0 \ x, & x > 0 \end{cases} ] -
Differentiate each piece on its open interval
- For (x<0): (\frac{d}{dx}(-x) = -1).
- For (x>0): (\frac{d}{dx}(x) = +1).
-
Examine the point (x=0) using limits
The derivative at a point is defined as
[ f'(0)=\lim_{h\to0}\frac{f(0+h)-f(0)}{h}. ]
Compute the left‑hand limit ((h\to0^{-})) and the right‑hand limit ((h\to0^{+})):- Left‑hand: (\displaystyle \lim_{h\to0^{-}}\frac{|h|-0}{h}= \lim_{h\to0^{-}}\frac{-h}{h}= -1).
- Right‑hand: (\displaystyle \lim_{h\to0^{+}}\frac{|h|-0}{h}= \lim_{h\to0^{+}}\frac{h}{h}= +1).
Since the two one‑sided limits are not equal, the two‑sided limit does not exist; therefore the derivative at (x=0) is undefined Turns out it matters..
-
Write the final derivative expression
[ \frac{d}{dx}|x| = \begin{cases} -1, & x < 0 \ \text{undefined}, & x = 0 \ +1, & x > 0 \end{cases} ]
An equivalent compact form uses the sign function: (\displaystyle \frac{d}{dx}|x| = \operatorname{sgn}(x)) for (x\neq0), where (\operatorname{sgn}(x) = -1) if (x<0) and (+1) if (x>0) That's the part that actually makes a difference..
Scientific Explanation
The absolute value function is continuous everywhere because (\lim_{x\to0}|x| = 0 = |0|). Even so, continuity alone does not guarantee differentiability. Differentiability requires that the function have a well‑defined tangent line, which in turn depends on the existence of a unique limit of the difference quotient from both sides.
-
Geometric view: For (x<0) the graph is a line sloping downward; its tangent (the line itself) has slope (-1). For (x>0) the graph slopes upward with slope (+1). At the origin the graph makes a sharp corner; there is no single line that touches the graph only at that point and approximates it on both sides. The corner is why the derivative fails to exist there That's the part that actually makes a difference..
-
Analytic view: The derivative definition involves the limit of (\frac{|x+h|-|x|}{h}) as (h\to0). When (x\neq0), the absolute value can be removed without changing sign, leading to a constant numerator ((\pm h)) and thus a constant limit ((\pm1)). At (x=0) the numerator becomes (|h|), which behaves like (-h) for negative (h) and (+h) for positive (h), giving opposite limits Worth knowing..
-
Connection to the sign function: The sign function (\operatorname{sgn}(x)) captures exactly the piecewise constant slope of (|x|) away from zero. It is discontinuous at zero, mirroring the non‑differentiability of (|x|) at that point. This relationship is useful in more advanced topics such as distribution theory, where the derivative of (|x|) is interpreted as (2\delta(x)-1) in the sense of generalized functions, but for standard calculus the piecewise definition suffices.
FAQ
Q1: Can we assign a value to the derivative at (x=0) by convention?
A: Some contexts (e.g., subgradient in convex analysis) define the subderivative of (|x|) at 0 as the interval ([-1,1]). In ordinary calculus, however, the derivative remains undefined because the limit does not converge to a single number.
Q2: How does the derivative of (|x|) relate to the derivative of (\sqrt{x^2})?
A: Since (|x| = \sqrt{x^2}), differentiating (\sqrt{x^2}) using the chain rule yields (\frac{x}{\