Continuity

In calculus, we mostly study continuous functions. Intuitively, a function is continuous if its graph can be drawn without lifting your pencil from the paper. In this section, we provide the formal mathematical definition of continuity and classify types of discontinuities.

Quick Reference

Concept Mathematical Condition Description
Continuity at a Point lim x a f ( x ) = f ( a ) f ( a ) exists, limit as x a exists, and they are equal.
One-Sided Continuity lim x a + f ( x ) = f ( a ) (Right), lim x a f ( x ) = f ( a ) (Left) Continuous from right or left at a boundary point.
Continuity on ( a , b ) lim x c f ( x ) = f ( c ) for all c ( a , b ) Continuous at every point in the open interval.
Continuity on [ a , b ] Continuous on ( a , b ) , lim x a + f ( x ) = f ( a ) , lim x b f ( x ) = f ( b ) Continuous on ( a , b ) , right-continuous at a , and left-continuous at b .
Removable Discontinuity lim x a f ( x ) = L exists, but f ( a ) L or f ( a ) is undefined A single "hole" in the graph.
Jump Discontinuity Both one-sided limits exist, but lim x a f ( x ) lim x a + f ( x ) Graph jumps vertically at x = a .
Infinite Discontinuity At least one one-sided limit is ± Vertical asymptote at x = a .
Oscillating Discontinuity Limit fails to exist due to infinite oscillations near a Example: sin ( 1 / x ) near x = 0 .


Consider a function f whose graph is shown below. We can intuitively say that f is discontinuous at x = 3 , 1 , 3 , and 6 , and is continuous at any other points; we don't have to lift the pen to draw the graph of f except when x = 3 , 1 , 3 , 6 .

The function f is not continuous at x = -3, -1, 3 and 6
The function f is not continuous at x = 3 , 1 , 3 and 6 .

Continuity at a Point

Here is the definition of continuity:

Definition of Continuity: The function f is continuous at a if:

  1. f is defined at a, and
  2. lim x a f ( x ) = f ( a ) .

It follows from the above definition that when the function f is continuous at a then:

  1. f ( a ) exists,
  2. lim x a f ( x ) exists,
  3. lim x a f ( x ) is equal to the value of f at a.

If any of these three conditions is not met, then f is discontinuous at a.

Right and Left Continuity; Continuity on an Interval

  • Right and Left Continuity: Let's go back to the figure above. We can say that f is left-continuous (or is continuous from the left) at x = 1 as lim x 1 f ( x ) = f ( 1 ) . Similarly, we say that f is right-continuous (or is continuous from the right) at x = 5 as lim x 5 + f ( x ) = f ( 5 ) .
  • Continuity at an Endpoint: Since two-sided limits do not exist at the endpoints, continuity at an endpoint always means one-sided continuity. So instead of saying that f is right-continuous at x = 5 , we simply may say that f is continuous at x = 5 .
  • Continuity on an Interval: We say that f is continuous on an open interval ( a , b ) if it is continuous at every point x in this interval. Continuity on the closed interval [ a , b ] means that f is continuous on ( a , b ) , and it is right-continuous at a and left-continuous at b. If f is continuous on [ a , b ] , we can draw its graph including the endpoints without raising the pen.

Types of Discontinuity

The most common types of discontinuity are:

  1. Removable Discontinuity: If lim x a f ( x ) = L exists but either f ( a ) is not defined or f ( a ) L . In this case, there is a hole in the graph of f. We can easily remove this type of discontinuity and make the function continuous if L is assumed as the value of f ( a ) . In other words, to remove the discontinuity, we simply add a point to the graph of the function.
Removable discontinuity at x = a
Removable discontinuity at x = a .
  1. Jump Discontinuity: The function f has a jump discontinuity at x = a if the right and left limits exist but have different values: lim x a f ( x ) lim x a + f ( x ) .
Jump discontinuity at x = a
Jump discontinuity at x = a .
  1. Infinite Discontinuity: The function f has an infinite discontinuity at x = a if one of the one-sided limits or both of them are + or .
Infinite discontinuity at x = a
Infinite discontinuity at x = a .
  1. Oscillating Discontinuity: This occurs when f ( x ) does not approach a number or infinity as x a . For example, f ( x ) = sin ( 1 x ) oscillates between 1 and 1 infinitely often as x 0 . Therefore, its limit as x 0 does not exist and f has an oscillating discontinuity at x = 0 .
