Continuity on an interval
Continuity at a point checks one input at a time and needs inputs on both sides. What does it mean for a function to be continuous across a whole stretch of inputs, including the ends of that stretch, and which familiar functions pass that test everywhere they are defined?
Where you are 5 in Continuity
Why this exists
Continuity at a point asks whether the limit at a exists and equals f(a), one input at a time. The intermediate value theorem and the The extreme value theorem ask for more: continuity at every input of an interval, most often a closed interval [a, b], ends included.
The ends cause the trouble. The function \displaystyle \sqrt{x} is defined only for x \ge 0, so at 0 there are no inputs to the left, \displaystyle \lim_{x \to 0} \sqrt{x} does not exist, and continuity at a point cannot be applied. Yet the graph starts at the origin and leaves it without a break. This lesson adds one-sided continuity to handle ends, defines continuity on every kind of interval, and lists the familiar functions that are continuous wherever they are defined, with the ways of combining them that keep continuity.
Definition
A function is continuous from the right at a when
and continuous from the left at a when
Each carries three conditions, as before: f(a) is defined, the one-sided limit exists, and the two are equal.
Let a < b.
- f is continuous on the open interval (a, b) when it is continuous at every number in (a, b). The same wording covers (a, \infty), (-\infty, b) and (-\infty, \infty).
- f is continuous on the closed interval [a, b] when it is continuous on (a, b), continuous from the right at a, and continuous from the left at b.
- f is continuous on [a, b) when it is continuous on (a, b) and from the right at a; on (a, b] when it is continuous on (a, b) and from the left at b. Rays such as [a, \infty) have one end to check.
So: two-sided continuity inside, one-sided continuity at each end the interval includes. The interval is part of the statement, and a function can be continuous on one interval and not on a larger one.
When a function is called continuous with no interval named, it means continuous at every number in its domain, one-sided at any end of the domain. That is weaker than continuity on an interval, because a domain can have gaps (Example 5).
Intuition
At an end of an interval only one side counts. The interval is the whole world the function is being asked about, and what happens outside it is ignored. Figure 1 shows \displaystyle y = \sqrt{25 - x^2}, which exists only from -5 to 5. At 5 the graph arrives from the left and lands on its own endpoint; continuity from the left says it lands where it was heading.
A one-sided condition can also hold in the middle of a domain. In Figure 2, the floor function \lfloor x \rfloor gives each integer to the step on its right, so the right side lands on the value and the left side does not. Whether \lfloor x \rfloor is continuous on an interval then depends on which ends the interval includes.
Results
Two sides make one. f is continuous at a exactly when it is continuous from the left and from the right at a.
The familiar functions are continuous on their domains.
| Function | Continuous on | Here |
|---|---|---|
| polynomials | (-\infty, \infty) | proved |
| rational functions \dfrac{p(x)}{q(x)} | every interval where q(x) \ne 0 | proved |
| \lvert x \rvert | (-\infty, \infty) | proved |
| \displaystyle \sqrt[n]{x}, n even | [0, \infty) | stated |
| \displaystyle \sqrt[n]{x}, n odd | (-\infty, \infty) | stated |
| b^x, b > 0, including e^x | (-\infty, \infty) | stated |
| \ln x, and \log_b x for b > 0, b \ne 1 | (0, \infty) | stated |
| \sin x, \cos x | (-\infty, \infty) | stated |
Combinations on an interval. If f and g are continuous on an interval I and k is a constant, then f + g, f - g, k f and f g are continuous on I, and \dfrac{f}{g} is continuous on every interval inside I where g is never 0. The same holds one-sidedly at a point: if f and g are continuous from the right at a, so are f \pm g, k f, f g, and \dfrac{f}{g} when g(a) \ne 0.
Compositions on an interval. If g is continuous on an interval I, every value g(x) for x in I lies in an interval J, and f is continuous on J, then f\big(g(x)\big) is continuous on I.
The consequence used every day. A function built from the table’s functions by adding, subtracting, multiplying, dividing and composing is continuous on every interval contained in its domain.
Why it is true
Two sides make one. By One sided limits and when a limit exists, \lim_{x \to a} f(x) = f(a) holds exactly when both one-sided limits exist and equal f(a).
Combinations. Inside I the results of Continuity at a point apply as they stand. At an end the proofs are the same with one-sided limits, since the sum, difference, constant multiple, product and quotient laws hold for one-sided limits too: if \lim_{x \to a^+} f(x) = f(a) and \lim_{x \to a^+} g(x) = g(a), the sum law gives \lim_{x \to a^+} \big[f(x) + g(x)\big] = f(a) + g(a).
Compositions (a sketch). As x approaches a number c of I through I, the inner values g(x) approach g(c) while staying in J, and since f is continuous on J the outputs f\big(g(x)\big) approach f\big(g(c)\big). A complete proof makes “approach” exact with the The epsilon delta definition of a limit.
The proved rows. Polynomials and rational functions were handled in Continuity at a point. For \lvert x \rvert: it is x for x \ge 0 and -x for x < 0, and at 0 both one-sided limits are 0 = \lvert 0 \rvert.
The stated rows are not proved here; each proof depends on how the function is defined. For sine and cosine it uses unit-circle geometry and a squeeze, as in The squeeze theorem and the limit of sine x over x; for roots and logarithms, a theorem that the inverse of a continuous increasing function is continuous. Given sine and cosine, \tan x = \dfrac{\sin x}{\cos x} is continuous wherever \cos x \ne 0 by the quotient result.
Worked examples
Dilnur’s half circle
Dilnur works with \displaystyle f(x) = \sqrt{25 - x^2}. Find its domain and show that f is continuous on all of it.
SolutionThe square root needs 25 - x^2 \ge 0, so the domain is [-5, 5]. Continuity there asks for continuity inside, from the left at 5, and from the right at -5.
Inside, for -5 < a < 5, the polynomial 25 - x^2 is continuous at a with a positive value, and the square root is continuous at positive numbers, so the composition result makes f continuous at a.
At 5: as x \to 5^-, the inner values approach 0 and stay in [0, \infty), where the square root is continuous, so
A table agrees: f(4.99) \approx 0.316 and f(4.9999) \approx 0.0316. The same argument gives continuity from the right at -5, where f(-5) = 0.
So f is continuous on [-5, 5] (Figure 1). It is not continuous at 5 in the two-sided sense, since there are no inputs to the right, but continuity on [-5, 5] never asks for that.
Aylin’s steps
The floor function \lfloor x \rfloor is the greatest integer less than or equal to x. Aylin asks whether it is continuous on [1, 2), on [1, 2], and on (1, 2].
SolutionBetween consecutive integers n < a < n + 1 the function is the constant n, so it is continuous at every non-integer, in particular on (1, 2).
At an integer n the value is n, and One sided limits and when a limit exists found the one-sided limits there: n from the right and n - 1 from the left. So \lfloor x \rfloor is continuous from the right at every integer and not continuous from the left.
- On [1, 2) the only included end is 1, which needs continuity from the right, and has it. Continuous.
- On [1, 2] the end 2 needs continuity from the left, and the left-hand limit is 1, the value is 2. Not continuous.
- On (1, 2] the same failure at 2 decides it. Not continuous.
In general \lfloor x \rfloor is continuous on [n, n + 1) for every integer n, and on no interval containing an integer except as its left end.
Rasul’s logarithm over a line
On which intervals is q(x) = \dfrac{\ln(2x - 3)}{x - 4} continuous? Use the answer to find \lim_{x \to 2} q(x).
SolutionThe top composes \ln u, continuous on (0, \infty), with the polynomial 2x - 3, whose values lie in (0, \infty) exactly when \displaystyle x > \frac{3}{2}. So the top is continuous on \displaystyle \left(\frac{3}{2}, \infty\right). The bottom is 0 only at 4. By the quotient result, the largest intervals of continuity are
The end \displaystyle \frac{3}{2} cannot be added, since \displaystyle q\left(\frac{3}{2}\right) would need \ln 0. Since 2 lies in \displaystyle \left(\frac{3}{2}, 4\right), the limit is the value:
Two terms, two kinds of end
Let \displaystyle F(x) = \sqrt{x - 1} + \dfrac{e^x}{x - 5}. Find the largest intervals on which F is continuous, and check the left end directly.
SolutionThe first term is continuous on [1, \infty), a square root of a polynomial whose values there lie in [0, \infty). The second, e^x over x - 5, is continuous on every interval avoiding 5. The sum result gives
At 1 the terms are continuous in different ways: the first only from the right, the second in the two-sided sense, and so from the right too. The one-sided sum result needs only continuity from the right in each term:
At 5, F is not defined, so neither interval extends past it.
A sign change with no zero
Let r(x) = \dfrac{3x}{x^2 - 4}. Show that r is continuous on its domain. Compare r(1) with r(3), and r(-1) with r(1), and say what the intermediate value theorem does and does not promise.
Solutionr is rational with bottom (x - 2)(x + 2), zero only at \pm 2, so r is continuous at every number of its domain: in the no-interval sense it is a continuous function. Its largest intervals of continuity are (-\infty, -2), (-2, 2) and (2, \infty).
Now \displaystyle r(1) = \frac{3}{1 - 4} = -1 and \displaystyle r(3) = \frac{9}{9 - 4} = \frac{9}{5} have opposite signs, yet the top 3x is 0 only at 0, so r has no zero in [1, 3]. No contradiction: the theorem needs continuity on [1, 3], and r is not defined at 2, inside it.
On [-1, 1], which lies inside (-2, 2), the theorem applies. With \displaystyle r(-1) = \frac{-3}{1 - 4} = 1 and r(1) = -1, it promises a zero between -1 and 1, and there is one, at 0.
Joining two closed intervals
Suppose f is continuous on [a, b] and on [b, c]. Show that f is continuous on [a, c]. Then show that \displaystyle g(x) = \sqrt{x} for 0 \le x \le 4, g(x) = 6 - x for 4 < x \le 6, is continuous on [0, 6].
SolutionA number strictly inside [a, b] or [b, c] is covered by that interval. Continuity from the right at a comes from [a, b], and from the left at c from [b, c]. At b, the interval [a, c] needs two-sided continuity: [a, b] supplies continuity from the left at b and [b, c] supplies it from the right, so by the two-sides result f is continuous at b.
For g: on [0, 4], \displaystyle g(x) = \sqrt{x}, continuous on [0, \infty). On [4, 6], g equals 6 - x at every input, including 4, since \displaystyle g(4) = \sqrt{4} = 2 = 6 - 4, and a polynomial is continuous on [4, 6]. Joining gives continuity on [0, 6].
Both intervals must include the shared point. The floor function is continuous on [1, 2) and on [2, 3) but not on [1, 3): [1, 2) leaves out 2, so it says nothing about the left side there. Choosing a constant so two pieces join this way is Making a piecewise function continuous.
Boundaries
- One-sided continuity counts only at an end of the interval. Inside, two-sided continuity is required: \lfloor x \rfloor is continuous from the right at 2 but not continuous on [1, 3].
- A closed interval needs its ends in the domain and the one-sided conditions there. Being continuous on (a, b) and defined at a and b is not enough (Exercise 21).
- Continuous on its domain is not continuous on an interval. A gap in the domain allows a sign change with no zero (Example 5). Theorems built on continuity name an interval.
- The quotient result needs a bottom never 0 on the interval; the composition result needs the inner values inside an interval where the outer function is continuous.
- Rows marked stated are not proved here. Their proofs depend on how those functions are defined.
- Continuity says nothing about smoothness. \lvert x \rvert is continuous everywhere despite its corner at 0; see Differentiability: corners, cusps and piecewise functions.
Where this goes next
Continuity on a closed interval is the hypothesis of the intermediate value theorem, which says such a function takes every height between its end values, and of the The extreme value theorem, which says it reaches a highest and a lowest value. Places where continuity fails are sorted into kinds in Discontinuities and how to remove them, and Example 6 is the tool behind Making a piecewise function continuous. The informal picture of an unbroken graph is in Continuous graphs, jumps and holes.
Exercises
One-sided continuity
- Is \displaystyle f(x) = \sqrt{x - 2} continuous from the right at 2? From the left?
- Is \displaystyle g(x) = \sqrt{3 - x} continuous from the right at 3? From the left?
- Let h(x) = x^2 for x \le 1 and h(x) = 3 - x for x > 1. Is h continuous from the left at 1? From the right?
- Let m(x) = \dfrac{x^2 - 2x}{\lvert x - 2 \rvert} for x \ne 2, and m(2) = -2. Is m continuous from the left at 2? From the right?
Continuity on an interval
- Is \displaystyle \sqrt{x + 4} continuous on [-4, \infty)? On [-5, 0]?
- The ceiling \lceil x \rceil is the smallest integer greater than or equal to x. On which of [2, 3), (2, 3] and [2, 3] is it continuous?
- Is \dfrac{1}{x} continuous on (0, \infty)? On [-1, 1]? On [1, 5]?
- Find the largest intervals on which \dfrac{x - 1}{x^2 - 5x + 6} is continuous. Is it continuous on [-1, 1]?
- Find the largest intervals on which \displaystyle \sqrt{x^2 - 9} is continuous, and say which one-sided condition holds at each end.
- On which interval is \ln(5 - x) continuous?
The familiar functions and their combinations
- Explain why e^x \cos x - x^3 is continuous on (-\infty, \infty).
- Is \tan x continuous on \displaystyle \left[0, \frac{\pi}{2}\right)? On [0, \pi]?
- Find the largest intervals on which \dfrac{\ln x}{x - 2} is continuous.
- Find the largest interval on which \displaystyle \sqrt{x} + \ln(4 - x) is continuous, and its value at the left end.
- Find the largest interval on which \displaystyle \sqrt{\ln x} is continuous, and say what happens at its left end.
- Use continuity to find \lim_{x \to 3} \ln(x^2 - 5).
- On which intervals inside [0, \pi] is \dfrac{1}{1 - 2\cos x} continuous? Is it continuous on [0, \pi]?
Reasoning
- Aylin says \dfrac{1}{x - 3} is a continuous function. Rasul says it is not continuous on [2, 4]. Explain why both are right.
- Give a function that is continuous on [0, 1) and on [1, 2] but not on [0, 2].
- Prove that if f and g are both continuous from the right at a, then so is f + g.
- Rasul says: “If f is continuous on (a, b) and f(a) and f(b) are defined, then f is continuous on [a, b].” Give a counterexample.
Answers
- From the right, yes: \displaystyle \lim_{x \to 2^+} \sqrt{x - 2} = 0 = f(2). From the left, no: f is not defined left of 2.
- From the left, yes: \displaystyle \lim_{x \to 3^-} \sqrt{3 - x} = 0 = g(3). From the right, no: g is not defined for x > 3.
- From the left, yes: \lim_{x \to 1^-} x^2 = 1 = h(1). From the right, no: \lim_{x \to 1^+} (3 - x) = 2 \ne 1.
- From the left, yes; from the right, no. For x < 2, \displaystyle m(x) = \frac{x(x - 2)}{-(x - 2)} = -x \to -2 = m(2). For x > 2, \displaystyle m(x) = \frac{x(x - 2)}{x - 2} = x \to 2, and 2 \ne -2.
- Yes on [-4, \infty): x + 4 \ge 0 there and \displaystyle \lim_{x \to -4^+} \sqrt{x + 4} = 0, the value. No on [-5, 0]: the function is not defined at -5.
- Only on (2, 3], where the ceiling is the constant 3 and \lceil 3 \rceil = 3 matches the left-hand limit. The end 2 spoils the others: \lceil 2 \rceil = 2 but the right-hand limit is 3.
- Yes on (0, \infty); no on [-1, 1], which contains 0; yes on [1, 5].
- The bottom is (x - 2)(x - 3): (-\infty, 2), (2, 3) and (3, \infty). Yes on [-1, 1], inside (-\infty, 2).
- The domain is x \le -3 or x \ge 3: continuous on (-\infty, -3], from the left at -3, and on [3, \infty), from the right at 3; both one-sided limits are 0, the value.
- On (-\infty, 5), where 5 - x > 0.
- e^x and \cos x are continuous everywhere, so their product is; x^3 is a polynomial; a difference of continuous functions is continuous.
- Yes on \displaystyle \left[0, \frac{\pi}{2}\right), where \cos x \ne 0; at 0 it is continuous, so from the right. No on [0, \pi]: \displaystyle \cos \frac{\pi}{2} = 0, so \tan x is undefined at \displaystyle \frac{\pi}{2}.
- (0, 2) and (2, \infty): \ln x needs x > 0, and the bottom is 0 at 2.
- [0, 4), from x \ge 0 and 4 - x > 0. At 0, \displaystyle \sqrt{x} is continuous from the right and \ln(4 - x) is continuous, so the sum is continuous from the right, with value 0 + \ln 4 = \ln 4.
- [1, \infty), where \ln x \ge 0. At 1, \displaystyle \lim_{x \to 1^+} \sqrt{\ln x} = \sqrt{0} = 0, the value, so it is continuous from the right; for 0 < x < 1 it is undefined.
- \ln 4: the inner x^2 - 5 is continuous with value 4 > 0 at 3, and \ln is continuous at 4.
- The bottom is 0 when \displaystyle \cos x = \frac{1}{2}, in [0, \pi] only at \displaystyle x = \frac{\pi}{3}. Continuous on \displaystyle \left[0, \frac{\pi}{3}\right) and \displaystyle \left(\frac{\pi}{3}, \pi\right]; not on [0, \pi].
- With no interval named, continuous means continuous at every number of the domain, and this rational function is, its domain being x \ne 3. But [2, 4] contains 3, where it is undefined.
- One answer: f(x) = 0 for x < 1, f(x) = 1 for x \ge 1. It is constant on each interval, with f(1) = 1, but \lim_{x \to 1^-} f(x) = 0 \ne 1, so it is not continuous at 1.
- Both one-sided limits exist, \lim_{x \to a^+} f(x) = f(a) and \lim_{x \to a^+} g(x) = g(a), so the one-sided sum law gives \lim_{x \to a^+} \big[f(x) + g(x)\big] = f(a) + g(a), the value of f + g at a.
- One answer: f(x) = x for 0 < x \le 1 and f(0) = 5. It is continuous on (0, 1) and defined at both ends, but \lim_{x \to 0^+} f(x) = 0 \ne 5.