MAT158H1/Unit 06
Unit 06 · Analysis 1A

Derivatives

The derivative as a limit, with every rule proved. In analysis we also care about the fine print — differentiable implies continuous but not conversely, and a derivative can exist everywhere yet fail to be continuous. This unit builds both the rules and the counterexamples.

By the end you can
Why it matters & where it comes from
Why it exists

The derivative captures the instantaneous rate of change — the exact slope "right here" — which an average rate of change cannot.

In the real world

Physics (velocity), economics (marginal cost), and above all machine learning, where training a network is gradient descent — repeatedly following derivatives downhill.

Story & open questions

Newton and Leibniz discovered it independently and feuded over credit; Leibniz's $dy/dx$ notation won. Weierstrass's nowhere-differentiable continuous function later showed just how far continuity is from differentiability.

The definition

Definition Derivative

$f$ is differentiable at $a$ if $$f'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}$$ exists. Equivalently $f'(a)=\displaystyle\lim_{x\to a}\frac{f(x)-f(a)}{x-a}$. Geometrically it is the slope of the tangent line at $\big(a,f(a)\big)$.

Example From the definition

For $f(x)=\tfrac1x$ and $a\ne0$:

$\dfrac{f(a+h)-f(a)}{h}=\dfrac1h\!\left(\dfrac{1}{a+h} -\dfrac1a\right)=\dfrac{-1}{a(a+h)}$.
As $h\to0$ (limit laws of Unit 3) this tends to $-\dfrac{1}{a^2}$, so $f'(a)=-1/a^2$. ∎
Example A corner

For $f(x)=|x|$ at $0$, the quotient is $|h|/h$: it tends to $1$ from the right and $-1$ from the left, so $f'(0)$ does not exist. One-sided derivatives exist; the two-sided one does not.

Differentiable implies continuous

Theorem

If $f$ is differentiable at $a$, then $f$ is continuous at $a$. The converse fails ($|x|$ at $0$).

Proof
For $x\ne a$, $f(x)-f(a)=\dfrac{f(x)-f(a)}{x-a}\cdot(x-a)$.
As $x\to a$, the first factor tends to $f'(a)$ and the second to $0$, so $f(x)-f(a)\to f'(a)\cdot0=0$. ∎

The rules, proved

Theorem

If $f,g$ are differentiable at $x$: $(f+g)'=f'+g'$,   $(fg)'=f'g+fg'$,   $\left(\dfrac fg\right)'=\dfrac{f'g-fg'}{g^2}$ when $g(x)\ne0$, and the chain rule $(f\circ g)'(x)=f'(g(x))\,g'(x)$ when $f$ is differentiable at $g(x)$.

Proof Product rule
Add and subtract $f(x+h)g(x)$: $\dfrac{f(x+h)g(x+h)-f(x)g(x)}{h} =f(x+h)\dfrac{g(x+h)-g(x)}{h}+\dfrac{f(x+h)-f(x)}{h}\,g(x).$
As $h\to0$: $f(x+h)\to f(x)$ (differentiable ⇒ continuous), so the whole expression tends to $f g'+f'g$. ∎
Proof Power rule, by induction
$n=1$: $(x)'=1=1\cdot x^0$. ✓
If $(x^k)'=kx^{k-1}$, the product rule on $x^{k+1}=x\cdot x^k$ gives $1\cdot x^k+x\cdot kx^{k-1}=(k+1)x^k$. ∎
Proof idea Why the chain rule needs care
The tempting proof multiplies and divides by $g(x+h)-g(x)$ — which may be $0$ for $h$ arbitrarily small (it happens for $g(x)=x^2\sin(1/x)$ at $0$).
The fix: define $\varphi(y)=\dfrac{f(y)-f(g(x))}{y-g(x)}$ for $y\ne g(x)$ and $\varphi(g(x))=f'(g(x))$. Then $\varphi$ is continuous at $g(x)$, the quotient equals $\varphi(g(x+h))\cdot\dfrac{g(x+h)-g(x)}{h}$ with no division by zero, and the limit is $f'(g(x))g'(x)$. ∎

The analysis showpiece: $x^2\sin(1/x)$

Example Differentiable everywhere, derivative discontinuous

Let $h(x)=x^2\sin(1/x)$ for $x\ne0$ and $h(0)=0$.

At $0$: $\left|\dfrac{h(t)-h(0)}{t}\right| =|t\sin(1/t)|\le|t|\to0$, so $h'(0)=0$ — differentiable.
For $x\ne0$, the rules give $h'(x)=2x\sin(1/x)-\cos(1/x)$. As $x\to0$ the first term dies but $\cos(1/x)$ oscillates between $\pm1$ forever — so $\lim_{x\to0}h'(x)$ does not exist, and $h'$ is not continuous at $0$.
What this example teaches "Differentiable" does not mean "$f'$ is continuous." Functions with continuous derivatives get their own name ($C^1$). Keep this example ready — it settles many plausible-sounding false claims, and it returns in Unit 7 when we ask what derivatives can and cannot do.
Common pitfalls

