When we found the derivative of x2 or a line, f′(a) came out to a single number. Does every function have a derivative at every point?
Remember, the derivative is the limit of secant slopes as h approaches 0. A positive h puts a+h to the right of a, and a negative h puts a+h to the left. We can also write x=a+h. Then as h approaches 0,x approaches a, and we get the same limit.
f′(a)=h→0limhf(a+h)−f(a)
Using x
f′(a)=x→alimx−af(x)−f(a)
When this limit exists as a number, we say f is differentiable at a. If f is differentiable at every point in an interval, we say it's differentiable on that interval.
A two-sided limit exists only when the limit from the left equals the limit from the right. So for f′(a) to exist, the secant slopes from the left and the secant slopes from the right must approach the same number.
Let's check this on f(x)=x2 at x=1. With h=−1, the point on the left is (0,0), and the secant slope is 1. With h=1, the point on the right is (2,4), and the secant slope is 3.
f(x)=x2
hf(1+h)−f(1)=h(1+h)2−1=h2h+h2=2+h
h→0−lim(2+h)=2
h→0+lim(2+h)=2
f′(1)=2
As h approaches 0 from either side, both secant slopes approach 2, which is the slope of the tangent line y=2x−1.
Because the derivative is a limit, it doesn't have to exist at every point. We've already seen limits fail when the two sides approach different numbers, or when the values go to infinity or negative infinity.
2
Why ∣x∣ has no derivative at 0
Now let's see whether f(x)=∣x∣ has a derivative at x=0. The formula for ∣h∣ changes at 0: it's h when h>0 and −h when h<0. So we check the secant slopes from each side separately.
hf(0+h)−f(0)=h∣h∣
h<0:h∣h∣=h−h=−1
h>0:h∣h∣=hh=1
h→0−limh∣h∣=−1=1=h→0+limh∣h∣
h→0−limh∣h∣=−1=1=h→0+limh∣h∣
Does ∣x∣ have a derivative at x=0?
Text solution
The slope doesn't depend on hOn the right, every secant runs from (0,0) along y=x, and on the left along y=−x. So the slopes stay 1 and −1 however small h gets.
(h,h) on y=x
(h,−h) on y=−x
The two sides disagreeJust like x−2∣x−2∣ as x approaches 2, the one-sided limits are different, so the limit doesn't exist and neither does f′(0). The lowest point might look like it has a horizontal tangent, but the secant slopes never get close to 0.
Still continuousAs x approaches 0,∣x∣ approaches f(0), so there's no break in the graph.
x→0lim∣x∣=0=f(0)
So ∣x∣ is continuous at 0, but it has no derivative there. When the slopes from the left and the right approach different numbers like this, the graph has a sharp turn called a corner.
3
Vertical tangents and cusps
A corner isn't the only way a derivative can fail to exist. The graph of the cube root of x has no corner at 0, and it's continuous there, since 3x approaches 0=30. Does it have a derivative at 0? And what about x32, which is (3x)2?
Find the derivative of 3x and x32 at x=0
Text solution
Cancel one cube rootSubstituting h=0 gives 00. Since h=(3h)3, one factor of 3h cancels.
hf(0+h)−f(0)=h3h=(3h)21
3x: a vertical tangentThe square keeps the denominator positive, so the slopes go to ∞ from both sides. ∞ isn't a number, so f′(0) does not exist. The secants approach the vertical line x=0, which has no slope.
h→0−lim(3h)21=∞
h→0+lim(3h)21=∞
x32: a cuspThis time two factors cancel, and there's no square left to keep the denominator positive. The sign of 3h sends the slopes to opposite infinities.
(3h)3(3h)2=3h1
h→0−lim3h1=−∞
h→0+lim3h1=∞
−1
1
slope 9
slope 9
y=3x
−1
1
slope −3
slope 3
y=x32
Both 3x and x32 are continuous at 0, but neither one has a derivative there. 3x has a vertical tangent because the slopes approach ∞ from both sides, and x32 has a cusp because the slopes approach −∞ from the left and ∞ from the right.
4
Why there's no derivative at a break
Earlier we saw that x2 has slope 2 at x=1, and the line 2x+1 has slope 2 everywhere. So what if f(x) is x2 for x≤1 and 2x+1 for x>1? Does f′(1) equal 2? Let's test the difference quotient from each side.
21
1
23
1
2
3
4
x
y
x2
2x+1
2
slope 23
slope 6
h<0:h(1+h)2−1=2+h
h→0−lim(2+h)=2
h>0:h2(1+h)+1−1=h2+2h=h2+2
h→0+lim(h2+2)=∞
Does f(x)=x2 for x≤1 and 2x+1 for x>1 have a derivative at 1?
1
x
y
x2
2x+1
Text solution
The pieces don't meetSince 1≤1,f(1)=1 comes from x2. But 2x+1 approaches 3 as x approaches 1 from the right, so there's a gap of 2 between the pieces.
3−1=2
The gap ends up over hFrom the right we still subtract f(1)=1, so the 2 in the numerator is that gap. At h=0.1 the quotient is 22, and at h=0.01 it's 202.
h2+2→∞
No derivativeThe right-hand limit isn't a number, so f′(1) does not exist, even though both pieces have slope 2.
The gap is what broke the derivative. In fact, a function with a derivative at a has to be continuous at a, and multiplying and dividing f(a+h)−f(a) by h shows why.
f(a+h)−f(a)=hf(a+h)−f(a)⋅h→f′(a)⋅0=0
f(a+h)−f(a)=hf(a+h)−f(a)⋅h→f′(a)⋅0=0
h→0limf(a+h)=f(a)
The fraction approaches the number f′(a) and h approaches 0, so f(a+h)−f(a) approaches 0. That's the definition of continuity at a. So at a jump, a hole or a point off the curve, there's no derivative. But continuity alone isn't enough: ∣x∣ and 3x are continuous at 0, and neither has a derivative there.
If differentiable
differentiable at a⟹continuous at a
If not continuous
not continuous at a⟹not differentiable at a
Continuity is not enough
continuous at a⟹differentiable at a(∣x∣ at 0)
Knowing a derivative exists also tells us the function's limit. For example, if f(2)=7 and f′(2)=3, the limit of f(x) as x approaches 2 must be the function value, 7.
Here's the whole picture in the difference quotient. The denominator h always approaches 0. When there's a gap, the numerator approaches a nonzero number and the quotient has no limit. When f is continuous, substitution gives 00, and the limit still has to be worked out.
Nonzero gap
h2+2h:2+2h→2=0
Continuous cases
h2h+h2→2h∣h∣:−1 and 1h3h→∞
At a local minimum like x=0 on y=x2, the difference quotient approaches 0, so the tangent line is horizontal.
f(x)=x2
hf(0+h)−f(0)=hh2=h
f′(0)=h→0limh=0
Why does the derivative fail to exist in each of these cases?
Four ways the derivative can fail to exist
5
Making a piecewise function differentiable
Earlier, we saw that matching the slope wasn't enough. 2x+1 has slope 2, but its gap of 2 at x=1 made the difference quotient go to infinity. Now both the slope and the height of the line are unknown, and we want to choose a and b so that f has a derivative at 1.
Find a and b so that f(x)=x2 for x≤1 and ax+b for x>1 is differentiable at 1
1
x
y
x2
ax+b
Text solution
Split the right-hand quotientFrom the left, the x2 piece gives slope 2 as before. From the right, we use ax+b and f(1)=1, and a+b−1 is the gap between the pieces at 1.
ha(1+h)+b−1=ha+b−1+a
Close the gapIf a+b−1 isn't 0, that fraction goes to ∞ or −∞. So the pieces must have the same value at 1.
a+b−1=0
Match the slopesNow the right-hand slope is just a, and any a=2 makes a corner, like ∣x∣ at 0.
a=2
b=1−a=−1
ax+b=2x−1
The line y=2x−1 is 1+2(x−1), the tangent line to x2 at 1. So the line has to meet x2 at x=1 with the same slope.
How should we position the line so the function is differentiable at x=1?
Making the function differentiable
Summary
What differentiability means
f′(a)=h→0limhf(a+h)−f(a)
f is differentiable at a when this limit exists as a finite number. If the formula changes at a, as it does for ∣x∣ or a piecewise function, check h→0− and h→0+ separately. The secant slopes from both sides must approach the same number.
Why a derivative can fail to exist
x2,2x+1
−1
1
∣x∣
3x
x32
A function has no derivative at a when the secant slopes don't approach one finite number.
Where the function isn't continuous, there's no derivative.
At a corner, the slopes from the left and right approach different numbers, as with −1 and 1 for ∣x∣ at 0.
At a vertical tangent, the slopes grow without bound with the same sign on both sides. For 3x at 0, they approach ∞.
At a cusp, the slopes approach −∞ from one side and ∞ from the other, as with x32 at 0.
Differentiability and continuity
differentiable at a⟹continuous at a
not continuous at a⟹not differentiable at a
continuous at a⟹differentiable at a(∣x∣ at 0)
differentiable at a⟹continuous at a
not continuous at a⟹not differentiable at a
continuous at a⟹differentiable at a(∣x∣ at 0)
If f has a derivative at a, it must be continuous at a, so limx→af(x)=f(a). If f isn't continuous at a, it can't have a derivative there. But being continuous at a doesn't guarantee a derivative exists. ∣x∣ is continuous at 0, but has a corner there and no derivative.
Making a piecewise function differentiable
f(x)={x2,ax+b,x≤1x>1
a+b=1,a=2
Where a piecewise function switches formula, take f(a) from the piece that includes a. For f to be differentiable at a, the two pieces must have the same value at a, and their slopes at a must be equal. Making the y-values match at 1 gives a+b=1. Matching the slopes gives a=2, so b must be −1. If the pieces don't have the same value, the nonzero gap makes the difference quotient go to ∞ or −∞, even if the pieces have equal slopes.
6
Practice
Enter exact values, or DNE if a derivative does not exist.
1
The graph of f is shown on [−4,5], with x=−3,−1,1,2,3 marked. At which of the marked x-values is f continuous but not differentiable?
−3
−1
1
2
3
x
y
Is f continuous at x=2 and x=3?
What is the slope of the tangent line at x=1?
If you got C Check whether f is continuous at x=2 and x=3. The question asks only for points where f is continuous.
If you got D Check the tangent line at x=−1. A horizontal tangent line has slope 0, so the derivative exists there.
If you got A Check the tangent line at x=1. The curve is continuous there, but a vertical tangent line has no slope.
Check continuityAt x=2 there is a hole, and at x=3 there is a jump, so f is not continuous at either point and cannot be differentiable there.
x=2,3:not continuous⟹not differentiable
Look for corners and vertical tangentsAt x=−3 the graph has a sharp corner, and at x=1 the tangent line is vertical, so f is continuous at both points but f′ does not exist.
x=−3:corner
x=1:vertical tangent
Check the horizontal tangentAt x=−1 the curve is smooth and has a horizontal tangent line, so f′(−1)=0.
x=−1:horizontal tangent
f′(−1)=0
That leaves x=−3 and x=1, which is option B.
continuous, not differentiable:x=−3,x=1(B)
2
Let g(x)=∣x2−4∣. At which values of x is g not differentiable?
The formula for an absolute value can change where the expression inside is 0. Where is x2−4=0?
For h<0 near 0, is (2+h)2−4=h(4+h) positive or negative?
If you got −2,0,2 Check the derivative at x=0. Between −2 and 2,g(x)=4−x2, and its difference quotient approaches 0.
Find where the formula changesThe absolute value can only change formula where the expression inside is 0.
x2−4=0→x=−2,x=2
Test the difference quotient at 2For h near 0,4+h is positive, so the sign of the quotient depends entirely on h. The quotient approaches −4 from the left and 4 from the right, so g′(2) does not exist.
hg(2+h)−g(2)=h∣4h+h2∣=h∣h∣(4+h)
h→0−limh∣h∣(4+h)=−4
h→0+limh∣h∣(4+h)=4
Test the difference quotient at -2For h near 0,4−h is positive, so the quotient approaches −4 from the left and 4 from the right, and g′(−2) does not exist.
hg(−2+h)−g(−2)=h∣h2−4h∣=h∣h∣(4−h)
h→0−limh∣h∣(4−h)=−4
h→0+limh∣h∣(4−h)=4
Check the horizontal tangent at 0Between −2 and 2,x2−4 is negative, so g(x)=4−x2. The difference quotient at 0 simplifies to −h, which approaches 0 from both sides, so g′(0)=0.
−2<x<2:g(x)=4−x2
hg(0+h)−g(0)=h−h2=−h→0
3
Let f(x)=x∣x∣. Find f′(0), or enter DNE if it does not exist.
Set up the difference quotient at 0. What does hh∣h∣ simplify to?
If you got DNE Work out the difference quotient before deciding. The factor of h in the denominator cancels with the h in front of ∣h∣.
We plug f(0)=0 and f(h)=h∣h∣ into the difference quotient, and the factor of h cancels.
hf(0+h)−f(0)=hh∣h∣=∣h∣
As h approaches 0 from either side, ∣h∣ approaches 0, so the limit exists and f′(0)=0.
h→0−lim∣h∣=0=h→0+lim∣h∣,f′(0)=0
4
Let f be a function and a a number. Which of the following must be true? I. If f is differentiable at a, then f is continuous at a. II. If f is continuous at a, then f is differentiable at a. III. If f is not continuous at a, then f is not differentiable at a.
For statement II, test f(x)=∣x∣ at a=0. Is it continuous? Is it differentiable?
If statement I is true, can a function be differentiable at a point where it is not continuous?
If you got B Check statement II with f(x)=∣x∣ at a=0. It is continuous at 0, but the slopes from the left and right do not match.
If you got A Check statement III. If f were differentiable at a, statement I says it would have to be continuous, so a function that is not continuous cannot be differentiable.
If f is differentiable at a, multiplying the difference quotient by h shows that f(a+h)−f(a) approaches 0, so f must be continuous at a.
I:differentiable at a⟹continuous at a
The function f(x)=∣x∣ is continuous at 0, but its slopes from the left and right are −1 and 1, so statement II is false.
II:f(x)=∣x∣,a=0
x→0lim∣x∣=0=f(0)
h→0−limh∣h∣=−1,h→0+limh∣h∣=1
By statement I, a function that isn't continuous can't be differentiable, so statements I and III must be true.
III:not continuous at a⟹not differentiable at a(C)
5
Let f(x)={x2,4x−3,x<2x≥2. Find f′(2), or enter DNE if it does not exist.
What is f(2)?
Does the limit of x2 as x→2− equal f(2)?
If you got 4 The two pieces each have slope 4 at x=2, but check whether they have the same value at x=2.
Check continuity at 2The right piece gives f(2)=5, but the left piece approaches 4, so f is not continuous at 2 and cannot be differentiable there.
f(2)=4⋅2−3=5,x→2−limx2=4
Test the difference quotient from each sideFrom the right, the difference quotient simplifies to 4. But from the left, (2+h)2−5 approaches −1 instead of 0, so h−1 goes to ∞.
h>0:h4(2+h)−3−5=h4h=4
h<0:h(2+h)2−5=h−1+4h+h2=h−1+4+h
h→0−lim(h−1+4+h)=∞
6
Let f(x)={bx+3,ax2+1,x<−1x≥−1. Find a and b so that f is differentiable at x=−1.
What is f(−1) in terms of a?
What does (−1+h)2−1 expand to?
If you got a=32,b=34 Check the sign of the slope from the right. As h→0,a(h−2) approaches −2a, not 2a.
Find the value at -1Because −1≥−1,f(−1) comes from ax2+1.
f(−1)=a(−1)2+1=a+1
Find the slope from the rightExpanding (−1+h)2 gives 1−2h+h2, so the difference quotient from the right simplifies to a(h−2), which approaches −2a.
h>0:ha(−1+h)2+1−(a+1)=ha(h2−2h)=a(h−2)→−2a
Set up the quotient from the leftFor h<0, the difference quotient uses bx+3 and subtracts f(−1)=a+1.
h<0:hb(−1+h)+3−(a+1)=h2−a−b+b
Solve for a and bFor the left-hand limit to exist, 2−a−b must be 0, and matching the two slopes gives b=−2a.
2−a−b=0,b=−2a→a=−2,b=4
With a=−2 and b=4, both pieces equal −1 at x=−1, and both have slope 4.
x=−1:4x+3=−1−2x2+1=−1
7
Let f(x)=x2sinx1 for x=0, and f(0)=0. Find f′(0), or enter DNE if it does not exist. Challenge
Write out the difference quotient hf(0+h)−f(0) using f(0)=0.
Since ∣sin(1/h)∣≤1, what can you say about ∣hsin(1/h)∣?
If you got DNE Check the difference quotient after canceling h. It simplifies to hsin(1/h), not sin(1/h).
Set up the difference quotientWe plug in f(0)=0 and cancel one factor of h.
hf(0+h)−f(0)=hh2sin(1/h)=hsinh1
Apply the squeeze theoremBecause sine is between −1 and 1, we squeeze hsin(1/h) between −∣h∣ and ∣h∣, which both approach 0.
−∣h∣≤hsinh1≤∣h∣
h→0lim(−∣h∣)=0=h→0lim∣h∣→f′(0)=0
Without the extra factor of h, as in xsin(1/x), the difference quotient would be sin(1/h), which has no limit at 0.