4.3 The ε\varepsilon-δ\delta definition of continuity

Intuitively, a function is continuous if its graph contains no ‘abrupt jumps’ or ‘breaks’, so that it can be drawn without lifting the pen off the page. Many familiar functions such as polynomials and trigonometric functions are continuous. For contrast, we illustrate two functions which do not have this property in Figure 4.9: in both cases, the graph is ‘broken’ at x=ax=a. Whilst the mechanical ‘without lifting the pen’ idea of continuity is helpful for building intuition, it is not useful for mathematical reasoning. We therefore need to formulate a precise mathematical definition, which encapsulates our intuition.

Figure 4.9: Functions with jumps. In both cases, we can find values of xx slightly to the right of aa for which |f(x)f(a)|>1/2|f(x)-f(a)|>1/2. In particular, the point (x,f(x))(x,f(x)) lies outside the yellow corridor around the line y=1y=1.

We first need to have a better understanding of what it means for the graph to have an ‘abrupt jump’. Let’s consider the functions illustrated in Figure 4.9. From the picture, we see that each function has a jump at x=ax=a. If we take any point xx slightly to the right of aa, then we see from the sketch that f(x)3/2f(x)\geq 3/2 but f(a)=1f(a)=1. Thus, even if xx is really close to aa, the values of f(x)f(x) and f(a)f(a) are far apart: they are separated by at least 1/21/2. Visually, the point (x,f(x))(x,f(x)) lies outside the horizontal corridor of radius 1/21/2, centred around the line y=1y=1.

With the above example in mind, we can start to understand what it means for a function to be continuous at a point aa\in\mathbb{R}. In particular, we need to rule out the behaviour observed in Figure 4.9. Thus, continuity should mean

by taking xx close to aa, we can make f(x)f(x) as close as we like to f(a)f(a).

Another way to express this is:

(4.3) (4.3) For any measure of closeness, if xx is near enough to aa, then f(x)f(x) is close to f(a)f(a).

We can turn (4.3) into a formal mathematical definition in a similar way to how we defined the limit of a sequence. Note that, since we want to consider xx that are ‘close’ to aa, we need ff to be defined on an interval around aa. For simplicity, the way we will ensure this is by simply requiring that the domain of ff is an interval.

Definition 4.20 (ε\varepsilon-δ\delta definition of continuity).

Let II\subseteq\mathbb{R} be an interval, f:If\colon I\to\mathbb{R} and aIa\in I.

  1. 1

    We say ff is continuous at aa if for all ε>0\varepsilon>0, there exists some δ>0\delta>0 (which in general depends on ε\varepsilon) such that

    if xI satisfies |xa|<δ, then|f(x)f(a)|<ε.\text{if $x\in I$ satisfies $|x-a|<\delta$, then}\quad|f(x)-f(a)|<\varepsilon.
  2. 2

    We say ff is discontinuous at aa if it is not continuous at aa.

(a) Given ε>0\varepsilon>0, we consider a horizontal ε\varepsilon-corridor around f(a)f(a).
(b) We choose δ>0\delta>0 so that the graph of ff over the interval (aδ,a+δ)(a-\delta,a+\delta) lies entirely within the ε\varepsilon-corridor.
Figure 4.10: The ε\varepsilon-δ\delta definition of continuity.

We illustrate the idea behind this definition in Figure 4.10, which shows the graph of a function ff which is continuous at aa. Given ε>0\varepsilon>0, in Figure 4.10(a) we consider the horizontal ‘ε\varepsilon-corridor’ around f(a)f(a): that is, all points (x,y)(x,y) in the plane with yy values satisfying f(a)ε<y<f(a)+εf(a)-\varepsilon<y<f(a)+\varepsilon. We are free to choose ε>0\varepsilon>0 as small as we like, which means we can take the corridor to be as thin as we like. In Figure 4.10(b) we see that, no matter how thin we make the corridor22 2 You may find the applet at https://www.desmos.com/calculator/kycrjq0aqj helpful to see this: it is an interactive version of Figure 4.10(b), where you can use the sliders to vary ε\varepsilon and δ\delta and see the effect this has on the shaded regions., it is always possible choose δ>0\delta>0 such that the graph of ff over the interval (aδ,a+δ)(a-\delta,a+\delta) lies entirely within the corridor. Thus, if |xa|<δ|x-a|<\delta, so that x(aδ,a+δ)x\in(a-\delta,a+\delta), then the point (x,f(x))(x,f(x)) lies in the ε\varepsilon-corridor, which means precisely that |f(x)f(a)|<ε|f(x)-f(a)|<\varepsilon: see Figure 4.11.

