Skip to main content

Section 2.3 Differentiability

The derivative of a function does not always exist. In other words, we can’t always find the slope of the tangent line to a function. This is because the derivative is a limit, and as we’ve seen, limits do not always exist.
  • If a function has a derivative at \(x\text{,}\) then we say that \(f\) is differentiable at \(x\text{.}\)
  • If \(f\) does not have a derivative at \(x\text{,}\) then we say that \(f\) is non-differentiable at \(x\text{.}\)
Literally, “differentiable” means “able to be differentiated”, which means we can take its derivative.

Example 2.3.1. Square Root Function.

For the square root function \(f(x)=\sqrt{x}\text{,}\) recall its derivative is \(f'(x) = \frac{1}{2\sqrt{x}}\) (using the power rule).
  • The domain of \(f\) is \([0,\infty)\text{,}\) because we can only take the square root of non-negative numbers.
  • However, the domain of \(f'\) is \((0,\infty)\text{,}\) because we need to also exclude \(x=0\text{,}\) because we also cannot divide by zero.
In particular, \(f\) is not differentiable at \(x=0\text{.}\) Graph of \(f(x)=\sqrt{x}\) and its derivative. Notice that the graph of \(f\) at \(x=0\) has slopes which are increasingly steep and positive. In other words, they approach \(\infty\text{.}\) This is why the derivative does not exist at \(x=0\text{.}\)

Example 2.3.2. Derivative of Absolute Value Function.

Consider the derivative of the absolute value function,
\begin{equation*} f(x) = \abs{x} = \begin{cases} x \amp x \geq 0 \\ -x \amp x \lt 0 \end{cases} \end{equation*}
Graph of \(f(x) = \abs{x}\). It is a line with slope 1 for \(x\gt 0\text{,}\) a line with slope \(-1\) for \(x \lt 0\text{,}\) and there is a “sharp corner” at \(x = 0\text{.}\) Therefore, we expect that its derivative will be 1 for \(x \gt 0\text{,}\) \(-1\) for \(x \lt 0\text{.}\) Indeed,
  • For \(x \gt 0\text{,}\) \(f'(x) = \frac{d}{dx} x = 1\)
  • For \(x \lt 0\text{,}\) \(f'(x) = \frac{d}{dx} (-x) = -1\)
However, at \(x = 0\) (the sharp corner), we have to use the limit definition of derivative, because the function is given by two different formulas on either side of \(x = 0\text{.}\)
First, intuitively, the derivative represents the slope of the graph. However, at \(x=0\text{,}\) the function has two different slopes on each side of \(x=0\text{.}\) Therefore, we expect that the derivative does not exist at \(x=0\text{.}\) We can confirm this using the limit definition of derivative,
\begin{align*} f'(0) \amp= \lim_{h \to 0} \frac{\abs{0 + h} - \abs{0}}{h}\\ \amp= \lim_{h \to 0} \frac{\abs{h}}{h} \amp\amp \text{simplifying} \end{align*}
You might recognize this limit from one we have seen before: Limit with Absolute Value, which does not exist. To see this, we can evaluate the limit from the right and from the left,
  • From the right, as \(h \to 0+\text{,}\) \(\abs{h} = h\text{,}\) and so,
    \begin{equation*} \lim_{h \to 0+} \frac{\abs{h}}{h} = \lim_{h \to 0+} \frac{h}{h} = \lim_{h \to 0+} 1 = 1 \end{equation*}
    Thus, from the right, the slopes approach 1 (this can be confirmed graphically).
  • However, from the left, as \(h \to 0-\text{,}\) \(\abs{h} = -h\text{,}\) and so,
    \begin{equation*} \lim_{h \to 0-} \frac{\abs{h}}{h} = \lim_{h \to 0-} \frac{-h}{h} = \lim_{h \to 0-} -1 = -1 \end{equation*}
    From the left, the slopes approach \(-1\text{.}\)
Since these one sided limits are not equal, \(\lim_{h \to 0} \frac{\abs{h}}{h}\) does not exist, and so the derivative does not exist. In summary,
\begin{equation*} \boxed{\frac{d}{dx} \abs{x} = \begin{cases} 1 \amp x \gt 0 \\ -1 \amp x \lt 0 \end{cases}} \end{equation*}
Graphically: Graph of \(f(x)=\abs{x}\) and its derivative. Notice that the graph of the derivative has a jump discontinuity at \(x=0\text{.}\)
Note: The derivative of the absolute value function can be summarized concisely with a single formula, using the expression \(\frac{\abs{x}}{x}\text{,}\)
\begin{equation*} \frac{d}{dx} \abs{x} = \frac{\abs{x}}{x} \qquad x \neq 0 \end{equation*}
The absolute value function shows that a function can be continuous at a point, but not have a derivative there.

Subsection 2.3.1 Differentiability and Continuity

Intuitively, a function is differentiable at \(x\) if its graph is “smooth”. In other words, it is continuous, but also, roughly, it “bends” gently and consistently, as opposed to having a sudden change in direction.
Intuitively, this means that if a function is smooth, then it must be continuous (it can’t have a hole, jump, asymptote, etc.)
However, the reverse direction is not true. In that, if a function is continuous, this does not necessarily mean it will be differentiable.
To intuitively understand why this is always true, it is helpful to think about the equivalent statement:
If a function is not continuous at a point (it has a break, jump, or asymptote, etc.), then it must be not be differentiable at that point (the slope of a tangent line can’t be found).
In this way, differentiability is a stronger condition than continuity, in that to be differentiable, you have to be continuous at a bare minimum, and also something more.
The following four graphs illustrate this. Each level adds a stronger requirement that makes the graph more “nice”.
In summary,
  • Every differentiable function is continuous, but not every continuous function is differentiable.
  • Every continuous function is defined, but not every defined function is continuous.

Subsection 2.3.2 Examples

Checkpoint 2.3.4. Differentiability of \(x\abs{x}\).

For the function \(f(x)=x \cdot \abs{x}\text{,}\) determine if \(f\) is differentiable at \(x=0\text{.}\)
Hint.
Use the definition of derivative, \(f'(0) = \lim_{h \to 0} \frac{f(0+h)-f(0)}{h}\text{.}\)
Answer.
Yes, and \(f'(0)=0\text{.}\)

Checkpoint 2.3.5. Continuous but Not Differentiable.

Give an example of a function that is continuous on \(-\infty\lt x\lt \infty\) but is not differentiable at \(x=3\text{.}\)
Hint.
Think of the absolute value function.
Answer.
\(f(x)=|x-3|\text{.}\)

Exercise Group 2.3.1. Domain of \(f\) and \(f'\).

Find \(f'(x)\) and state the domains of \(f\) and \(f'\text{.}\)
(a)
\(f(x)=1+x+\frac{1}{2}x^2+\frac{1}{3}x^3+\frac{1}{4}x^4\)
Answer.
\(f'(x)=1+x+x^2+x^3\text{,}\) domain of \(f\) is \((-\infty,\infty)\text{,}\) domain of \(f'\) is \((-\infty,\infty)\text{.}\)
(b)
\(f(x)=4x-\sqrt[4]{x}\)
Answer.
\(f'(x)=4-\frac{1}{4x^{\frac{3}{4}}}\text{,}\) domain of \(f\) is \([0,\infty)\text{,}\) domain of \(f'\) is \((0,\infty)\text{.}\)
(c)
\(f(x)=x+\frac{\sqrt{10}}{x^5}\)
Answer.
\(f'(x)=1-\frac{5\sqrt{10}}{x^6}\text{,}\) domain of \(f\) is \((-\infty,0)\cup(0,\infty)\text{,}\) domain of \(f'\) is \((-\infty,0)\cup(0,\infty)\text{.}\)
(d)
\(f(x)=\sqrt{x}+\frac{2}{\sqrt{x}}\)
Answer.
\(f'(x)=\frac{1}{2\sqrt{x}}-\frac{1}{x\sqrt{x}}\text{,}\) domain of \(f\) is \((0,\infty)\text{,}\) domain of \(f'\) is \((0,\infty)\text{.}\)

Checkpoint 2.3.6. Piecewise Linear and Quadratic.

Let
\begin{equation*} f(x)=\begin{cases} 2x+3 \amp \text{if } x\lt -1,\\ x^2 \amp \text{if } -1\le x\le 1,\\ 3-2x \amp \text{if } x\gt 1. \end{cases} \end{equation*}
(a)
Where is \(f\) differentiable?
Answer.
\((-\infty,-1)\cup(-1,1)\cup(1,\infty)\)
(b)
Find an expression for \(f'\text{.}\)
Answer.
\(f'(x)= \begin{cases} 2 \amp \text{if } x\lt -1,\\ 2x \amp \text{if } -1\lt x\lt 1,\\ -2 \amp \text{if } x\gt 1. \end{cases}\)

Checkpoint 2.3.7. Graph of \(\abs{x^2-4}\).

Let \(f(x) = \abs{x^2-4}\text{.}\)
(a)
For what values of \(x\) is \(f\) not differentiable?
Hint.
Find where \(x^2-4=0\text{.}\)
Answer.
\(x=-2\) and \(x=2\text{.}\)
(b)
Find a formula for \(f'\text{.}\)
Answer.
\(f'(x)= \begin{cases} 2x \amp \text{if } x\lt -2 \text{ or } x\gt 2,\\ -2x \amp \text{if } -2\lt x\lt 2. \end{cases}\)
(c)
Sketch the graph of \(f\) and \(f'\text{.}\)
Hint.
Use \(f(x)=x^2-4\) for \(|x|\ge 2\) and \(f(x)=4-x^2\) for \(|x|\le 2\text{.}\)
Answer.
\(f\) is two upward-opening arms for \(|x|\ge 2\) and a downward-opening arc on \([-2,2]\text{,}\) and \(f'\) is \(2x\) outside \([-2,2]\) and \(-2x\) inside.

Checkpoint 2.3.8. Piecewise Quadratic and Linear.

Let
\begin{equation*} f(x)=\begin{cases}x^2+1 \amp \text{if } x\lt 1,\\ x+1 \amp \text{if } x\ge 1.\end{cases} \end{equation*}
Is \(f\) differentiable at 1? Sketch the graphs of \(f\) and \(f'\text{.}\)
Hint.
Compare the left and right derivatives at \(x=1\text{.}\)
Answer.
\(f\) is not differentiable at 1, and \(f'(x)=2x\) for \(x\lt 1\) while \(f'(x)=1\) for \(x\gt 1\text{.}\)

Checkpoint 2.3.9. Three-Piece Function.

Let
\begin{equation*} f(x)=\begin{cases}2x \amp \text{if } x\le 0,\\ 2x-x^2 \amp \text{if } 0\lt x\lt 2,\\ 2-x \amp \text{if } x\ge 2.\end{cases} \end{equation*}
At what numbers is \(f\) differentiable? Give a formula for \(f'\) and sketch the graphs of \(f\) and \(f'\text{.}\)
Hint.
Check differentiability at the junctions \(x=0\) and \(x=2\text{.}\)
Answer.
\(f\) is differentiable for all \(x\) except \(x=2\text{,}\) and \(f'(x)=\begin{cases}2 \amp \text{if } x\lt 0,\\ 2-2x \amp \text{if } 0\lt x\lt 2,\\ -1 \amp \text{if } x\gt 2.\end{cases}\)

Checkpoint 2.3.10. Differentiability of \(\abs{x^2-9}\).

Let \(f(x) = \abs{x^2-9}\text{.}\)
(a)
For what values of \(x\) is \(f\) differentiable?
Hint.
Find where \(x^2-9=0\text{.}\)
Answer.
All \(x\) except \(x=-3\) and \(x=3\text{.}\)
(b)
Find a formula for \(f'\text{.}\)
Answer.
\(f'(x)=\begin{cases}2x \amp \text{if } x\lt -3 \text{ or } x\gt 3,\\ -2x \amp \text{if } -3\lt x\lt 3.\end{cases}\)
(c)
Sketch the graphs of \(f\) and \(f'\text{.}\)
Hint.
Use \(f(x)=x^2-9\) for \(|x|\ge 3\) and \(f(x)=9-x^2\) for \(|x|\le 3\text{.}\)
Answer.
\(f\) is two upward-opening arms for \(|x|\ge 3\) and a downward-opening arc on \([-3,3]\text{,}\) and \(f'\) is \(2x\) outside \([-3,3]\) and \(-2x\) inside.

Checkpoint 2.3.11. Differentiability of \(\abs{x^2-1}\).

Let \(f(x) = \abs{x^2-1}\text{.}\)
(a)
For what values of \(x\) is \(f\) not differentiable?
Hint.
Find where \(x^2-1=0\text{.}\)
Answer.
\(f\) is not differentiable at \(x=-1\) and \(x=1\text{.}\)
(b)
Find a formula for \(f'\text{,}\) and sketch the graph of \(f'\text{.}\)
Hint.
Write \(f\) as a piecewise function first.
Answer.
\(f'(x)=2x\) for \(x\lt -1\) or \(x\gt 1\text{,}\) \(f'(x)=-2x\) for \(-1\lt x\lt 1\text{,}\) and \(f'\) is undefined at \(x=-1,1\text{.}\)
(c)
Find \(f'(x)\) at \(x=-2\text{,}\) 0, and 3.
Hint.
Use the formula from part (b).
Answer.
\(f'(-2)=-4\text{,}\) \(f'(0)=0\text{,}\) and \(f'(3)=6\text{.}\)

Checkpoint 2.3.12. Sum of Absolute Values.

Let \(f(x)=\abs{x-1}+\abs{x+2}\text{.}\)
(a)
Where is \(f(x)\) not differentiable?
Hint.
Find where \(x-1=0\) and where \(x+2=0\text{.}\)
Answer.
\(f\) is not differentiable at \(x=-2\) and \(x=1\text{.}\)
(b)
Find a formula for \(f'\text{.}\)
Answer.
\(f'(x)=\begin{cases}-2 \amp \text{if } x\lt -2,\\ 0 \amp \text{if } -2\lt x\lt 1,\\ 2 \amp \text{if } x\gt 1.\end{cases}\)
(c)
Sketch the graphs of \(f\) and \(f'\text{.}\)
Hint.
Use \(f(x)=-2x\) for \(x\lt -2\text{,}\) \(f(x)=3\) for \(-2\le x\le 1\text{,}\) and \(f(x)=2x\) for \(x\gt 1\text{.}\)
Answer.
\(f\) is a line with slope \(-2\) for \(x\lt -2\text{,}\) a horizontal line at height 3 for \(-2\le x\le 1\text{,}\) and a line with slope 2 for \(x\gt 1\text{.}\) The graph of \(f'\) is a line with slope 0 at height -2 for \(x\lt -2\text{,}\) a line with slope 0 at height 0 for \(-2\lt x\lt 1\text{,}\) and a line with slope 0 at height 2 for \(x\gt 1\text{.}\)

Checkpoint 2.3.13. Finding \(m\) and \(b\) for Differentiability.

Let \(f(x)=\begin{cases}x^2 \amp \text{if } x\le 2,\\ mx+b \amp \text{if } x\gt 2.\end{cases}\) Find the values of \(m\) and \(b\) that make \(f\) differentiable everywhere.
Hint.
The left and right derivatives at \(x=2\) must be equal, and \(f\) must be continuous at \(x=2\text{.}\)
Answer.
\(m=4\) and \(b=-4\text{.}\)

Checkpoint 2.3.14. Finding \(a\) for Differentiability.

Let
\begin{equation*} g(x)=\begin{cases}ax \amp \text{if } x\lt 0,\\ x^2-3x \amp \text{if } x\ge 0.\end{cases} \end{equation*}
Find the value of \(a\) that makes the following function differentiable for all \(x\)-values.
Hint.
The left and right derivatives at \(x=0\) must be equal.
Answer.
\(a=-3\text{.}\)

Checkpoint 2.3.15. Finding \(a\) and \(b\) for Differentiability.

Find the values of \(a\) and \(b\) that make the following function differentiable for all \(x\)-values. \(f(x)=\begin{cases}ax+b \amp \text{if } x\gt -1,\\ bx^2-3 \amp \text{if } x\le -1.\end{cases}\)
Hint.
The left and right derivatives at \(x=-1\) must be equal, and \(f\) must be continuous at \(x=-1\text{.}\)
Answer.
\(a=6\) and \(b=2\text{.}\)

Checkpoint 2.3.16. Piecewise Quadratic Derivative.

Let
\begin{equation*} f(x)= \begin{cases} x^2+1 \amp \text{if } x\le 0,\\ 2x^2+x+1 \amp \text{if } x\gt 0. \end{cases} \end{equation*}
Find the derivative of \(f(x)\text{.}\)
Answer.
\(f'(x)= \begin{cases} 2x \amp \text{if } x\lt 0,\\ 4x+1 \amp \text{if } x\gt 0. \end{cases}\)