Continuity and Differentiability • Topic 1 of 3

Continuity of a Function

Informally, a function is continuous if you can draw its graph without lifting your pen — no breaks, jumps or holes. The precise definition pins that picture to the language of limits, and almost every exam question is really a check of one of three things at a single point.

Continuity at a point

A function $f$ is continuous at $x=c$ if all three conditions hold together:

  • $f(c)$ is defined (the point exists),
  • $\displaystyle\lim_{x\to c} f(x)$ exists — i.e. the left-hand limit equals the right-hand limit, $\displaystyle\lim_{x\to c^-}f(x)=\lim_{x\to c^+}f(x)$, and
  • the two agree: $\displaystyle\lim_{x\to c} f(x)=f(c)$.

If even one condition fails, $f$ is discontinuous at $c$. A compact way to write the whole test is

$$\lim_{x\to c^-} f(x)\;=\;\lim_{x\to c^+} f(x)\;=\;f(c).$$

This is the single most useful line in the chapter. For a piecewise function, the join points are exactly where the rule changes, so the standard task is to evaluate the LHL using the formula on the left, the RHL using the formula on the right, the value $f(c)$ from whichever piece owns $x=c$, and then demand all three be equal.

Continuity on an interval

$f$ is continuous on an open interval $(a,b)$ if it is continuous at every point of it. On a closed interval $[a,b]$ we additionally only require one-sided continuity at the ends: $\displaystyle\lim_{x\to a^+}f(x)=f(a)$ and $\displaystyle\lim_{x\to b^-}f(x)=f(b)$. The everyday building blocks are continuous on their natural domains:

  • Every polynomial is continuous on all of $\mathbb{R}$.
  • $\sin x,\ \cos x,\ e^{x}$ are continuous everywhere; $\log x$ is continuous for $x>0$.
  • A rational function $\dfrac{p(x)}{q(x)}$ is continuous wherever $q(x)\ne 0$.
  • $\tan x$ and $\sec x$ are continuous except where $\cos x=0$, i.e. $x=(2n+1)\dfrac{\pi}{2}$; $\cot x,\ \csc x$ except where $\sin x=0$.
  • The greatest-integer function $[x]$ is discontinuous at every integer (it jumps), and $|x|$ is continuous everywhere.

Algebra of continuous functions

If $f$ and $g$ are both continuous at $c$, then so are

$$f\pm g,\qquad f\cdot g,\qquad \lambda f\ (\lambda\text{ a constant}),\qquad \frac{f}{g}\ \big(\text{provided } g(c)\ne 0\big).$$

These rules let you certify almost any algebraic expression as continuous in a single line, without going back to limits. For example $\dfrac{x^2+1}{x-3}$ is a quotient of two polynomials (each continuous everywhere), so it is continuous wherever the denominator is non-zero — that is, for all $x\ne 3$.

Continuity of composite functions

If $g$ is continuous at $c$ and $f$ is continuous at $g(c)$, then the composite $f\circ g$ given by $(f\circ g)(x)=f\big(g(x)\big)$ is continuous at $c$. In words: a continuous function of a continuous function is continuous. This is why expressions such as $\sin(x^2)$, $e^{\cos x}$, $\sqrt{x^2+1}$ and $|\,\sin x\,|$ are continuous on their domains — each is built by composing functions already known to be continuous.

Finding unknown constants for continuity

A favourite question type gives a piecewise $f$ with one or two unknown constants and asks you to choose them so that $f$ is continuous. The recipe never changes: at each join, set LHL $=$ RHL $=f(\text{join})$ and solve the resulting equation(s). With one unknown you get one equation; with two unknowns (typically two joins or a jump plus a defined value) you get two equations to solve simultaneously.

Three graphs comparing a continuous function, a jump discontinuity, and a removable discontinuity Continuous vs two kinds of discontinuity x y c Continuous no gap at c x y c Jump LHL ≠ RHL x y c f(c) Removable hole, limit exists
1
Worked Example
Is $f(x)=\begin{cases} x+1, & x\le 2\\ 2x-1, & x>2\end{cases}$ continuous at $x=2$?
Solution

$f(2)=2+1=3$. LHL $=\lim_{x\to2^-}(x+1)=3$. RHL $=\lim_{x\to2^+}(2x-1)=3$. All three agree, so $f$ is continuous at $x=2$.

Answer: $f$ is continuous at $x=2$.

2
Worked Example
Find $k$ so that $f(x)=\begin{cases} kx^2, & x\le 1\\ 4, & x>1\end{cases}$ is continuous at $x=1$.
Solution

RHL $=4$ and $f(1)=k$. LHL $=\lim_{x\to1^-}kx^2=k$. For continuity $k=4$.

Answer: $k=4$.

3
Worked Example
Discuss the continuity of $f(x)=\dfrac{1}{x-3}$.
Solution

It is a quotient of continuous functions, continuous wherever the denominator is non-zero, i.e. for all $x\ne3$. At $x=3$ the function is undefined, so it is discontinuous only there.

Answer: Continuous for all $x\ne3$; discontinuous only at $x=3$.

4
Worked Example
Show $f(x)=|x|$ is continuous at $x=0$.
Solution

$f(0)=0$. LHL $=\lim_{x\to0^-}(-x)=0$, RHL $=\lim_{x\to0^+}(x)=0$. All equal $0$, so $|x|$ is continuous at $0$ (though, as the next page shows, not differentiable there).

Answer: $|x|$ is continuous at $0$.