We can also compare how the formal definition matches with our intuitive notion of continuity.

ε\varepsilon-δ\delta definition (Definition 4.20) Informal idea (4.3)
For all ε>0\varepsilon>0 For any measure of closeness,
if xIx\in I satisfies |xa|<δ|x-a|<\delta, if xx is near enough to aa,
then |f(x)f(a)|<ε|f(x)-f(a)|<\varepsilon. then f(x)f(x) is close to f(a)f(a).
Figure 4.11: The ε\varepsilon-δ\delta definition of continuity. If |xa|<δ|x-a|<\delta, then (x,f(x))(x,f(x)) lies in the ε\varepsilon-corridor about f(a)f(a) and so |f(x)f(a)|<ε|f(x)-f(a)|<\varepsilon.

Definition 4.20 is very reminiscent of the ε\varepsilon-NN definition of the limit of a sequence. For sequences, the parameter NN is used to describe ‘terms far enough along the sequence’. Here the parameter δ\delta plays a similar role: it is used to describe ‘xx near enough to aa’. For this reason, many of the skills you acquired when working with sequences can be applied to understand continuity of functions.

Example 4.21.

The function p2:p_{2}\colon\mathbb{R}\to\mathbb{R} given by p2(x):=x2p_{2}(x):=x^{2} for all xx\in\mathbb{R} is continuous at 11.

Proof.

For xx\in\mathbb{R}, we have

|p2(x)p2(1)|=|x21|=|x+1||x1|.|p_{2}(x)-p_{2}(1)|=|x^{2}-1|=|x+1||x-1|.

Suppose |x1|<1|x-1|<1. Then, by the triangle inequality,

|x+1|=|x1+2||x1|+2<1+2=3|x+1|=|x-1+2|\leq|x-1|+2<1+2=3

and so

|p2(x)p2(1)|<3|x1|.|p_{2}(x)-p_{2}(1)|<3|x-1|.

Let ε>0\varepsilon>0 be given and set δ:=min{ε/3,1}\delta:=\min\{\varepsilon/3,1\}. If xx\in\mathbb{R} satisfies |x1|<δ|x-1|<\delta, then we certainly have |x1|<1|x-1|<1 and so it follows by our earlier observations that

|p2(x)p2(1)|<3|x1|<3δε.|p_{2}(x)-p_{2}(1)|<3|x-1|<3\delta\leq\varepsilon.

Thus, by the ε\varepsilon-δ\delta definition of continuity, p2p_{2} is continuous at 11. ∎

Example 4.22.

Let g:g\colon\mathbb{R}\to\mathbb{R} be the function from Example 4.1, which is given by

