Continuity

A continuous function is one whose graph has no breaks. You can draw it without lifting your pencil. This page makes that idea exact, using limits.

Continuity at a point

Definition: A function $f$ is continuous at $x=a$ if

$\displaystyle\lim_{x\to a}f(x)=f(a)$.

In words: the value the function approaches is the same as the value it has. This one equation contains three conditions:

  1. $f(a)$ is defined. (There is a point on the graph at $x=a$.)
  2. $\displaystyle\lim_{x\to a}f(x)$ exists. (Both one-sided limits exist and are equal.)
  3. $\displaystyle\lim_{x\to a}f(x)=f(a)$. (The limit equals the function value.)

If any one of these conditions fails, $f$ is discontinuous at $a$. We also say that $f$ has a discontinuity at $a$.

Types of discontinuity

There are three common types:

2xy
(a) Removable discontinuity: a hole.
2xy
(b) Jump discontinuity: the graph jumps.
x = 2xy
(c) Infinite discontinuity: a vertical asymptote.

Checking continuity at a point

To check whether $f$ is continuous at $x=a$, check the three conditions in order.

Example 1: Is $f(x)=\dfrac{x^2-4}{x-2}$ continuous at $x=2$?

Solution:

At $x=2$, the denominator is $0$. So $f(2)$ is undefined, and condition 1 fails. So $f$ is not continuous at $x=2$.

The limit does exist. Factor the numerator:

$\begin{align*}&\lim_{x\to 2}\dfrac{x^2-4}{x-2}\\&=\lim_{x\to 2}\dfrac{(x-2)(x+2)}{x-2}\end{align*}$

Cancel the common factor $x-2$:

$\begin{align*}&=\lim_{x\to 2}(x+2)\end{align*}$

Now substitute $x=2$:

$\begin{align*}&\lim_{x\to 2}\dfrac{x^2-4}{x-2}=2+2=4\end{align*}$

So this is a removable discontinuity (figure a). If we define $f(2)=4$, the new function is continuous at $x=2$.

Example 2: Is $f(x)=\begin{cases}x^2+1, & x<1\\3x-1, & x\ge 1\end{cases}$ continuous at $x=1$?

Solution:

Condition 1: $f(1)=3(1)-1=2$. So $f(1)$ is defined.

Condition 2: Find the one-sided limits.

$\displaystyle\lim_{x\to 1^-}f(x)=1^2+1=2$

$\displaystyle\lim_{x\to 1^+}f(x)=3(1)-1=2$

They are equal, so $\displaystyle\lim_{x\to 1}f(x)=2$.

Condition 3: The limit is $2$, and $f(1)=2$. They are equal.

All three conditions hold, so $f$ is continuous at $x=1$.

Example 3: Is $g(x)=\begin{cases}2x+1, & x\le 2\\x^2, & x>2\end{cases}$ continuous at $x=2$?

Solution:

Condition 1: $g(2)=2(2)+1=5$. So $g(2)$ is defined.

Condition 2: Find the one-sided limits.

$\displaystyle\lim_{x\to 2^-}g(x)=2(2)+1=5$

$\displaystyle\lim_{x\to 2^+}g(x)=2^2=4$

They are different, so the limit does not exist. Condition 2 fails.

So $g$ is not continuous at $x=2$. It has a jump discontinuity (figure b).

Example 4: Find the value of $k$ that makes this function continuous at $x=2$:

$f(x)=\begin{cases}kx+3, & x<2\\x^2-k, & x\ge 2\end{cases}$

Solution:

For continuity at $x=2$, the two one-sided limits must be equal. (They will then also equal $f(2)=4-k$.)

$\displaystyle\lim_{x\to 2^-}f(x)=2k+3$

$\displaystyle\lim_{x\to 2^+}f(x)=2^2-k=4-k$

Set them equal and solve for $k$:

$\begin{align*}2k+3&=4-k\\3k&=1\\k&=\dfrac{1}{3}\end{align*}$

So $f$ is continuous at $x=2$ when $k=\dfrac{1}{3}$.

Continuity on an interval

A function is continuous on an open interval $(a,b)$ if it is continuous at every number in the interval.

A closed interval $[a,b]$ includes its endpoints: it is all $x$ with $a\le x\le b$. At an endpoint, we can only approach from one side. So a function is continuous on $[a,b]$ if:

Which functions are continuous?

Most functions you know are continuous wherever they are defined:

Also, if $f$ and $g$ are continuous at $a$, then so are $f+g$, $f-g$, $f\cdot g$, and $\dfrac{f}{g}$ (if $g(a)\neq 0$). A function made by putting one continuous function inside another (a composition) is also continuous.

Why this matters: If $f$ is continuous at $a$, then $\displaystyle\lim_{x\to a}f(x)=f(a)$. So we can find the limit by direct substitution. This is why direct substitution works in computing limits.

Example 5: Where is $f(x)=\dfrac{x+1}{x^2-9}$ continuous?

Solution:

This is a rational function. It is continuous everywhere except where the denominator is $0$:

$x^2-9=0$, so $x=3$ or $x=-3$.

So $f$ is continuous at every $x$ except $-3$ and $3$. In interval notation:

$(-\infty,-3)\cup(-3,3)\cup(3,\infty)$

The symbol $\cup$ (union) joins the intervals together.

Example 6: Find $\displaystyle\lim_{x\to\pi}(\sin x+x\cos x)$.

Solution:

The function is made from $\sin x$, $x$, and $\cos x$, which are all continuous everywhere. So it is continuous at $x=\pi$, and we can use direct substitution (in radians):

$\begin{align*}&\lim_{x\to\pi}(\sin x+x\cos x)\\&=\sin\pi+\pi\cos\pi\\&=0+\pi(-1)\\&=-\pi\end{align*}$

The Intermediate Value Theorem

A continuous graph has no breaks. So if it starts below a horizontal line and ends above it, it must cross the line somewhere. This simple idea is called the Intermediate Value Theorem.

The Intermediate Value Theorem: Suppose $f$ is continuous on the closed interval $[a,b]$, and $N$ is any number between $f(a)$ and $f(b)$. Then there is at least one number $c$ between $a$ and $b$ with

$f(c)=N$.

abcf(a)f(b)y = Nxy
The graph is continuous from $a$ to $b$, so it cannot skip over the line $y=N$. It crosses the line at some $x=c$.

The theorem tells us that such a number $c$ exists. It does not tell us exactly where $c$ is.

Example 7: Show that the equation $x^3+x-1=0$ has a solution between $0$ and $1$.

Solution:

Let $f(x)=x^3+x-1$. It is a polynomial, so it is continuous on $[0,1]$.

$f(0)=0+0-1=-1$, which is negative.

$f(1)=1+1-1=1$, which is positive.

The number $N=0$ is between $f(0)=-1$ and $f(1)=1$. So, by the Intermediate Value Theorem, there is a number $c$ between $0$ and $1$ with $f(c)=0$. That number $c$ is a solution of the equation.

(The theorem does not give the value of $c$. A calculator shows that $c\approx 0.6823$.)

Continuity is needed. Look at $f(x)=\dfrac{1}{x}$ on $[-1,1]$. Here $f(-1)=-1$ and $f(1)=1$, but $f(x)$ is never $0$. The theorem does not apply, because $f$ is not continuous at $x=0$.