Differentiability and the chain rule · Mathematics… | StemPy Lab
Course 9.2·Lesson 1 of 3
Differentiability and the chain rule
The derivative of f at a is the limit of the difference quotient hf(a+h)−f(a)
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
define the derivative at a point as a limit, and test differentiability with the left and right derivatives;
explain why a differentiable function is continuous, and why the opposite is false;
use the chain rule, also when there are three or more links.
The derivative as a limit
Pick a point a on a graph. The line through (a,f(a)) and (a+h,f(a+h)) has slope hf(a+h)−f(a). As h shrinks to zero, this line turns into the tangent. The derivative of f at a is
f′(a)=h→0limhf(a+h)−f(a),
when the limit exists. Then f is differentiable at a. The number f′(a) is the slope of the tangent. British texts say gradient and American texts say slope. They mean the same.
Left and right derivatives
The number h can be negative or positive. So there are two one-sided limits.
The left derivativef′(a−) is the limit of the quotient as h→0−.
The right derivativef′(a+) is the limit as h→0+.
The function is differentiable at a exactly when both exist and are equal.
For f(x)=∣x∣ at a=0 the quotient is h∣h∣. It is −1 for negative h and 1 for positive h. The two derivatives differ, so ∣x∣ is not differentiable at 0. Its graph has a corner. For f(x)=x2 the quotient is hh2=h, which tends to 0 from both sides.
Three small graphs side by side. Smooth: the parabola y = x squared, with a red tangent line at the origin that lies along the x-axis, slope 0. Corner: the graph of y = absolute value of x, a V shape with its point at the origin, with a blue line of slope -1 on the left and a red line of slope 1 on the right. Vertical tangent: the curve y = cube root of x, which rises steeply through the origin, with a dashed vertical line through the origin.
Three ways to fail
A corner. The left and right derivatives exist but differ, as for ∣x∣ at 0.
A vertical tangent. For f(x)=x1/3 at 0 the quotient is h−2/3, which grows without bound. The tangent is vertical, so there is no slope.
A break. If f is not continuous at a, it cannot be differentiable there. The next section shows why.
Differentiable means continuous
If f is differentiable at a, then f is continuous at a. To see this, write
f(a+h)−f(a)=hf(a+h)−f(a)×h.
As h→0 the fraction tends to f′(a) and the factor h tends to 0. The product tends to 0, so f(a+h)→f(a).
The opposite is false. The function ∣x∣ is continuous at 0 but not differentiable there. So when you test differentiability, check continuity first. If it fails, you can stop.
The rules you already know
The sum and difference: (u±v)′=u′±v′.
The product: (uv)′=u′v+uv′.
The quotient: (vu)′=v2u′v−uv′.
The power: (xn)′=nxn−1.
These rules hold inside a piece where one formula applies. At a point where the formula changes, go back to the limit definition and use the left and right derivatives.
The chain rule
A function of a function has two links. Suppose y=f(u) and u=g(x). Then
dxdy=dudy×dxdu.
In function notation this reads (f(g(x)))′=f′(g(x))g′(x).
In words: differentiate the outside function, keep the inside as it is, and multiply by the derivative of the inside.
For y=(3x+1)5 the outside is u5 and the inside is 3x+1. So y′=5(3x+1)4×3=15(3x+1)4.
For y=sin(x2), y′=cos(x2)×2x.
With three links, multiply three factors. For y=sin3(2x)=(sin2x)3, y′=3sin2(2x)×cos(2x)×2=6sin2(2x)cos(2x).
A worked example
Is f(x)=x3 for x≤2 and f(x)=12x−16 for x>2 differentiable at x=2?
Continuity first.f(2)=8. The right piece gives 12(2)−16=8 at x=2. So f is continuous at 2.
Left derivative. On the left f′(x)=3x2, so f′(2−)=12.
Right derivative. On the right f′(x)=12, so f′(2+)=12.
Compare. The two derivatives are equal, so f is differentiable at 2 and f′(2)=12.
Practise with new numbers
Try it in Python
The program estimates slopes from the left and from the right at x=0 for three functions. Then it checks the chain rule on sin(x2).
Common mistakes
Forgetting the inner derivative. The derivative of (3x+1)5 is not 5(3x+1)4. You must also multiply by 3.
Testing one side only. A corner shows up only when you compare the two sides.
Believing a continuous function is differentiable. Continuity is needed, but it is not enough.
Using the rules across a join. For a piecewise function, differentiate each piece, then compare the one-sided derivatives at the join.
Remember these
f′(a)=h→0limhf(a+h)−f(a). It exists when f′(a−)=f′(a+).
Differentiable implies continuous. Continuous does not imply differentiable.
Corners, vertical tangents and breaks are the ways to fail.
Chain rule: dxdy=dudy×dxdu.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find the left and right derivatives of f(x)=∣x−2∣ at x=2. Is f differentiable there?
Differentiate y=(5x−3)6.
Differentiate y=sin(x3).
True or false: if f is continuous at a, then f is differentiable at a.
Is f(x)=x1/3 differentiable at x=0?
References
OpenStax, Calculus Volume 1, Chapter 3, sections on the derivative as a function and on the chain rule.
NCERT, Mathematics Part I for Class XII, Chapter 5, section on differentiability.
Enroll free in Differentiability and the Rules of Differentiation
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.
when this limit exists, which needs the left and right derivatives to be equal. A differentiable function is continuous, but a continuous function can have a corner. The chain rule differentiates a function of a function.
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Implicit, logarithmic and parametric differentiation