5
Limits and continuity
We want to understand how functions of real variable might behave under small
changes of the variable. Given f : R → R we can ask if as the variable x
gets closer and closer to a fixed value c, does the corresponding function values
f (x) also get closer and closer to some value? We can also consider if f (x)
approaches some value as we take larger and larger values of x. In this chapter
we shall try to recognise limiting behaviour of a function and develop techniques
for calculating limits.
5.1
Limits
Let’s begin by looking at some examples.
Exercise 5.1. Think about features of the function f : R → R given by
f (x) =
0, if x 6= 0,
1
if x = 0.
Example 5.2. Consider f : R → R given by
−1, if x < 0,
f (x) = 0
if x = 0,
1
if x > 0.
As x approaches 0 from the right i.e. through positive values, f (x) will always
take the value
.
.
If x approaches 0 from the left i.e. through negative values,
f (x) will always take the value
.
.
1
x3 − 1
. This is not defined when
x2 − 1
x = 1. Nonetheless, we can consider what happens to the function for values of
Example 5.3. Consider the function f (x) =
x very close to 1.
x
f (x)
1.01000 1.00100 1.00010 1.00001
0.9000 0.9900 0.9990 0.9999
This seems to suggest that f (x) approaches
.
.
.
as x approaches 1 from
the right, or from the left.
Note that x3 − 1 =
.
.
.
.
.
.
Thus if x 6= 1 then we have f (x) =
to see why f (x) approaches
.
.
.
.
.
.
.
.
.
and x2 − 1 =
.
.
.
.
.
.
.,
.
.
.
.
.
which allows us
as x approaches 1.
Algebraically,
x3 − 1
(x − 1)(x2 + x + 1)
=
x2 − 1
(x − 1)(x + 1)
=
x2 + x + 1
,
x+1
provided x 6= 1.
This approaches 3/2 as x approaches 1.
Alternatively, we can write a number close to 1 as 1 + h where h is a non-zero
small number. Then
x3 − 1
(1 + h)3 − 1
=
x2 − 1
(1 + h)2 − 1
=
1 + 3h + 3h2 + h3 − 1
1 + 2h + h2 − 1
=
2
Example 5.4. Consider the function f (x) = |x − π2 |tan x. Then f ( π2 ) is not
defined. But we can consider what happens for values of x close to π2 . Writing
x=
π
2
f ( π2
f ( π2
+ h, we need to consider f (x) as h becomes small.
h
+ h)
− h)
0.1
0.01
0.001
0.0001
−.9966644423 −.9999666664 −.9999996667 −.9999996667 . . .
0.9966644423 0.9999666664 0.9999996667 0.9999996667 . . .
The table above suggests that f (x) approaches −1 as x approaches
right i.e. values larger than
π
.
2
However, when x approaches
π
2
π
2
from the
from the left,
then f (x) approaches 1.
Informal definition of limit. We write limx→c f (x) and say f has limit ` as
x tends to c if the function values f (x) can be made as near to ` as we like by
choosing x close enough to c. Or in very coarse terms, f (x) approaches ` as x
approaches c.
One sided limits are obtained by restricting the way x approaches c. If f (x)
approaches the value ` as x approaches c from the right i.e. through values of x >
c, then we say that the right hand limit of f at c is ` and write limx→c+ f (x) = `.
Similarly for the left hand limit: limx→c− f (x) = ` means f (x) approaches the
value ` as x approaches c from the left i.e. through values of x < c.
Remark. x → c is shorthand x approaches c. So limx→c f (x) = ` is shorthand
for f (x) → ` as x → c. Here are two ways of making the definition we gave
more precise.
(i) Numerically, we can choose a sequence x1 , x2 , . . ., all different from c, approximating c. We then want the sequence f (xn ) to approach `. This
should be independent of which sequence x1 , x2 , . . . we choose to approximate c. If you are happy with the idea of a sequence (xn ) going to a limit,
3
then: limx→c f (x) = ` means for every sequence xn → c with xn 6= c we
have f (xn ) → `.
Similarly, limx→c+ f (x) = ` (respectively limx→c− f (x) = `) means the
sequence f (xn ) gets closer and closer to ` whenever (xn ) is a sequence
approaching c from the right (respectively from the left) i.e. xn > c
(respectively xn < c) for all n.
(ii) Suppose limx→c f (x) = `. Then f (x) must be within, lets say, 0.0000000001
of ` when x is sufficiently close to c. This means that there must some
number d such that if x is within d of c then f (x) is within 0.0000000001
of `.
Of course we will need to approximate better than within 0.0000000001—
we should be able to approximate to within any degree by making x close
enough to c without actually being c. So whenever we choose a degree of
approximation ε > 0 we have to be able to produce a number δ > 0 which
will determine how close to c we need x to be i.e. |f (x) − `| < ε for all x
such that 0 < |x − c| < δ.
The following observation is specially useful when we have a function defined by
different formulae on either side of c.
Proposition 5.5. limx→c f (x) = ` if and only if limx→c+ f (x) = ` = limx→c− f (x).
Example 5.6.
(i) For the function f : R → R considered in Example 5.2, we have limx→0+ f (x) =
.
.
.
and limx→0− f (x) =
So limx→0 f (x)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
x3 − 1
(ii) For the function f (x) = 2
from Example 5.3, we have limx→0+ f (x) =
x −1
4
.
.
.
and limx→0− f (x) =
.
.
So limx→0 f (x)
.
.
.
.
.
.
.
What is a good choice to take for defining f (1)?
(iii) For the function f (x) = (x− π2 ) tan x from Example 5.4, we have limx→ π + f (x) =
2
.
.
.
and limx→ π − f (x) =
.
2
.
So lim
x→ π2
.
f (x)
.
.
.
.
.
.
Limits at infinity
Consider the function
1
. What happens when x becomes larger and larger?
x
Answer:
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Informal definitions. We say that f has limit ` as x tends to ∞ and write
limx→∞ f (x) = ` if f (x) can be made arbitrarily to ` provided x is sufficiently
large enough. Or even less precisely, f (x) approaches the value ` as x becomes
larger and larger.
Similarly, limx→−∞ f (x) = ` means we can make f (x) arbitrarily close to `
provided we choose x far enough left on the number line.
Example 5.7. Consider f (x) = exp(x) = ex . We can make ex arbitrarily close
to 0 by moving x far enough to the left. Thus limx→−∞ ex = 0, or alternatively
ex → 0 as x → −∞. It is very important to understand that ex never actually
reaches 0. It just gets closer and closer.
Note 5.8. We can turn considerations of limit at ∞ into a problem of looking
at one sided limits at 0. More precisely, we have
lim f (x) = lim+ f (1/x) and
x→∞
x→0
lim f (x) = lim− f (1/x).
x→−∞
x→0
These observations are sometimes are useful in calculations.
5
5.2
Continuity
It is essential that we remember the calculation of limx→c f (x) does not require
f to have a value at x = c. Even if f (c) is defined, we completely ignore
it. Furthermore, there is no reason why the limit—if it exists—should be the
function value (even when the function value is defined). BUT it is very nice
when they match, and we give it a name.
Definition 5.9. The function f is continuous at c if limx→c f (x) = f (c).
We say that c is a point of discontinuity if f is not continuous at c.
We say that the function f is continuous on a subset S of the domain of f if f is
continuous at every point in S. A continuous function is one which is continuous
at every point in its domain.
Remark. Geometrically, continuity at a point sort of means that the graph
doesn’t have a break at that point. In fact, we will use this as a working test for
continuity.
(i) If we can clearly draw the graph of f around c without a break, then f is
continuous at c.
This makes clear that most of the functions that appear commonly are
continuous, as can be seen from their graphs. For example: x, x2 , polynomials in x, sin x, cos x are all continuous on R. All trigonometric functions
and any reasonable combination of these functions are continuous (not on
the whole of R, only in their domain!).
(ii) At problem points, use the limit definition. Typically the function will be
defined by different formulae on either side. We will then need to calculate
left and right hand limits separately, check if they are the same and equal
to the function value.
6
Remark. If the domain of a function is a closed interval then, naturally, only
one sided limits are considered at the end points. Thus saying that a function
f : [a, b] → R is continuous means
• at all intermediate points a < c < b we have limx→c f (x) = f (c), and
• at the end points, we have limx→a+ f (x) = f (a) and limx→b− f (x) = f (b).
Example 5.10. Consider the following function from Example 5.2.
−1, if x < 0,
f (x) = 0
if x = 0,
1
if x > 0.
We have limx→0+ f (x) = 1 and limx→0− f (x) = −1. Thus f does not even
have a limit at 0 and therefore f is not continuous at 0.
Example 5.11. Consider the functions
3
x − 1 , if x 6= 1
2
f (x) = x − 1
3/2,
if x = 1
Then limx→1 f (x) =
So f (x) is
.
.
.
.
.
.
.
.
.
and
.
.
3
x − 1 , if x 6= 1
2
g(x) = x − 1
1,
if x = 1.
.
.
.
.
.
.
.
So g(x) is
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
at x = 1.
On the other hand, limx→1 g(x) =
.
.
.
.
.
.
at x = 1.
.
.
.
Example 5.12. Consider f (x) = sin(1/x). This is defined as long as x 6= 0.
We should be able to sketch its graph for away from 0. Thus if c 6= 0, then
7
we know then limx→c sin(1/x) = sin(1/c); so f is continuous on R \ {0}. See
Figure 1 for the graph of sin x1 .
Figure 1: Graph of sin x1
But what happens when x → 0? From the graph, we can see that we can f (x)
is not going to approach a particular value as x → 0. So limx→0 f (x) does not
exist, and we will never be able to extend f to a continuous function on the
whole of R.
5.3
Limit operations
Here is a collection of basic rules for manipulating limits. We have already used
some of these in examples without really thinking about them. We shall continue
to do so. (Just have a quick check to see if what you are about to conclude
looks reasonable!)
8
Assume limx→a f (x) and limx→a g(x) exist.
• Addition Rule. limx→a (f (x) + g(x)) = limx→a f (x) + limx→a g(x).
• Constant Rule. For c a constant, limx→a c f (x) = c limx→a f (x).
• Subtraction Rule. limx→a f (x) − g(x) = limx→a f (x) − limx→a g(x).
• Multiplication Rule. limx→a f (x)g(x) = limx→a f (x) limx→a g(x).
• Division Rule. If limx→a g(x) 6= 0 then limx→a
f (x)
limx→a f (x)
=
.
g(x)
limx→a g(x)
• Composition Rule. If f is continuous at b and limx→a g(x) = b, then
limx→a f (g(x)) = f (b) = f (limx→a g(x)).
• Sandwich Rule. Suppose that g(x) 6 f (x) 6 h(x) for all x in some
open interval containing c (except possibly at x = c).
If limx→c g(x) = limx→c h(x) = L, then also limx→c f (x) = L.
Note 5.13. Similar rules hold for limits at ±∞ and for one-sided limits, and you
are strongly encouraged to write these out explicitly. We shall use these limit
rules freely if and when needed.
Exercise 5.14. Calculate the following limits.
x2 + 1
;
x→∞
x2
3x2 − 5x − 1
lim
;
x→∞
x2 + 1
3x2 + 5x − 1
;
x→∞
x2
2
3x − 5x − 1
lim ln
.
x→∞
x2 + 1
lim
lim
9
The rules imply the following results for continuity of functions.
Theorem 5.15.
• If f (x) and g(x) are continuous at a then f (x) ± g(x), f (x)g(x), and
f (x)/g(x) (provided g(a) 6= 0) are all continuous at a.
• If f is continuous at g(a) and g is continuous at a then the composite
f (g(x)) is continuous at a.
Thus the sum, difference, product, quotient (provided the denominator is nonzero) and composite of two continuous functions is again continuous.
More examples of limit calculations.
Example 5.16. Let’s find limx→1
x3 + x − 2
.
x2 + 2x − 3
The function appearing in the limit is not defined at x = 1 (because both
numerator and denominator are zero). Consideration of numerical values close
to 1 suggests that the limit is
.
.
.
.
.
.
.
Let’s see if we can check this. If we write x = 1 + h then calculating the limit as
x → 1 is the same as calculating the limit when h → 0. (This is quite a useful
trick!) So
x3 + x − 2
(1 + h)3 + 1 + h − 2
=
lim
x→1 x2 + 2x − 3
h→0 (1 + h)2 + 2(1 + h) − 3
lim
=
10
Example 5.17. To find the limit as x → ±∞ of a rational function in x, we can
try to cancel off the leading powers of x from the numerator and denominator.
Or equivalently, we can sub x = 1/h and calculate limit as h → 0+ or h → 0− .
For an illustration, let’s calculate limx→∞
x2 + 1
.
3x2 + x + 7
1
2
x
1
+
x +1
x2 lim
=
lim
1
7
x→∞ 3x2 + x + 7
x→∞ 2
x 3+ + 2
x x
2
=
Alternatively, use the substitution x =
limx→∞
1
:
h
x2 + 1
=
3x2 + x + 7
Example 5.18. Find a, b so that the function f below is continuous everywhere.
2
x −4
,
if x < 2
x−2
f (x) = ax2 − bx + 3, if 2 ≤ x < 3
2x − a + b,
if x ≥ 3.
11
Solution. Clearly the function is continuous on
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
and the points where we have to consider carefully are
.
.
.
.
.
.
.
.
For continuity at 2 we need to check that limx→2− f (x) = limx→2+ f (x) = f (2).
For continuity at 3
1
x
. From its graph (see Figure 2), it is
clear that f is continuous away from 0. Further, it looks like limx→0 x sin x1 =
Example 5.19. Consider f (x) = x sin
0.
We will now use the sandwich rule to calculate one sided limits at 0.
12
Figure 2: Graph of x sin x1
Since −1 6 sin
1
x
6 1, we have −x 6 x sin
1
x
6 x for x > 0. But
lim (−x) = 0 = lim+ x.
x→0+
x→0
So, by the sandwich rule, limx→0+ x sin
For x < 0, x 6 x sin
So limx→0 x sin
5.4
1
x
1
x
1
x
= 0.
6 −x, so similarly limx→0− x sin
1
x
= 0.
= 0.
sin x
x→0 x
The limit lim
We can tabulate outputs from plugging in values of x close to 0 to get an
approximation of the limit. As (sin x)/x is even, we only consider small positive
13
values of x.
x
sin x/x
0.1
0.01
0.001
0.0001
0.99833416 0.99998333 0.99999983 0.99999999
From the table, it looks like the limit is 1 and that sin x ≈ x when x is small.
Theorem 5.20. lim
x→0
sin x
= 1.
x
Let’s see why this might be true.
This gives
1 − cos h
1
= . Thus cos h ≈ 1 − 21 h2 for small h.
2
h→0
h
2
Corollary 5.21. lim
2 sin2
1 − cos h
Proof.
=
h2
h2
h
2
sin h 2
= 2 h 2 → 2 as h → 0.
2
14
5.5
Two important properties of continuous functions
Example 5.22. We’d have seen the following type of argument: the equation
x3 +x−1 = 0 has a root/solution in the range 0 < x < 1 because 03 +0−1 < 0
and 13 + 1 − 1 > 0. One way of supporting this argument is to say that the
graph of y = x3 + x − 1 is below the x-axis at 0 and above the x-axis at 1, and
so it must cut the x-axis somewhere as there are no breaks in the graph.
This can be rephrased as follows: The function f (x) = x3 + x − 1 is continuous
on whole of R. We have f (0) < 0 and f (1) > 0. Then continuity on [0, 1]
implies f (c) = 0 for some 0 < c < 1.
Theorem 5.23. The Intermediate Value Theorem (IVT). Let f be a continuous function on the closed interval [a, b]. Suppose ` is any number between
f (a) and f (b), where f (a) 6= f (b). Then there exists c ∈ (a, b) such that
f (c) = `.
Informally, a continuous function on a closed interval takes every possible intermediate value.
Remark. The theorem is intuitively clear when we think of continuous functions
as unbroken graphs. Proving it properly needs a good amount of work though.
Here’s a sketch of an idea.
Suppose we have a continuous function f : [0, 1] → R with f (0) negative, f (1)
positive, and we want find 0 < c < 1 such that f (c) = 0. Start by trying f ( 12 ).
If this is 0 we are done. If it is non-zero, then it will be either positive or negative.
Let’s suppose it is negative. Then f ( 12 ) < 0 and f (1) > 0. So we try their
mid-point 34 . If f ( 34 ) = 0 we are done, but if it is not zero then we can repeat
the process. At every step the search for a possible root happens over an interval
15
half the length of the preceding interval. So in the limit, we will get a point
c ∈ (0, 1) with f (c) = 0.
Exercise 5.24. Let f : [0, 1] → [0, 1] be a continuous function. Show that
f (c) = c for some c ∈ [0, 1].
Solution. We turn this into a problem of finding roots. We assume f (0) 6= 0
and f (1) 6= 1, for otherwise we can take c to be 0 or 1.
Now consider the function g : [0, 1] → R given by g(x) := f (x) − x. This is
continuous on [0, 1]. Because f (x) ∈ [0, 1], we obtain g(0) = f (0) − 0 > 0 and
g(1) = f (1) − 1 < 0. By IVT we can find 0 < c < 1 such that g(c) = 0 i.e.
f (c) = c.
The second property of continuous functions on closed intervals we want to state
concerns the existence of maximum and minimum.
Theorem 5.25. The Extreme Value Theorem (EVT). Let f be a continuous
function on the closed interval [a, b]. Then the function f (or the graph of f , if
you prefer) attains a maximum and minimum in [a, b]. That is,
• maximum: there is a point c ∈ [a, b] such that f (x) ≤ f (c) for all
a ≤ x ≤ b;
• minimum: there is a point d ∈ [a, b] such that f (d) ≤ f (x) for all
a ≤ x ≤ b.
16
© Copyright 2026 Paperzz