2H

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$yesyessmooth
$y = |x|$yesnocorner
$y = x^{\frac13}$yesnovertical tangent
$y = \dfrac1x$nononot even defined

Testing a piecewise function at the join

For a function made of two pieces meeting at $x = a$, run two checks:

  1. Continuity: do both pieces give the same value at $x = a$?
  2. Differentiability: if so, do both pieces give the same gradient at $x = a$?
Example 1●●

$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$?

Left: $4 + k$. Right: $3(2) - 1 = 5$.
The left piece gives f(2). The right piece must approach the same value.
Continuous when $4 + k = 5$, so $k = 1$.
Left gradient: $2x = 4$. Right gradient: $3$.
Differentiate each piece and evaluate at the join.
The gradients differ, so there is a corner at $(2, 5)$. $f$ is continuous but not differentiable at $x = 2$.
Example 2: making the join smooth●●●

$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$.

Values: $9 - 6 = 3$ and $3a + b$, so $3a + b = 3$.
Differentiable needs continuous first. Match the values.
Gradients: $2x - 2 = 4$ and $a$, so $a = 4$.
Then match the gradients.
Then $b = 3 - 12 = -9$. The line $y = 4x - 9$ is the tangent to the parabola at $x = 3$.
Joining a line to a parabola

Orange: y = x² − 2x for x < 3. Blue: y = ax + b for x ≥ 3.

Try this

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)$.

Flashcards
Continuous at $x = a$
No jump or gap: $\displaystyle\lim_{x \to a} f(x) = f(a)$.
Differentiable at $x = a$
Continuous, and smooth: the gradients from both sides agree.
$y = |x|$ at $x = 0$
Continuous but not differentiable (a corner).
Practice
  1. At $x = 0$, $y = |x|$ is:

  2. Which function is not continuous at $x = 0$?

  3. $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.

  4. With $k = 1$, the function above is:

  5. $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$.

  6. For the same function, find $b$.

  7. At $x = 0$, $y = x^{\frac13}$ is:

  8. Find the gradient of $y = |x^2 - 4|$ just to the left of $x = 2$.

  9. 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.

  10. 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)$.

Formula sheet