Oscillating discontinuity at x = 0
Oscillating discontinuity at x = 0 .
A function that is discontinuous at every point of its domain

Consider the Dirichlet function defined as:

D(x) = \begin{cases} 1 & \text{if } x \text{ is rational} \\ 0 & \text{if } x \text{ is irrational} \end{cases}

This function is discontinuous at every point; D ( x ) fails to have a limit at any point.



Suppose D ( x ) has a limit L at a point a. Given ϵ = 1 / 2 , we should be able to find a δ > 0 such that:

0 < | x a | < δ | D ( x ) L | < 1 2 .

Because each deleted neighborhood 0 < | x a | < δ contains a rational point x 1 and an irrational point x 2 , we should have:

| D ( x 1 ) L | = | 1 L | < 1 2

and

| D ( x 2 ) L | = | 0 L | < 1 2 ,

and hence:

1 = | D ( x 1 ) L ( D ( x 2 ) L ) | | D ( x 1 ) L | + | D ( x 2 ) L | < 1 2 + 1 2 = 1.

Because 1 < 1 is impossible, D ( x ) cannot have a limit at any point.

Investigate the discontinuity of f ( x ) = 2 1 / x at x = 0 .

Solution

As x approaches 0 through positive values ( x 0 + ), 1 x + and f ( x ) increases without bound:

lim x 0 + 2 1 / x = + .

As x approaches 0 through negative values ( x 0 ), 1 x , and f ( x ) approaches 0 :

lim x 0 2 1 / x = 0.

There is an infinite discontinuity at x = 0 . Notice that f is not defined at x = 0 .

Graph of f(x) = 2^(1/x)
Graph of f ( x ) = 2 1 / x .

Elementary Continuous Functions

Here are some elementary continuous functions:

  1. Polynomial functions: A function of the form f ( x ) = a n x n + a n 1 x n 1 + + a 1 x + a 0 (where n 0 is an integer and a 0 , , a n are constants) is continuous everywhere because for any a, lim x a P ( x ) = P ( a ) .
  2. Rational functions: Let P ( x ) and Q ( x ) be two polynomials. The rational function R ( x ) = P ( x ) Q ( x ) is continuous at x = a if Q ( a ) 0 . In other words, a rational function is continuous on its domain, and is discontinuous at the points where the denominator is zero.
  3. Odd Root functions: f ( x ) = x n where n is a positive odd integer is continuous everywhere.
  4. Even Root functions: f ( x ) = x n where n is a positive even integer is continuous on its domain [ 0 , ) .
  5. Sine and Cosine functions: The sine and cosine functions are continuous everywhere.
  6. Other Trigonometric functions: The tangent, cotangent, secant, and cosecant functions are continuous where they are defined; that is, on their domains. Specifically, y = tan x is continuous everywhere except where cos x = 0 ; that is, when x = π 2 + k π for all integers k. Therefore, y = tan x is continuous on: { x   |   x π 2 + k π , k  is any integer } .
    y = tan x is continuous on its domain
    y = tan x is continuous on its domain.
  7. Inverse Trigonometric functions: Inverse trigonometric functions are continuous on their domains. For example, y = arcsin x and y = arccos x are continuous on [ 1 , 1 ] , and y = arctan x is continuous on = ( , + ) .
  8. Exponential functions: f ( x ) = e x (also written as exp ( x ) ) is continuous on its domain = ( , + ) .
  9. Logarithmic functions: f ( x ) = ln x is continuous on its domain ( 0 , + ) .
  • One example of functions that are not continuous on their domains is the greatest integer function f ( x ) = [ [ x ] ] (also known as the floor function and denoted by f ( x ) = x ). This function takes a real number x as input and gives the greatest integer less than or equal to x. Therefore, its domain is the entire set of real numbers, but as seen from its graph below, it is discontinuous at every integer. Notice that this function is continuous from the right at each integer.
Graph of floor function
Graph of y = [ [ x ] ] or y = x . It is discontinuous at x = n for every integer n.
  • Another example is the sign function defined by:\text{sgn}(x) = \begin{cases} 1 & \text{if } x > 0 \\ 0 & \text{if } x = 0 \\ -1 & \text{if } x < 0 \end{cases}Although sgn ( 0 ) is defined, this function is discontinuous at x = 0 . More generally, functions defined in pieces by different formulas in different parts of their domains (piecewise defined functions) may or may not be continuous at the points where their formulas change.