5
Worked Example
Examine the continuity of $f(x)=\begin{cases}\dfrac{x^2-9}{x-3}, & x\ne 3\\ 5, & x=3\end{cases}$ at $x=3$.
Solution

For $x\ne 3$, $\dfrac{x^2-9}{x-3}=\dfrac{(x-3)(x+3)}{x-3}=x+3$, so $\lim_{x\to3}f(x)=3+3=6$. But $f(3)=5$. Since $\lim_{x\to3}f(x)=6\ne 5=f(3)$, the function is discontinuous at $x=3$. (It would be continuous if $f(3)$ were redefined as $6$ — a removable discontinuity.)

Answer: Discontinuous at $x=3$ (removable discontinuity).

6
Worked Example
Show that $f(x)=\begin{cases}\dfrac{\sin x}{x}, & x\ne 0\\ 1, & x=0\end{cases}$ is continuous at $x=0$.
Solution

Using the standard limit $\lim_{x\to0}\dfrac{\sin x}{x}=1$, both one-sided limits equal $1$, so $\lim_{x\to0}f(x)=1$. Also $f(0)=1$. Hence LHL $=$ RHL $=f(0)=1$ and $f$ is continuous at $x=0$.

Answer: $f$ is continuous at $x=0$.

7
Worked Example
For what value of $k$ is $f(x)=\begin{cases}kx+1, & x\le \pi\\ \cos x, & x>\pi\end{cases}$ continuous at $x=\pi$?
Solution

$f(\pi)=k\pi+1$ and LHL $=\lim_{x\to\pi^-}(kx+1)=k\pi+1$. RHL $=\lim_{x\to\pi^+}\cos x=\cos\pi=-1$. Continuity requires $k\pi+1=-1$, so $k\pi=-2$ and $k=-\dfrac{2}{\pi}$.

Answer: $k=-\dfrac{2}{\pi}$.

8
Worked Example
Find the values of $a$ and $b$ so that $f(x)=\begin{cases}5, & x\le 2\\ ax+b, & 2
Solution

Continuity is automatic inside each piece; only the joins $x=2$ and $x=10$ matter. At $x=2$: $a(2)+b=5\Rightarrow 2a+b=5$. At $x=10$: $a(10)+b=21\Rightarrow 10a+b=21$. Subtracting, $8a=16\Rightarrow a=2$, and then $b=5-2(2)=1$. So $a=2,\ b=1$.

Answer: $a=2,\ b=1$.

9
Worked Example
Discuss the continuity of the composite function $f(x)=\sin(x^2)$ and of $g(x)=|\,1-x+|x|\,|$.
Solution

$f(x)=\sin(x^2)$ is the composition of $u=x^2$ (a polynomial, continuous everywhere) with $\sin u$ (continuous everywhere); a continuous function of a continuous function is continuous, so $f$ is continuous on all of $\mathbb{R}$. Similarly $g$ is built from $|x|$, the polynomial $1-x$, sums, and another modulus — each step is continuous — so $g$ is continuous on $\mathbb{R}$.

Answer: Both $f$ and $g$ are continuous on $\mathbb{R}$.

10
Worked Example
Show that the greatest-integer function $f(x)=[x]$ is discontinuous at $x=1$ but continuous at $x=1.5$.
Solution

At $x=1$: LHL $=\lim_{x\to1^-}[x]=0$ (just below $1$ the value is $0$) while RHL $=\lim_{x\to1^+}[x]=1$. Since LHL $\ne$ RHL, $f$ is discontinuous at $x=1$ (a jump). At $x=1.5$: throughout a small neighbourhood $[x]=1$, so LHL $=$ RHL $=f(1.5)=1$ and $f$ is continuous there. Indeed $[x]$ is discontinuous exactly at the integers.

Answer: Discontinuous at $x=1$ (jump); continuous at $x=1.5$.

Key Points

  • Continuous at $c$ $\iff$ $f(c)$ defined, $\lim_{x\to c}f(x)$ exists, and the two are equal: $\lim_{x\to c^-}f=\lim_{x\to c^+}f=f(c)$.
  • For piecewise functions, test only the join points — equate LHL, RHL and $f(c)$ there.
  • Polynomials, $\sin,\cos,e^{x}$ are continuous everywhere; $\log x$ for $x>0$; rational functions wherever the denominator is non-zero; $[x]$ jumps at every integer.
  • Algebra: sums, differences, products, scalar multiples and quotients (non-zero denominator) of continuous functions are continuous.
  • A continuous function of a continuous function is continuous, so composites like $\sin(x^2)$ and $e^{\cos x}$ are continuous on their domains.
  • To fix unknown constants, set LHL $=$ RHL $=f(\text{join})$ at each join and solve; one unknown gives one equation, two unknowns give a simultaneous pair.
  • A removable discontinuity (a hole) can be "repaired" by redefining $f$ at the point to equal the limit; a jump (LHL $\ne$ RHL) cannot.
Tap an option to check your answer0 / 4
Q1.$f$ is continuous at $x=c$ requires $\lim_{x\to c}f(x)$ to equal:
Explanation: The limit must equal the function value $f(c)$.
Q2.$f(x)=\dfrac{1}{x-2}$ is discontinuous at:
Explanation: The denominator vanishes at $x=2$.
Q3.For $f(x)=\begin{cases}3x,&x\le1\\ a,&x>1\end{cases}$ to be continuous at $1$, $a=$
Explanation: LHL $=f(1)=3$, so RHL $a=3$.
Q4.Which is continuous for all real $x$?
Explanation: $\sin x$ is continuous everywhere; the others have points of discontinuity.