Continuity and piecewise-defined functions
What it means for a function to be continuous at a point, how to sketch piecewise-defined functions, and how to test whether the pieces join up.
Calculus only works on curves without breaks, so we need a clear test for where a graph is broken. Piecewise functions, defined by different rules on different parts of the domain, are where breaks most often hide. Phone plans, tax brackets and postage costs are all piecewise.
Continuity at a point
- $y = x^2$ is continuous everywhere.
- $y = \dfrac{1}{x - 2}$ has a discontinuity at $x = 2$, where it isn't even defined.
- $y = \dfrac{1}{x^2 - 9}$ has discontinuities at $x = 3$ and $x = -3$.
- A function is never continuous at an endpoint of its domain, because you can't approach from both sides. $y = \sqrt x$ is continuous for $x \gt 0$ but not at $x = 0$.
We assume that the functions in this course are continuous at every point of their domain unless there's an obvious problem, such as a zero denominator or a change of rule.
Piecewise-defined functions
A piecewise function uses different formulas on different parts of the domain. For example
$$f(x) = \begin{cases} 9 - x^2, & x \le 1 \\ 5 + 3x, & x \gt 1 \end{cases}$$To sketch it, draw each piece only on its own part of the domain. At the boundary, use a closed circle for the piece that includes $x = 1$ and an open circle for the piece that doesn't.
Test the function $f$ above for continuity at $x = 1$, and state its range.
$g(x) = \begin{cases} 2^x, & x \lt 1 \\ 3, & x = 1 \\ x + 2, & x \gt 1 \end{cases}$. Is $g$ continuous at $x = 1$?
Making the pieces join
Find $k$ so that $f(x) = \begin{cases} x^2 + k, & x \le 2 \\ 3x - 1, & x \gt 2 \end{cases}$ is continuous.
Left of x = 1: y = x². From x = 1 on: y = mx + c.
- With $m = -2$, work out the $c$ that removes the jump, then set it and check.
- Find a different pair $m$, $c$ that also joins up. What do all the joining pairs have in common?
Your turn
Find $a$ if $f(x) = \begin{cases} ax + 1, & x \lt 2 \\ x^2 - a, & x \ge 2 \end{cases}$ is continuous.
Show the working
$f(2) = 4 - a$ from the bottom line, and the left formula gives $2a + 1$ at $x = 2$. Setting them equal: $2a + 1 = 4 - a$, so $3a = 3$ and $a = 1$.
Where is $y = \dfrac{1}{x^2 - 9}$ discontinuous?
The denominator $x^2 - 9 = (x - 3)(x + 3)$ is zero at $x = \pm 3$.
$f(x) = 9 - x^2$ for $x \le 1$ and $f(x) = 5 + 3x$ for $x \gt 1$. Find $f(1)$.
$x = 1$ belongs to the first line: $9 - 1 = 8$.
For the same function, find $f(3)$.
$3 \gt 1$, so use the second line: $5 + 9 = 14$.
Is that function continuous at $x = 1$?
Different formulas are fine, as long as they give the same value at the join. Here $f(1) = 8$, $9 - 1 = 8$ and $5 + 3 = 8$.
$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 + k = 3(2) - 1 = 5$, so $k = 1$.
$g(x) = 2^x$ for $x \lt 1$, $g(1) = 3$, and $g(x) = x + 2$ for $x \gt 1$. Find $g(1)$.
The middle line defines $g(1) = 3$.
On the graph of that function $g$, at $x = 1$ there is:
The left piece $2^x$ heads to $(1, 2)$ but doesn't include it. The actual point is $(1, 3)$, where the right piece starts.
Is $y = \sqrt x$ continuous at $x = 0$?
The graph can't be approached from the left of $0$, so it can't be drawn through the point from both sides.
Exam style: $f(x) = a - x$ for $x \lt 2$ and $f(x) = x^2 + 2a$ for $x \ge 2$. Find $a$ so that $f$ is continuous.
Left formula at $2$: $a - 2$. $f(2) = 4 + 2a$. Setting equal: $a - 2 = 4 + 2a$, so $a = -6$. Check: both give $-8$.
Exam style: $f(x) = x^2 - 4x$ for $x \lt 3$ and $f(x) = ax + b$ for $x \ge 3$. $f$ is continuous and passes through $(5, 7)$. Find $a$.
Continuity at $3$: $9 - 12 = -3$, so $3a + b = -3$. Through $(5, 7)$: $5a + b = 7$. Subtracting: $2a = 10$, so $a = 5$ (and $b = -18$).
Coaching Centre