Continuity and differentiability
What it means for a function to be continuous or differentiable at a point, testing piecewise-defined functions at the join, corners, cusps and vertical tangents, and finding constants that make a join smooth.
Everything in this chapter assumed the curve was in one piece and had a tangent. This section makes those two conditions precise. They matter most for functions defined in pieces, such as a phone plan that charges one rate up to a limit and another rate after it.
The two conditions
A differentiable function is always continuous: if there's a jump, there can't be a tangent. But a continuous function need not be differentiable. The classic example is $y = |x|$ at $x = 0$. It is unbroken, but there is a sharp corner. The gradient is $-1$ just to the left and $+1$ just to the right, so there is no single tangent.
| At $x = 0$ | Continuous? | Differentiable? | Why |
|---|---|---|---|
| $y = x^2$ | yes | yes | smooth |
| $y = |x|$ | yes | no | corner |
| $y = x^{\frac13}$ | yes | no | vertical tangent |
| $y = \dfrac1x$ | no | no | not even defined |
Testing a piecewise function at the join
For a function made of two pieces meeting at $x = a$, run two checks:
- Continuity: do both pieces give the same value at $x = a$?
- Differentiability: if so, do both pieces give the same gradient at $x = a$?
$f(x) = \begin{cases} x^2 + k, & x \le 2 \\ 3x - 1, & x \gt 2 \end{cases}$. Find $k$ so that $f$ is continuous. Is $f$ then differentiable at $x = 2$?
$f(x) = \begin{cases} x^2 - 2x, & x \lt 3 \\ ax + b, & x \ge 3 \end{cases}$. Find $a$ and $b$ so that $f$ is differentiable at $x = 3$.
Orange: y = x² − 2x for x < 3. Blue: y = ax + b for x ≥ 3.
First make the gap $0$, so the function is continuous. Is the join smooth yet? Now find the only pair of values of $a$ and $b$ that makes it smooth.
Your turn
$f(x) = \begin{cases} x^3, & x \lt 1 \\ mx + c, & x \ge 1 \end{cases}$ is differentiable at $x = 1$. Find $m$ and $c$.
Show the working
Gradients: $3x^2 = 3$ at $x = 1$, so $m = 3$. Values: $1 = m + c$, so $c = -2$. The line $y = 3x - 2$ is the tangent to $y = x^3$ at $(1, 1)$.
At $x = 0$, $y = |x|$ is:
The graph is unbroken, so it is continuous. The gradient jumps from $-1$ to $1$, so there is no tangent at the corner.
Which function is not continuous at $x = 0$?
$\dfrac1x$ is not defined at $x = 0$, so it can't be continuous there.
$f(x) = x^2 + k$ for $x \le 2$ and $f(x) = 3x - 1$ for $x \gt 2$. Find $k$ so that $f$ is continuous.
Both pieces must give the same value at $x = 2$: $4 + k = 5$, so $k = 1$.
With $k = 1$, the function above is:
The values match, but the gradients are $2 \times 2 = 4$ on the left and $3$ on the right, so there is a corner.
$f(x) = x^2 - 2x$ for $x \lt 3$ and $f(x) = ax + b$ for $x \ge 3$ is differentiable at $x = 3$. Find $a$.
The gradients must match: $2(3) - 2 = 4$, so $a = 4$.
For the same function, find $b$.
The values must match: $9 - 6 = 3 = 3a + b = 12 + b$, so $b = -9$.
At $x = 0$, $y = x^{\frac13}$ is:
The curve is unbroken, but $y' = \dfrac{1}{3x^{2/3}}$ is undefined at $0$: the tangent is vertical.
Find the gradient of $y = |x^2 - 4|$ just to the left of $x = 2$.
For $-2 \lt x \lt 2$, $x^2 - 4 \lt 0$, so $y = 4 - x^2$ and $y' = -2x$. Near $x = 2$ this is $-4$. (Just to the right it is $+4$, so there is a corner.)
Exam style: $f(x) = ax^2$ for $x \le 1$ and $f(x) = 4x - 2$ for $x \gt 1$. Find $a$ so that $f$ is continuous.
$a(1)^2 = 4 - 2$, so $a = 2$. The gradients are then $2a = 4$ and $4$, so the join is also smooth.
Exam style: $f(x) = x^2 + 1$ for $x \lt 2$ and $f(x) = mx + c$ for $x \ge 2$ is differentiable at $x = 2$. Find $f(3)$.
Gradient: $2x = 4$ at $x = 2$, so $m = 4$. Value: $4 + 1 = 5 = 2m + c$, so $c = -3$. Then $f(3) = 12 - 3 = 9$.
Coaching Centre