Graph of sgn(x)
Graph of y = sgn ( x ) . It is discontinuous at x = 0 .

Algebraic Operations on Continuous Functions

Theorem (Algebra of Continuous Functions): If f and g are continuous at x = a , then the following functions are continuous at x = a :

  1. f ( x ) + g ( x )
  2. f ( x ) g ( x )
  3. f ( x ) g ( x )
  4. f ( x ) g ( x ) provided that g ( a ) 0

In (d), the condition g ( a ) 0 prevents division by zero. It follows from the above theorem that functions such as F ( x ) = ln x + cos 2 x 3 x 2 + 1 and G ( x ) = tan x 3 x 2 + 2 x 1 x 2 1 are continuous on their domains.

A Useful Theorem for Calculating Limits

The following theorem tells us how we can calculate the limit of a composite function:

Theorem (Limit of a Composite Function): If lim x a g ( x ) = b and f is continuous at the point b, then:

lim x a f ( g ( x ) ) = f ( lim x a g ( x ) ) = f ( b ) .
Proof

Let ϵ > 0 be given. We need to show that there exists a δ > 0 such that for all x:

0 < | x a | < δ | f ( g ( x ) ) f ( b ) | < ϵ .
Step 1: Use the continuity of f at b.
Since f is continuous at b, by definition of continuity, for the given ϵ > 0 , there exists a number δ 1 > 0 such that for all u in the domain of f: | u b | < δ 1 | f ( u ) f ( b ) | < ϵ .
Step 2: Use the limit of g at a.
Since lim x a g ( x ) = b , we can use δ 1 > 0 as an error tolerance. There exists a number δ > 0 such that for all x: 0 < | x a | < δ | g ( x ) b | < δ 1 .
Step 3: Combine both steps.
If 0 < | x a | < δ , then | g ( x ) b | < δ 1 . Setting u = g ( x ) in Step 1 yields: | f ( g ( x ) ) f ( b ) | < ϵ . Thus, by the ϵ δ definition of a limit: lim x a f ( g ( x ) ) = f ( b ) = f ( lim x a g ( x ) ) .

It follows from this theorem that whenever the outer function f is continuous, we can "pass the limit inside" the function. That is, we evaluate the limit of the inner function g ( x ) first, and then apply the outer function f to the result:

lim x a f ( g ( x ) ) = f ( lim x a g ( x ) ) .

For example, because the cube root function f ( x ) = x 3 is continuous everywhere on , we can pass the limit inside the radical:

lim x a g ( x ) 3 = lim x a g ( x ) 3 ,

provided lim x a g ( x ) exists. Similarly

lim x a g ( x ) = lim x a g ( x ) ,

provided lim x a g ( x ) > 0 .

Exercises


Let

f(x) = \begin{cases} x^2 + 3 & \text{if } x \ge 3 \\ mx + 5 & \text{if } x < 3 \end{cases}

For what value of the constant m is the function f continuous at x = 3 ?

Answer

m = 7 3

Solution

The function f is right-continuous at x = 3 :

\begin{aligned} \lim_{x\to 3^+} f(x) &= \lim_{x\to 3^+} (x^2 + 3) \\ &= 3^2 + 3 = 12 = f(3). \end{aligned}

Therefore, f must be made left-continuous at x = 3 to be continuous at x = 3 . That is, we must have lim x 3 f ( x ) = f ( 3 ) , or:

lim x 3 ( m x + 5 ) = 3 m + 5 = 12 ,

which gives:

m = 7 3 .


For what values of x is there a discontinuity in the graph of:

f ( x ) = x 2 4 x 2 3 x + 2 ?
Answer

x = 1 and x = 2

Solution

f is a rational function, so it is discontinuous at the points where the denominator x 2 3 x + 2 is zero:

x 2 3 x + 2 = 0 x = 3 ± 3 2 4 ( 2 ) 2 ( 1 ) x = 2  or  x = 1.

Therefore, f is discontinuous at x = 1 and x = 2 . However, f has a removable discontinuity at x = 2 , because for x 2 :

