Tutorial on how to find derivatives of functions in calculus (Differentiation) involving the absolute value.
A video on How to Find the derivative of an Absolute Value Function? is included.
Derivative of an Absolute Value Function
Let \( f(x) = |u(x)| \). Note that \( |u(x)| = \sqrt{u^2(x)} \).
Use the chain rule of differentiation to find the derivative of \( f = |u(x)| = \sqrt{u^2(x)} \):
\[ \dfrac{df}{dx} = \dfrac{df}{du} \dfrac{du}{dx} \] \[ \dfrac{df}{du} = \dfrac{1}{2} \dfrac{2u}{\sqrt{u^2}} = \dfrac{u}{|u|} \]Hence:
Examples with Solutions
Worked Examples: Step-by-Step Solutions
Example 1
Find the first derivative \( f'(x) \), if \( f(x) \) is given by:
\[ f(x) = |x - 1| \]Solution to Example 1:
Let \( u = x - 1 \) so that \( f(x) \) may be written as \( f(x) = |u| = \sqrt{u^2} \).
Use the chain rule:
\[ f'(x) = \dfrac{df}{du} \dfrac{du}{dx} = \left(\dfrac{1}{2} \dfrac{2u}{\sqrt{u^2}}\right) \dfrac{du}{dx} = u \cdot \dfrac{u'}{|u|} = \dfrac{x-1}{|x-1|} \]Note the following:
- If \( x > 1 \), then \( |x - 1| = x - 1 \) and \( f'(x) = 1 \).
- If \( x < 1 \), then \( |x - 1| = -(x - 1) \) and \( f'(x) = -1 \).
- \( f'(x) \) does not exist at \( x = 1 \).
The graphs of \( f \) and its derivative \( f' \) show that it is not possible to draw a unique tangent to the graph of \( f \) at \( x = 1 \), which explains the non-existence of the derivative at \( x = 1 \).
Example 2
Find the first derivative of \( f \) given by:
\[ f(x) = -x + 2 + |-x + 2| \]Solution to Example 2:
\( f(x) \) is made up of the sum of two functions. Let \( u = -x + 2 \), so that:
\[ f'(x) = -1 + u' \dfrac{u}{|u|} = -1 + \dfrac{-1(-x+2)}{|-x+2|} \]Simplify:
\[ f'(x) = -1 - \dfrac{-x+2}{|-x+2|} \]Note the following:
- If \( x < 2 \), \( |-x + 2| = -x + 2 \) and \( f'(x) = -2 \).
- If \( x > 2 \), \( |-x + 2| = -(-x + 2) \) and \( f'(x) = 0 \).
- \( f'(x) \) does not exist at \( x = 2 \).
As an exercise, plot the graph of \( f \) and explain the results concerning \( f'(x) \) obtained above.
Example 3
Find the first derivative of \( f \) given by:
\[ f(x) = \dfrac{x+1}{|x^2 - 1|} \]Solution to Example 3:
Using the quotient rule and absolute value derivative formula:
\[ f'(x) = \dfrac{1 \cdot |x^2 - 1| - (x+1)(2x)\dfrac{x^2 - 1}{|x^2 - 1|}}{|x^2 - 1|^2} \]Split the fraction into two terms and simplify the fraction on the left side:
\[ f'(x) = \dfrac{1}{|x^2-1|} - \dfrac{2x(x+1)(x^2-1)}{(x^2-1)^2|x^2-1|} \]Simplify the fraction on the right side:
\[ f'(x) = \dfrac{1}{|x^2-1|} - \dfrac{2x}{(x-1)|x^2-1|} \]Set the two fractions to the same denominator:
\[ f'(x) = \dfrac{x-1}{(x-1)|x^2-1|} - \dfrac{2x}{(x-1)|x^2-1|} \]Add the two fractions and simplify:
\[ f'(x) = -\dfrac{x+1}{(x-1)|x^2-1|} \]Exercises with Answers
Practice Problems & Solutions
Find the first derivatives of these functions:
Hint: In some of the questions below you might have to apply the chain rule more than once.
- \( f(x) = |2x - 5| \)
- \( g(x) = (x - 2)^2 + |x - 2| \)
- \( h(x) = \left|\dfrac{x+1}{x-3}\right| \)
- \( i(x) = |-2x^2 + 2x - 1| \)
- \( j(x) = e^{|2x-1|} \)
- \( k(x) = |\ln(-3x+1)| \)
- \( l(x) = \sin |2x| \)
Answers to above exercises:
- \( f'(x) = 2 \dfrac{2x-5}{|2x-5|} \)
- \( g'(x) = 2(x - 2) + \dfrac{x-2}{|x-2|} \)
- \( h'(x) = -4 \left|\dfrac{x-3}{x+1}\right| \dfrac{x+1}{(x-3)^3} \)
- \( i'(x) = \dfrac{(-2x^2+2x-1)(-4x+2)}{|-2x^2+2x-1|} \)
- \( j'(x) = \dfrac{2e^{|2x-1|}(2x-1)}{|2x-1|} \)
- \( k'(x) = -\dfrac{3\ln(-3x+1)}{|\ln(-3x+1)|(-3x+1)} \)
- \( l'(x) = \dfrac{2x\cos(2|x|)}{|x|} \)