• The difference quotient is a limit — never plug in $h=0$.
• Don't drop the inner factor $g'(x)$ in the chain rule.
• Continuity does not imply differentiability; corners and cusps are everywhere.
• $f'$ existing everywhere does not make $f'$ continuous — see the showpiece above.

Practice

Original problems written for this guide in the style of Spivak's exercises. Write a full solution before opening the answer.

Practice 1 · Definition

From the definition, find $f'(a)$ for $f(x)=\sqrt x$, $a>0$.

Solution
Rationalize: $\dfrac{\sqrt{a+h}-\sqrt a}{h}=\dfrac{1}{\sqrt{a+h}+\sqrt a} \to\dfrac{1}{2\sqrt a}$.
Practice 2 · Theory

Prove differentiability at $a$ implies continuity at $a$.

Solution
$f(x)-f(a)=\dfrac{f(x)-f(a)}{x-a}(x-a)\to f'(a)\cdot0=0$ as $x\to a$.
Practice 3 · A corner

Show $|x|$ is not differentiable at $0$.

Answer
The difference quotient $|h|/h$ is $+1$ for $h>0$ and $-1$ for $h<0$; the two one-sided limits disagree, so the limit does not exist.
Practice 4 · Cubic from scratch

Compute $f'(a)$ for $f(x)=x^3$ directly from the definition.

Solution
$\dfrac{(a+h)^3-a^3}{h}=3a^2+3ah+h^2\to3a^2$.
Practice 5 · The showpiece

Verify $h'(0)=0$ for $h(x)=x^2\sin(1/x)$, $h(0)=0$, straight from the definition.

Solution
$\left|\dfrac{h(t)}{t}\right|=|t\sin(1/t)|\le|t|$, and $|t|\to0$; squeeze gives the limit $0$.
Practice 6 · Differentiable at one point

Let $f(x)=x^2$ for rational $x$ and $f(x)=0$ for irrational $x$. Show $f$ is differentiable at $0$ (and only there).

Solution
$\left|\dfrac{f(h)}{h}\right|\le|h|\to0$, so $f'(0)=0$. At $a\ne0$, $f$ is not even continuous (rationals give $\approx a^2$, irrationals give $0$), so it cannot be differentiable there.
Practice 7 · Even and odd

Prove: if $f$ is differentiable and even, then $f'$ is odd.

Solution
Differentiate $f(-x)=f(x)$ with the chain rule: $-f'(-x)=f'(x)$, i.e. $f'(-x)=-f'(x)$.
Practice 8 · Quotient from product

Derive the quotient rule from the product rule and the derivative of $1/g$.

Solution
First $\left(\tfrac1g\right)'=-\tfrac{g'}{g^2}$ (definition, or chain rule with $1/u$). Then $\left(\tfrac fg\right)'=f'\cdot\tfrac1g+f\cdot\left(-\tfrac{g'}{g^2}\right) =\dfrac{f'g-fg'}{g^2}$.

Expanded topic checklist

Course coverage. This unit is part of the complete MAT158H1 topic map. It should cover the following items before you move on:

Textbook/source alignment

Use the current UofT MAT158H1 calendar topics as the coverage spine, and pair lecture notes with a Spivak-style proof-calculus text for extra reading. The exact assigned textbook should still be checked against the instructor syllabus.

Core theorem map

The derivative spine is: limit of difference quotient, algebra of limits, continuity consequence, and local linear approximation.

Study routine. When proving a rule, write the difference quotient first; when computing, state which already-proved rule justifies each step.

Deep practice extensions

Use these after the main practice set. They are designed to force definition-level reasoning, theorem selection, and mixed application rather than routine calculation only.

Extension 1 · First principles

Compute $(x^3)\prime$ from the definition.

Guide
Use $[(x+h)^3-x^3]/h=3x^2+3xh+h^2$, which tends to $3x^2$.
Extension 2 · Continuity consequence

Prove differentiability at $a$ implies continuity at $a$.

Guide
Write $f(x)-f(a)=[(f(x)-f(a))/(x-a)](x-a)$ for $x e a$. The first factor tends to $f\prime(a)$ and the second to $0$.
Extension 3 · Converse failure

Give a continuous function that is not differentiable at $0$.

Guide
$f(x)=|x|$ is continuous at $0$ but has left derivative $-1$ and right derivative $1$.
Extension 4 · Chain rule use

Differentiate $(1+x^2)^5$ and name the rule.

Guide
By the chain rule, the derivative is $5(1+x^2)^4(2x)=10x(1+x^2)^4$.