x 2 4 x 2 3 x + 2 = ( x 2 ) ( x + 2 ) ( x 1 ) ( x 2 ) = x + 2 x 1 ,

and:

lim x 2 f ( x ) = lim x 2 x + 2 x 1 = 4.

That is, if we define a new function:

g(x) = \begin{cases} \frac{x^2 - 4}{x^2 - 3x + 2} & \text{if } x \neq 2 \\ 4 & \text{if } x = 2 \end{cases}

then g is continuous at x = 2 , and its graph does not have a hole at x = 2 .

Graph of f(x) = (x^2-4)/(x^2-3x+2)
Graph of f ( x ) = x 2 4 x 2 3 x + 2 .


Is f ( x ) = ( x 1 ) 2 ( x 2 ) continuous on its domain?

Answer

No, f is discontinuous at x = 1 .

Solution

First, let's determine the domain of f. Because ( x 1 ) 2 ( x 2 ) 0 when x = 1 or x 2 , the domain of f is:

Dom ( f ) = { 1 } [ 2 , + ) .

We can consider an open interval containing x = 1 (for example, the interval ( 0.5 , 1.5 ) ) on which the domain of f contains no point other than x = 1 . Therefore, lim x 1 f ( x ) does not exist, and f is not continuous at x = 1 . Because f is discontinuous at x = 1 , it is not continuous on its entire domain.



The function is continuous on ( 2 , + ) , because for every a ( 2 , + ) :

\begin{aligned} \lim_{x\to a} \sqrt{(x - 1)^2(x - 2)} &= \sqrt{\lim_{x\to a} \left[(x - 1)^2(x - 2)\right]} \\ &= \sqrt{(a - 1)^2(a - 2)} \\ &= f(a). \end{aligned}

The function f is right-continuous at x = 2 , because:

lim x 2 + ( x 1 ) 2 ( x 2 ) = 0 = f ( 2 ) .

Therefore, f is continuous on [ 2 , + ) .

Graph of f(x) = sqrt((x-1)^2*(x-2))
Graph of f ( x ) = ( x 1 ) 2 ( x 2 ) .


Where are the following functions continuous?

  1. h ( x ) = cos ( x 3 + 1 )
  2. F ( x ) = | x cos x x 2 + 1 |
  3. G ( x ) = x 2 + 2 x 2
Answer

(a) Continuous on      (b) Continuous on      (c) Continuous on ( , 1 3 ] [ 1 + 3 , + )

Solution

(a) We have h ( x ) = f ( g ( x ) ) where f ( x ) = cos x and g ( x ) = x 3 + 1 . Because both f and g (which is a polynomial) are continuous on , it follows from the Composite Function Limit Theorem that h = f g is also continuous on .



(b) Notice that F = f g , where f ( x ) = | x | and g ( x ) = x cos x x 2 + 1 . Obviously f is continuous on . We can write g ( x ) = u ( x ) v ( x ) / w ( x ) where u ( x ) = x , v ( x ) = cos x , and w ( x ) = x 2 + 1 . Because u, v, and w are continuous functions on and w ( x ) 0 , g is continuous on too. Because f and g are both continuous on and F = f g , F is also continuous on .



(c) We have G = f g where f ( x ) = x and g ( x ) = x 2 + 2 x 2 . The square root function is continuous on its domain [ 0 , ) , and g, which is a polynomial, is continuous on . So G is continuous on its domain, which is:

{ x     x 2 + 2 x 2 0 } .

We can determine where g ( x ) = x 2 + 2 x 2 0 by finding its roots:

\begin{aligned} x^2 + 2x - 2 = 0 \implies x &= \frac{-2 \pm \sqrt{2^2 - 4(1)(-2)}}{2(1)} \\ &= \frac{-2 \pm \sqrt{12}}{2} = -1 \pm \sqrt{3}. \end{aligned}

So we can write x 2 + 2 x 2 = ( x + 1 3 ) ( x + 1 + 3 ) .

Sign diagram of x^2 + 2x - 2
Sign diagram of x 2 + 2 x 2 .

Therefore, G is continuous on ( , 1 3 ] [ 1 + 3 , + ) .


Determine whether the piecewise function:

f(x) = \begin{cases} 2x + 1 & \text{if } x < 2 \\ 7 - x^2 & \text{if } x \ge 2 \end{cases}

is continuous at x = 2 . If discontinuous, classify the type of discontinuity.

