Derivatives: From Difference Quotients to the Chain Rule
Defining the derivative through difference quotients, proving differentiability implies continuity, using three examples to separate continuity from differentiability, then proving the sum, Leibniz, quotient and chain rules in full, and closing with the necessary condition at a local extremum.
本讲建立了导数的定义与四条运算法则,把「可导」从一个极限条件变成了可操作的代数工具。下一讲从费马引理出发,依次证明 Rolle 定理、中值定理、洛必达法则与泰勒展开;再往后进入积分,本讲的导数法则会成为微积分基本定理的另一半。课程的逻辑始终一致:先给出严格定义,再证一条看似平凡的引理,然后用它撬动整条定理链。
The problem: capturing instantaneous rate of change with a limit
The previous lectures lived in metric spaces and measured how far apart points are. This lecture leaves metric spaces, returns to R, and begins differential calculus.
The idea of a derivative is plain: to capture the instantaneous rate of change of f near x0, take a nearby point x and compute the secant slope
x−x0f(x)−f(x0),
then let x→x0. This quotient is the difference quotient; defining it requires x=x0, otherwise the denominator vanishes.
Definition. If the limit
x→x0limx−x0f(x)−f(x0)
exists, then f is differentiable at x0, and the limit is the derivativef′(x0).
This is a two-sided limit: f must be defined in a neighbourhood of x0, and approaching from the left and from the right must give the same number. That is exactly why ∣x∣ is not differentiable at 0 — the two one-sided difference quotients are −1 and 1.
Timeline
Time
Topic
0:00
Difference quotients and the definition of the derivative
2:19
Derivatives of constant and identity functions
5:10
Overview of the four differentiation rules
7:02
Sum rule (proof)
10:52
Statement of the Leibniz rule
13:12
Differentiable implies continuous (proof)
21:01
Three examples: $
36:54
Leibniz rule (proof)
42:58
Quotient rule (proof)
53:50
Using the rules on polynomials and rational functions
1:00:07
Chain rule (proof by cases)
1:16:06
Necessary condition at a local extremum (stated)
The two basic derivatives
Constant functions
If f(x)≡C, then for any x=x0,
x−x0f(x)−f(x0)=x−x0C−C=0.
The difference quotient is identically 0, so f′(x0)=0 for every x0.
The identity function
If f(x)=x, then
x−x0f(x)−f(x0)=x−x0x−x0=1,
so f′(x0)=1 for every x0.
These two examples are the seeds of the whole chain: every polynomial and rational function is assembled from them using the rules.
Differentiable implies continuous
Theorem. If f is differentiable at x0, then f is continuous at x0.
Proof. Write L=f′(x0). By the definition of the derivative, taking ε=1 gives δ>0 such that 0<∣x−x0∣<δ implies
x−x0f(x)−f(x0)−L<1.
Multiply both sides by ∣x−x0∣:
∣f(x)−f(x0)−L(x−x0)∣<∣x−x0∣.
Split the left side and apply the triangle inequality:
At x=x0 the left side is 0<ε anyway. Hence f is continuous at x0. □
The proof is worth reading closely: it first translates "the difference quotient is close to the derivative" into "the function difference is close to L(x−x0)", then separates the error from the linear term with the triangle inequality. The same decomposition reappears in the product rule.
The converse fails. Continuity does not imply differentiability; the three examples below go from bad to good.
Three examples
Example 1: f(x)=∣x∣ at 0
∣x∣ is continuous everywhere. At x0=0 the difference quotient is
x−0∣x∣−0=x∣x∣={1,−1,x>0,x<0.
The right limit is 1, the left limit is −1; they differ, so the limit does not exist and f is not differentiable at 0.
The lesson: differentiability requires the two sides to agree on a slope; a corner does not qualify.
Example 2: f(x)=xsinx1 at 0
Set f(0)=0 and f(x)=xsin(1/x) for x=0.
Continuity. Since ∣sin(1/x)∣≤1,
∣f(x)−f(0)∣=∣x∣sinx1≤∣x∣→0,
so f is continuous at 0 (in fact everywhere).
Non-differentiability. The difference quotient at 0 is
x−0f(x)−f(0)=xxsin(1/x)=sinx1.
As x→0, sin(1/x) oscillates infinitely often between −1 and 1 and has no limit. So f is not differentiable at 0.
This example is worse than ∣x∣: restricting ∣x∣ to x>0 makes it differentiable from the right, whereas xsin(1/x) fails from either side — the oscillation happens in every neighbourhood, in every direction.
Example 3: f(x)=x2sinx1 at 0
Again set f(0)=0. The difference quotient is now
xx2sin(1/x)=xsinx1.
Since ∣xsin(1/x)∣≤∣x∣→0, the difference quotient has limit 0, so f′(0)=0.
The same oscillation is flattened by one extra factor of x. Together the two examples pin down the distinction: continuity controls the size of function values, differentiability also controls the oscillation of the difference quotient; multiplying by x cancels the denominator and damps the amplitude.
The sum rule
Theorem. If f and g are differentiable at x0, then so is f+g, and
The inserted terms cancel exactly. Split into two fractions:
=g(x)⋅x−x0f(x)−f(x0)+f(x0)⋅x−x0g(x)−g(x0).
Now take limits term by term. Differentiability gives continuity of f at x0, so g(x)→g(x0); the first quotient tends to f′(x0). In the second term f(x0) is constant and the quotient tends to g′(x0). Therefore
Why was "differentiable implies continuous" needed first? Because the proof requires g(x)→g(x0), while g is only assumed differentiable. That is exactly where the earlier theorem earns its place — it is not decoration, it is a hypothesis of this line.
The same trick appeared when proving that the product of two convergent sequences converges: write anbn−ab=an(bn−b)+b(an−a). Same idea, different setting.
The quotient rule
Theorem. If f and g are differentiable at x0 and g is nonzero near x0, then f/g is differentiable at x0 and
(gf)′(x0)=g(x0)2f′(x0)g(x0)−f(x0)g′(x0).
Proof. Put the difference quotient over a common denominator:
Let x→x0. Since g is differentiable hence continuous, g(x)→g(x0)=0, so 1/g(x)→1/g(x0). The two difference quotients tend to f′(x0) and g′(x0). Hence
The lecturer notes an alternative: prove the special case 1/g first (take f≡1), then apply Leibniz to f⋅(1/g). Both work; the direct common-denominator version finishes in one pass but has longer algebra.
Building whole classes of functions
With four rules, enormous families of derivatives follow mechanically from two basic ones.
Polynomials. Since x↦x has derivative 1, induction with Leibniz gives
(xn)′=nxn−1.
Concretely, x2=x⋅x gives (x2)′=1⋅x+x⋅1=2x; multiply by another x and repeat. Hence for
P(x)=anxn+an−1xn−1+⋯+a1x+a0,
the sum rule differentiates term by term:
P′(x)=nanxn−1+(n−1)an−1xn−2+⋯+a1.
The constant term contributes 0.
Rational functions. If R(x)=P(x)/Q(x) with P,Q polynomials, the quotient rule gives, wherever Q(x)=0,
R′(x)=Q(x)2P′(x)Q(x)−P(x)Q′(x).
So every polynomial and every rational function is differentiable wherever its denominator does not vanish, and the derivative can be computed explicitly.
The chain rule
The first three rules handle sums, products and quotients; the chain rule handles composition.
Let f be defined on an interval and g on an interval containing the image of f, with composition
(g∘f)(x)=g(f(x)).
Theorem. If f is differentiable at x0 and g is differentiable at y0=f(x0), then g∘f is differentiable at x0 and
(g∘f)′(x0)=g′(y0)f′(x0).
Proof: first the case of nonzero derivative
Write y=f(x) and y0=f(x0). When y=y0, the difference quotient factors as
This is pure algebra: multiply and divide by y−y0.
Assume f′(x0)=0. Then for x sufficiently close to x0 with x=x0, the quotient x−x0f(x)−f(x0) stays close to the nonzero number f′(x0), hence is nonzero, so y=y0 and the factorisation is legitimate.
Let x→x0:
f differentiable implies f continuous, so y→y0;
hence the first factor y−y0g(y)−g(y0)→g′(y0);
the second factor →f′(x0).
The product tends to g′(y0)f′(x0).
The remaining case: zero derivative
If f′(x0)=0, split into two subcases.
y=y0: the numerator of the composite difference quotient is g(y0)−g(y0)=0, so the quotient is identically 0 and the limit is 0=g′(y0)⋅0.
y=y0: use the factorisation above. The second factor tends to f′(x0)=0; the first factor y−y0g(y)−g(y0) is bounded near y0 — it converges to the finite number g′(y0), and a convergent sequence is bounded. A bounded quantity times one tending to zero tends to 0.
Both subcases give the limit 0=g′(y0)f′(x0). □
Why not divide by y−y0 from the start? Because it can happen that f(x)=f(x0) with x=x0, making the denominator zero and the factorisation meaningless. Assuming f′(x0)=0 rules this out (a quotient staying away from zero forces f to separate nearby points), and the zero-derivative case is handled separately. This is a standard analytic strategy: push the technical obstruction aside with an extra hypothesis, then return and patch it.
The necessary condition at a local extremum
The lecture closes by stating the next theorem; the proof comes next time.
Definition.x0 is a local maximum of f if there is δ>0 such that f(x)≤f(x0) for all x∈(x0−δ,x0+δ). A local minimum is the same with the inequality reversed.
Theorem (Fermat). If f is differentiable at x0 and x0 is a local maximum or minimum, then f′(x0)=0.
Intuitively the tangent at an extremum must be horizontal: a positive slope would mean larger values just to the right, a negative slope larger values just to the left, so neither can be an extremum.
This theorem is the seed of Rolle's theorem, hence of the mean value theorem, hence of L'Hôpital's rule and Taylor expansion — the main line of the next lecture.
What this lecture establishes
The derivative is the (two-sided) limit of the difference quotient; x=x0 and a neighbourhood of x0 are required.
The derivative of a constant is 0; the derivative of the identity is 1.
Differentiable implies continuous; continuous does not imply differentiable. ∣x∣ and xsin(1/x) are continuous but not differentiable; x2sin(1/x) is differentiable.
The sum, Leibniz and quotient rules are proved by inserting cross terms and using limit algebra; Leibniz and the quotient rule rely on "differentiable implies continuous".
The chain rule splits into f′(x0)=0 and f′(x0)=0; the latter needs separate treatment of f(x)=f(x0).
From these rules every polynomial and rational function is differentiable, with an explicit derivative.
At a local extremum the derivative vanishes (Fermat's lemma), the seed of the mean value theorem.
Comprehension check
1. Use the definition to prove that f(x)=x2 is differentiable at every x0, and find the derivative.
Reference answer: The difference quotient is
x−x0x2−x02=x−x0(x−x0)(x+x0)=x+x0(x=x0).
Letting x→x0 gives 2x0. So f′(x0)=2x0, i.e. f′(x)=2x. The factorisation cancels the denominator, the most direct way to differentiate a polynomial.
2. Prove that differentiability implies continuity (show how δ1 is chosen).
Reference answer: Let f′(x0)=L. With ε=1 there is δ>0 such that 0<∣x−x0∣<δ implies x−x0f(x)−f(x0)−L<1. Multiplying out gives ∣f(x)−f(x0)−L(x−x0)∣<∣x−x0∣, so
Given ε>0, take δ1=min{δ,ε/(1+∣L∣)}; then 0<∣x−x0∣<δ1 gives ∣f(x)−f(x0)∣<ε, and at x=x0 the left side is 0. Hence f is continuous.
3. Why is ∣x∣ not differentiable at 0, while x2sin(1/x) is?
Reference answer: The difference is in the quotient. For ∣x∣ the quotient is sgn(x), with right limit 1 and left limit −1, so the two-sided limit fails. For x2sin(1/x) the quotient is xsin(1/x); although sin(1/x) oscillates between −1 and 1, the factor x damps it, ∣xsin(1/x)∣≤∣x∣→0, and the limit exists and equals 0. The first fails because a corner gives different one-sided slopes; the second is flattened because the amplitude decays.
4. Prove the Leibniz rule and identify where continuity is used.
inserting −f(x0)g(x)+f(x0)g(x) in the middle. As x→x0 the first quotient tends to f′(x0) and the second to g′(x0). Continuity is used to replace the limit of g(x) by g(x0); since g is only assumed differentiable, "differentiable implies continuous" must come first. Without it the limit of g(x) is not available.
5. Use the quotient rule to differentiate f(x)=1/x and state the domain restriction.
Reference answer: Take numerator 1 and denominator x. The quotient rule gives
f′(x)=x20⋅x−1⋅1=−x21,x=0.
The quotient rule requires the denominator to be nonzero near the point, so the conclusion holds only for x=0. It also shows 1/x is not differentiable at 0 — it is not even defined there.
6. In the chain rule proof, why can the limit of a product not be applied directly to x−x0g(f(x))−g(f(x0))?
Reference answer: To write it as a product one must multiply and divide by f(x)−f(x0), but when f(x)=f(x0) this factor is zero and the division is illegal. The proof therefore splits into cases: first assume f′(x0)=0, which keeps the difference quotient away from zero and guarantees f(x)=f(x0) near x0, making the division legitimate; then handle f′(x0)=0, where terms with f(x)=f(x0) give a zero quotient and terms with f(x)=f(x0) have one bounded factor times one tending to zero.
7. Give a function that is differentiable at a point but whose derivative is discontinuous there.
Reference answer: Take
f(x)=⎩⎨⎧x2sinx1,0,x=0,x=0.
It is differentiable at 0 with f′(0)=0 (the quotient is xsin(1/x)→0). But for x=0,
f′(x)=2xsinx1−cosx1,
and cos(1/x) does not converge as x→0, so f′ is discontinuous at 0. Thus differentiability does not imply continuity of the derivative; that is a genuinely stronger condition.
Relation to neighbouring lectures
This lecture establishes the definition of the derivative and four rules, turning "differentiable" from a limit condition into a workable algebraic tool. The next lecture starts from Fermat's lemma and proves Rolle's theorem, the mean value theorem, L'Hôpital's rule and Taylor expansion. Later, integration arrives, and the differentiation rules become one half of the fundamental theorem of calculus. The logic of the course never changes: give a rigorous definition, prove a lemma that looks routine, then use it to lever a whole chain of theorems.