g(x):={xif x<0,xif x0.g(x):=\begin{cases}-x&\text{if $x<0$,}\\ \sqrt{x}&\text{if $x\geq 0$.}\end{cases}

We sketched the graph of gg in Figure 4.5, which shows that there is a rough ‘bend’ at x=0x=0. Nevertheless, we shall prove gg is continuous at 0.

Proof.

Let ε>0\varepsilon>0 be given and choose δ:=min{ε2,ε}\delta:=\min\{\varepsilon^{2},\varepsilon\}. If 0x<δ0\leq x<\delta, then

|g(x)g(0)|=|x0|=x<δε.|g(x)-g(0)|=|\sqrt{x}-0|=\sqrt{x}<\sqrt{\delta}\leq\varepsilon.

On the other hand, if δ<x<0-\delta<x<0, then

|g(x)g(0)|=|x0|=|x|<δε.|g(x)-g(0)|=|-x-0|=|x|<\delta\leq\varepsilon.

Combining these cases, we see that if |x|<δ|x|<\delta, then |g(x)g(0)|<ε|g(x)-g(0)|<\varepsilon. Hence, by the ε\varepsilon-δ\delta definition of continuity, gg is continuous at 0. ∎

Exercise 4.23.

Consider the linear function :\ell\colon\mathbb{R}\to\mathbb{R} given by (x):=5x+6\ell(x):=5x+6 for all xx\in\mathbb{R}. Show that \ell is continuous at 11.

Exercise 4.24.

Consider the function f:f\colon\mathbb{R}\to\mathbb{R} given by f(x):=x3f(x):=x^{3} for all x0x\geq 0 and f(x):=xf(x):=x for x<0x<0. Sketch the graph of ff and show that it is continuous at 0.

So far we have only talked about continuity at a point. We can also define what it means for the entire function to be continuous.

Definition 4.25.

Let II\subseteq\mathbb{R} be an interval and f:If\colon I\to\mathbb{R}. We say ff is continuous if ff is continuous at aa for all aIa\in I. We say ff is discontinuous if it is not continuous.

Example 4.26.

The function p2:p_{2}\colon\mathbb{R}\to\mathbb{R} given by p2(x):=x2p_{2}(x):=x^{2} for all xx\in\mathbb{R} is continuous.

Proof.

Let aa\in\mathbb{R}. For xx\in\mathbb{R}, we have

|p2(x)p2(a)|=|x2a2|=|x+a||xa|.|p_{2}(x)-p_{2}(a)|=|x^{2}-a^{2}|=|x+a||x-a|.

Suppose |xa|<1|x-a|<1. Then, by the triangle inequality,

|x+a|=|xa+2a||xa|+2|a|<1+2|a||x+a|=|x-a+2a|\leq|x-a|+2|a|<1+2|a|

and so

|p2(x)p2(a)|<(1+2|a|)|xa|.|p_{2}(x)-p_{2}(a)|<(1+2|a|)|x-a|.

Let ε>0\varepsilon>0 be given and set δ:=min{ε/(1+2|a|),1}\delta:=\min\{\varepsilon/(1+2|a|),1\}. If xx\in\mathbb{R} satisfies |xa|<δ|x-a|<\delta, then |x1|<1|x-1|<1 and so it follows by our earlier observations that

|p2(x)p2(a)|<(1+2|a|)|xa|<(1+2|a|)δε.|p_{2}(x)-p_{2}(a)|<(1+2|a|)|x-a|<(1+2|a|)\delta\leq\varepsilon.

Thus, by the ε\varepsilon-δ\delta definition of continuity, p2p_{2} is continuous at aa for all aa\in\mathbb{R}, therefore p2p_{2} is continuous. ∎

Exercise 4.27.

Show that the function p3:p_{3}\colon\mathbb{R}\to\mathbb{R} given by p3(x):=x3p_{3}(x):=x^{3} for all xx\in\mathbb{R} is continuous. Hint: x3a3=(xa)(x2+ax+a2)x^{3}-a^{3}=(x-a)(x^{2}+ax+a^{2}).

Exercise 4.28.

Show that the reciprocal function r:(0,)r\colon(0,\infty)\to\mathbb{R} given by r(x):=1/xr(x):=1/x is continuous at every point a(0,)a\in(0,\infty).

It is equally important to be able to show certain functions fail to be continuous. Let II\subseteq\mathbb{R} be an interval, f:If\colon I\to\mathbb{R} and aIa\in I. By negating the definition of continuous at aa, we obtain the following.

The function f:If\colon I\to\mathbb{R} is discontinuous at aa if
(4.4) (4.4) there exists some ε>0\varepsilon>0 such that for all δ>0\delta>0,
there exists some xIx\in I with |xa|<δ|x-a|<\delta such that |f(x)f(a)|ε|f(x)-f(a)|\geq\varepsilon.
Exercise 4.29.

Give an informal explanation of what it means for f:If\colon I\to\mathbb{R} to be discontinuous at aa and match it to the precise definition in (4.4) by filling in the following table.

ε\varepsilon-δ\delta definition (4.4) Informal idea
There exists some ε>0\varepsilon>0
such that for all δ>0\delta>0
there exists some xIx\in I with |xa|<δ|x-a|<\delta
such that |f(x)f(a)|ε|f(x)-f(a)|\geq\varepsilon.
Example 4.30.

Let h:h\colon\mathbb{R}\to\mathbb{R} be the function from Example 4.1, given by

h(x):={x2for x1,x2+1for x>1.h(x):=\begin{cases}x^{2}&\text{for $x\leq 1$,}\\ x^{2}+1&\text{for $x>1$.}\end{cases}

We sketched the graph of hh in Figure 4.5, which shows that there is a ‘jump’ or ‘break’ in the graph at x=1x=1. Consequently, we expect hh fails to be continuous at 11. We prove this is indeed the case. (You may find the applet at https://www.desmos.com/calculator/5lsgjmwbdl helpful to illustrate the proof.)

Proof.

Let ε:=1\varepsilon:=1 and x>1x>1. It follows that

|h(x)h(1)|=|x2+11|=x2>1=ε.|h(x)-h(1)|=|x^{2}+1-1|=x^{2}>1=\varepsilon.

In particular, given any δ>0\delta>0, if we choose x(1,1+δ)x\in(1,1+\delta), then it follows that |x1|<δ|x-1|<\delta and |h(x)h(1)|ε|h(x)-h(1)|\geq\varepsilon. Thus, hh is discontinuous at 11. ∎

Exercise 4.31.

Consider the function f:f\colon\mathbb{R}\to\mathbb{R} given by

f(x):={0if x0,1if x>0,f(x):=\begin{cases}0&\text{if $x\leq 0$,}\\ 1&\text{if $x>0$,}\end{cases}

which is graphed in Figure 4.12. Show that ff is discontinuous at 0.

Figure 4.12: The function f:f\colon\mathbb{R}\to\mathbb{R} as defined in Exercise 4.31.

Trigonometric functions

Here we begin an in-depth study of the familiar trigonometric functions such as sin\sin and cos\cos. Intuitively, from our knowledge of the graphs of these functions we expect them to be continuous. Our goal is to verify that this is indeed the case.

To achieve this goal, we will rely on certain inequalities for trigonometric functions, which can be proved using geometric arguments. Since these inequalities will also be useful later in the course (and in other courses!), we give them their own lemma.

Lemma 4.32 (Trigonometric inequalities).

For all θ(π/2,π/2)\theta\in(-\pi/2,\pi/2) we have

|sinθ||θ||tanθ|and|1cosθ|θ22.|\sin\theta|\leq|\theta|\leq|\tan\theta|\qquad\text{and}\qquad|1-\cos\theta|% \leq\frac{\theta^{2}}{2}.

We shall return to prove these results after achieving our goal of establishing the continuity of sin\sin and cos\cos.

Lemma 4.33.

The functions sin:\sin\colon\mathbb{R}\to\mathbb{R} and cos:\cos\colon\mathbb{R}\to\mathbb{R} are continuous.

Proof.

Since cosθ=sin(θ+π/2)\cos\theta=\sin(\theta+\pi/2) for all θ\theta\in\mathbb{R}, it suffices to show the result for the sine function only.

Let ε>0\varepsilon>0 be given and fix aa\in\mathbb{R}. To establish that sin\sin is continuous at aa, we need to choose δ\delta so that whenever |xa|<δ|x-a|<\delta, we have |sinxsina|<ε|\sin x-\sin a|<\varepsilon. To make progress, we write x=a+(xa)x=a+(x-a) and use the angle summation formulæ:

|sinxsina|\displaystyle|\sin x-\sin a| =|sin(a+(xa))sina|\displaystyle=\left|\sin\left(a+(x-a)\right)-\sin a\right|
=|sina(cos(xa)1)+cosasin(xa)|\displaystyle=\left|\sin a\left(\cos(x-a)-1\right)+\cos a\sin(x-a)\right|
|sina||1cos(xa)|+|cosa||sin(xa)|.\displaystyle\leq\left|\sin a\right|\left|1-\cos(x-a)\right|+|\cos a||\sin(x-a% )|.

Let θ:=xa\theta:=x-a. Since |θ|=|xa|<δ|\theta|=|x-a|<\delta, if we ensure δπ/2\delta\leq\pi/2 then Lemma 4.32 will certainly apply. Thus,

|sinxsina|1θ22+1|θ|2|θ|,|\sin x-\sin a|\leq 1\cdot\frac{\theta^{2}}{2}+1\cdot|\theta|\leq 2|\theta|,

where we have also used the fact that |sina|1|\sin a|\leq 1 and |cosa|1|\cos a|\leq 1.

So, choose δ:=min{ε/2,π/2}\delta:=\min\{\varepsilon/2,\pi/2\}. From the above observations, it follows that if xx\in\mathbb{R} satisfies |xa|<δ|x-a|<\delta, then

|sinxsina|2|θ|<2δε.\displaystyle|\sin x-\sin a|\leq 2|\theta|<2\delta\leq\varepsilon.

Thus, sin\sin is continuous at aa by the ε\varepsilon-δ\delta definition of continuity. Since our choice of aa was arbitrary, we conclude that sin\sin is continuous on \mathbb{R}. ∎

We now return to prove the borrowed Lemma.

Proof (of Lemma 4.32).

Since sin\sin and tan\tan are odd functions and cos\cos is an even function, it suffices to consider the case θ[0,π/2)\theta\in[0,\pi/2). Since the trigonometric functions arise in geometry, our argument is geometric.

We shall prove the inequality sinθθ\sin\theta\leq\theta and leave the remaining inequalities as exercises (see Exercise 4.34 below).

On the one hand, the area of the triangle OABOAB in Figure 4.13(a) is (sinθ)/2(\sin\theta)/2. On the other hand, the area of the sector OABOAB is θ/2\theta/2. Since the sector contains the triangle, (sinθ)/2θ/2(\sin\theta)/2\leq\theta/2 and the result follows. ∎

(a) sinθθ\sin\theta\leq\theta for θ[0,π/2]\theta\in[0,\pi/2].
(b) θtanθ\theta\leq\tan\theta for θ[0,π/2]\theta\in[0,\pi/2].
Figure 4.13: Geometric observations behind the trigonometric inequalities.
Exercise 4.34.

Let θ[0,π/2)\theta\in[0,\pi/2). Complete the proof of Lemma 4.32 as follows.

  1. (i)

    Using Figure 4.13(b), apply a geometric argument to show that |θ||tanθ||\theta|\leq|\tan\theta|.

  2. (ii)

    Use |sinθ||θ||\sin\theta|\leq|\theta| and the double angle formula to show that |1cosθ|θ2/2|1-\cos\theta|\leq\theta^{2}/2.

The exponential and logarithm

We also consider the exponential and natural logarithm functions, introduced in Definition 4.5 and Definition 4.7.

Lemma 4.35.

The functions exp:(0,)\exp\colon\mathbb{R}\to(0,\infty) and log:(0,)\log\colon(0,\infty)\to\mathbb{R} as continuous.

For now will ‘borrow’ this result and leave the proof until later. At the end of this chapter, we shall see that continuity of exp\exp implies continuity of log\log. In the next chapter, we shall show exp\exp is continuous, and therefore complete the proof.

Further examples

Here we present some more ‘exotic’ examples which really push the boundaries of our intuition.

The following example demonstrates a new kind of behaviour which results in a discontinuity: oscillation.

Example 4.36.

Let f:f\colon\mathbb{R}\to\mathbb{R} be defined by

(4.5) (4.5) f(x):={sin(1/x)if x0,0if x=0.f(x):=\begin{cases}\sin(1/x)&\text{if $x\neq 0$,}\\ 0&\text{if $x=0$.}\end{cases}

We recall the graph of ff in Figure 4.14(a). Recall that, for xx close to 0, the function sin(1/x)\sin(1/x) will oscillate very rapidly. In particular, there will be infinitely many ‘peaks’ where f(x)=1f(x)=1. Using this observation, we can show ff is not continuous at 0.

Proof.

Choose ε:=1\varepsilon:=1. For any δ>0\delta>0, there exists some nn\in\mathbb{N} such that 0<xn<δ0<x_{n}<\delta where

xn:=2π(4n+1)satisfies1xn=2πn+π2.x_{n}:=\frac{2}{\pi(4n+1)}\qquad\text{satisfies}\qquad\frac{1}{x_{n}}=2\pi n+% \frac{\pi}{2}.

In particular, by the periodicity of the sin\sin function,

f(xn)=sin(1/xn)=sin(2πn+π/2)=sin(π/2)=1.f(x_{n})=\sin(1/x_{n})=\sin(2\pi n+\pi/2)=\sin(\pi/2)=1.

Thus, |xn0|<δ|x_{n}-0|<\delta and |f(xn)f(0)|=1ε|f(x_{n})-f(0)|=1\geq\varepsilon. Since δ>0\delta>0 was chosen arbitrarily, this shows that ff is not continuous at 0. ∎

(a) f:f\colon\mathbb{R}\to\mathbb{R} defined in (4.5).
(b) g:g\colon\mathbb{R}\to\mathbb{R} defined in (4.6).
Figure 4.14: Highly oscillatory functions.

The next example demonstrates even more extreme oscillatory behaviour.

Example 4.37.

Let χ:\chi_{\mathbb{Q}}\colon\mathbb{R}\to\mathbb{R} be the Dirichlet function from Example 4.3, defined by

χ(x):={1if x,0if x.\chi_{\mathbb{Q}}(x):=\begin{cases}1&\text{if $x\in\mathbb{Q}$,}\\ 0&\text{if $x\in\mathbb{R}\setminus\mathbb{Q}$.}\end{cases}

Then χ\chi_{\mathbb{Q}} is discontinuous at every point aa\in\mathbb{R}.

Proof.

Fix aa\in\mathbb{R}. We will consider the case where aa\in\mathbb{R}\setminus\mathbb{Q} is irrational; the remaining case is left as an exercise (see Exercise 4.38).

Choose ε:=1\varepsilon:=1. For any δ>0\delta>0, by the density of the rationals (see Section 1.6), there exists some xx\in\mathbb{Q} such that 0<|xa|<δ0<|x-a|<\delta. In this case, |χ(x)χ(a)|=|10|=1ε|\chi_{\mathbb{Q}}(x)-\chi_{\mathbb{Q}}(a)|=|1-0|=1\geq\varepsilon. Since δ>0\delta>0 was chosen arbitrarily, this shows that χ\chi_{\mathbb{Q}} is not continuous at aa. ∎

Exercise 4.38.

Let χ:\chi_{\mathbb{Q}}\colon\mathbb{R}\to\mathbb{R} be the function from Example 4.37 and aa\in\mathbb{Q} be a rational point. Show that χ\chi_{\mathbb{Q}} is discontinuous at aa.

Exercise 4.39.

Let g:g\colon\mathbb{R}\to\mathbb{R} be defined by

(4.6) (4.6) g(x):={xsin(1/x)if x0,0if x=0.g(x):=\begin{cases}x\sin(1/x)&\text{if $x\neq 0$,}\\ 0&\text{if $x=0$.}\end{cases}

We sketch the graph of gg in Figure 4.14(b). Is gg continuous at 0?

Exercise 4.40.

Let h:h\colon\mathbb{R}\to\mathbb{R} be defined by

h(x):={xif x,0if x.h(x):=\begin{cases}x&\text{if $x\in\mathbb{Q}$,}\\ 0&\text{if $x\in\mathbb{R}\setminus\mathbb{Q}$.}\end{cases}

Give a rough sketch of the graph of this function. For which values of aa\in\mathbb{R} is hh continuous at aa?