Answer

Discontinuous at x = 2 (jump discontinuity).

Solution

Evaluating f ( 2 ) :

f ( 2 ) = 7 2 2 = 7 4 = 3.

Evaluating the one-sided limits as x 2 :

  • Left-hand limit: lim x 2 f ( x ) = lim x 2 ( 2 x + 1 ) = 2 ( 2 ) + 1 = 5 .
  • Right-hand limit: lim x 2 + f ( x ) = lim x 2 + ( 7 x 2 ) = 7 2 2 = 3 .



    Since lim x 2 f ( x ) = 5 lim x 2 + f ( x ) = 3 , the two-sided limit lim x 2 f ( x ) does not exist. Because both one-sided limits exist as finite numbers but are unequal, f has a jump discontinuity at x = 2 .


Find the values of the constants a and b such that the function f ( x ) is continuous everywhere on ( , + ) :

f(x) = \begin{cases} ax + 1 & \text{if } x < 1 \\ 4 & \text{if } x = 1 \\ x^2 + b & \text{if } x > 1 \end{cases}
Answer

a = 3 and b = 3

Solution

For x < 1 and x > 1 , f ( x ) is defined by linear and quadratic polynomials, which are continuous everywhere.



For f to be continuous at the boundary point x = 1 , we must have:

lim x 1 f ( x ) = lim x 1 + f ( x ) = f ( 1 ) = 4.

Evaluating the one-sided limits:

  • Left-hand limit: lim x 1 ( a x + 1 ) = a ( 1 ) + 1 = a + 1 .
  • Right-hand limit: lim x 1 + ( x 2 + b ) = 1 2 + b = 1 + b .



    Setting both one-sided limits equal to f ( 1 ) = 4 :
  • a + 1 = 4 a = 3 .
  • 1 + b = 4 b = 3 .



    Thus, a = 3 and b = 3 .


Consider the function f ( x ) = sin ( 3 x ) x for x 0 .

  1. Show that f has a removable discontinuity at x = 0 .
  2. How should f ( 0 ) be defined so that f becomes continuous at x = 0 ?
Answer

(a) lim x 0 sin ( 3 x ) x = 3 exists, but f ( 0 ) is undefined.      (b) Define f ( 0 ) = 3 .

Solution

(a) Note that f ( 0 ) is currently undefined. Evaluating the limit as x 0 using the trigonometric limit rule lim x 0 sin ( A x ) x = A :

lim x 0 f ( x ) = lim x 0 sin ( 3 x ) x = 3.

Since the limit exists as a finite number ( L = 3 ) but f ( 0 ) is undefined, f has a removable discontinuity at x = 0 .



(b) To make f continuous at x = 0 , we must define f ( 0 ) = lim x 0 f ( x ) = 3 .


Evaluate the limit using the Composite Function Limit Theorem:

lim x 0 cos ( sin x x )
Answer

cos ( 1 )

Solution

Let g ( x ) = sin x x and f ( u ) = cos u .



First, evaluate the limit of the inner function as x 0 :

b = lim x 0 g ( x ) = lim x 0 sin x x = 1.

Since the outer function f ( u ) = cos u is continuous at u = 1 , by the Composite Function Limit Theorem:

lim x 0 cos ( sin x x ) = cos ( lim x 0 sin x x ) = cos ( 1 ) .


Determine the interval of continuity for f ( x ) = 9 x 2 , and verify one-sided continuity at the endpoints.

Answer

Continuous on the closed interval [ 3 , 3 ] .

Solution

The function f ( x ) = 9 x 2 is defined when 9 x 2 0 3 x 3 .


  1. On the open interval ( 3 , 3 ) , 9 x 2 > 0 . Since polynomials and root functions are continuous on their domains, f is continuous at every point in ( 3 , 3 ) .
  2. At the left endpoint x = 3 : lim x 3 + f ( x ) = lim x 3 + 9 x 2 = 9 ( 3 ) 2 = 0 = f ( 3 ) . Thus, f is continuous from the right at x = 3 .
  3. At the right endpoint x = 3 : lim x 3 f ( x ) = lim x 3 9 x 2 = 9 3 2 = 0 = f ( 3 ) . Thus, f is continuous from the left at x = 3 .



    Therefore, f is continuous on the closed interval [ 3 , 3 ] .