1 Limits

1.6 Continuity

As we have studied limits, we have gained the intuition that limits measure “where a function is heading.” That is, if limx1f(x)=3, then as x is close to 1, f(x) is close to 3. We have seen, though, that this is not necessarily a good indicator of what f(1) actually is. This can be problematic; functions can tend to one value but attain another. This section focuses on functions that do not exhibit such behavior.

Definition 1.6.1      Continuous Function

Let f be a function defined on an open interval I containing c.

  1. 1.

    f is continuous at c if limxcf(x)=f(c).

  2. 2.

    f is continuous on I if f is continuous at c for all values of c in I. If f is continuous on (-,), we say f is continuous everywhere.

A useful way to establish whether or not a function f is continuous at c is to verify the following three things:

  1. 1.

    limxcf(x) exists,

  2. 2.

    f(c) is defined, and

  3. 3.

    limxcf(x)=f(c).

If f is defined near c but is not continuous at c, then we say that f is discontinuous at 𝐜 or f has a discontinuity at 𝐜. We will discuss three types of discontinuities, as seen in Figure 1.6.1.

-2

2

-2

2

x

y

-2

2

-2

2

x

y

-2

2

-2

2

x

y
Removable Infinite Jump
Figure 1.6.1: Three types of discontinuities
Removable discontinuity

This type of discontinuity is called removable because we could remove the discontinuity by redefining the function at a single point.

Infinite discontinuity

The function is approaching ± at some x value.

Jump discontinuity

The function “jumps” from one value to another.

Example 1.6.1 Finding intervals of continuity

Let f be defined as shown in Figure 1.6.2. Give the interval(s) on which f is continuous.

margin:

1

2

3

0.5

1

1.5

x

y
Figure 1.6.2: A graph of f in Example 1.6.1.

SolutionWe proceed by examining the three criteria for continuity.

  1. 1.

    The limits limxcf(x) exists for all c between 0 and 3.

  2. 2.

    f(c) is defined for all c between 0 and 3, except for c=1. We know immediately that f cannot be continuous at x=1.

  3. 3.

    The limit limxcf(x)=f(c) for all c between 0 and 3, except, of course, for c=1.

We conclude that f is continuous at every point of (0,3) except at x=1. Therefore f is continuous on (0,1)(1,3).

margin:

-2

2

-2

2

x

y
Figure 1.6.3: A graph of the step function in Example 1.6.2.
Example 1.6.2 Finding intervals of continuity

The floor function, f(x)=x, returns the largest integer smaller than or equal to the input x. (For example, f(π)=π=3.) The graph of f in Figure 1.6.3 demonstrates why this is often called a “step function.”
Give the intervals on which f is continuous.

SolutionWe examine the three criteria for continuity.

  1. 1.

    The limits limxcf(x) do not exist at the jumps from one “step” to the next, which occur at all integer values of c. Therefore the limits exist for all c except when c is an integer.

  2. 2.

    The function is defined for all values of c.

  3. 3.

    The limit limxcf(x)=f(c) for all values of c where the limit exist, since each step consists of just a line.

We conclude that f is continuous everywhere except at integer values of c. So the intervals on which f is continuous are

,(-2,-1),(-1,0),(0,1),(1,2),.

Our definition of continuity on an interval specifies the interval is an open interval. At endpoints or points of discontinuity we may consider continuity from the right or left.

Definition 1.6.2      Right and Left Continuity

Right Continuous

Let f be defined on a closed interval with left endpoint a. We say that f is continuous from the right at a (or right continuous at a) if

limxa+f(x)=f(a).

Left Continuous

Let f be defined on a closed interval with right endpoint b. We say that f is continuous from the left at b (or left continuous at b) if

limxb-f(x)=f(b).

We can then extend the definition of continuity to closed intervals by considering the appropriate one-sided limits at the endpoints.

Definition 1.6.3      Continuity on Closed Intervals

Let f be defined on the closed interval [a,b] for some real numbers a,b. Then f is continuous on [a,b] if:

  1. 1.

    f is continuous on (a,b),

  2. 2.

    f is right continuous at a and

  3. 3.

    f is left continuous at b.

We can make the appropriate adjustments to talk about continuity on half-open intervals such as [a,b) or (a,b] if necessary.

Continuity is inherently tied to the properties of limits. Because of this, the properties of limits found in Theorems 1.3.1 and 1.3.3 apply to continuity as well. We will utilize these properties in the following example.

Example 1.6.3 Determining intervals on which a function is continuous

For each of the following functions, give the domain of the function and the interval(s) on which it is continuous.

1. f(x)=1/x 2. f(x)=sinx 3. f(x)=x 4. f(x)=1-x2 5. f(x)=|x|

SolutionWe examine each in turn.

  1. 1.

    The domain of f(x)=1/x is (-,0)(0,). As it is a rational function, we apply Theorem 1.3.3 to recognize that f is continuous on all of its domain.

  2. 2.

    The domain of f(x)=sinx is all real numbers, or (-,). Applying Theorem 1.3.4 shows that sinx is continuous everywhere.

  3. 3.

    The domain of f(x)=x is [0,). Applying Theorem 1.3.4 shows that f(x)=x is continuous on its domain of [0,).

  4. 4.

    The domain of f(x)=1-x2 is [-1,1]. Applying Theorems 1.3.1 and 1.3.4 shows that f is continuous on all of its domain, [-1,1].

  5. 5.

    The domain of f(x)=|x| is (-,). We can define the absolute value function as f(x)={-xx<0xx0. Each “piece” of this piecewise defined function is continuous on all of its domain, giving that f is continuous on (-,0) and [0,). We cannot assume this implies that f is continuous on (-,); we need to check that limx0f(x)=f(0), as x=0 is the point where f transitions from one “piece” of its definition to the other. It is easy to verify that this is indeed true, hence we conclude that f(x)=|x| is continuous everywhere.

The following theorem states how continuous functions can be combined to form other continuous functions.

Theorem 1.6.1      Properties of Continuous Functions

Let f and g be continuous functions on an interval I, let c be a real number and let n be a positive integer. The following functions are continuous on I.

  1. 1.

    Sums/Differences: f±g

  2. 2.

    Constant Multiples: cf

  3. 3.

    Products: fg

  4. 4.

    Quotients: f/g   (as long as g0 on I)

  5. 5.

    Powers: fn

  6. 6.

    Roots: fn   (if f0 on I or n is odd)

The proofs of each of the parts of Theorem 1.6.1 follow from the Basic Limit Properties given in Theorem 1.3.1. We will prove the product of two continuous functions is continuous now.

  • Proof


    We know that f and g are continuous at c so by definition we have

    limxcf(x)=f(c)andlimxcg(x)=g(c).

    Therefore,

    limxc(fg)(x) =limxcf(x)g(x)
    =limxcf(x)limxcg(x)
    =f(c)g(c)
    =(fg)(c).
Theorem 1.6.2      Continuity of Compositions

Let f be continuous on I, where the range of f on I is J, and let g be continuous on J. Then

(gf)(x)=g(f(x))

is continuous on I.

Now knowing the definition of continuity we can re-read Theorem 1.3.4 as giving a list of functions that are continuous on their domains.

Theorem 1.6.3      Continuous Functions

The following functions are continuous on their domains.
1.  f(x)=sinx                        2.  f(x)=cosx 3.  f(x)=tanx 4.  f(x)=cotx 5.  f(x)=secx 6.  f(x)=cscx 7.  f(x)=lnx 8.  f(x)=ax (a>0)

In the following example, we will show how we apply the previous theorems.

Example 1.6.4 Determining intervals on which a function is continuous

State the interval(s) on which each of the following functions is continuous.

1. f(x)=x-1+5-x 2. f(x)=xsinx 3. f(x)=tanx 4. f(x)=lnx

SolutionWe examine each in turn, applying Theorems 1.6.1 and 1.6.3 as appropriate.

margin:

2

4

1

2

3

x

y
Figure 1.6.4: A graph of f in Example 1.6.4(1).
  1. 1.

    The square-root terms are continuous on the intervals [1,) and (-,5], respectively. As f is continuous only where each term is continuous, f is continuous on [1,5], the intersection of these two intervals. A graph of f is given in Figure 1.6.4.

  2. 2.

    The functions y=x and y=sinx are each continuous everywhere, hence their product is, too.

  3. 3.

    Theorem 1.6.3 states that f(x)=tanx is continuous “on its domain.” Its domain includes all real numbers except odd multiples of π/2. Thus f(x)=tanx is continuous on

    ,(-3π2,-π2),(-π2,π2),(π2,3π2),

    or, equivalently, on D={x|x(2n+1)π2,n}.

  4. 4.

    The domain of y=x is [0,). The range of y=lnx is (-,), but if we restrict its domain to [1,) its range is [0,). So restricting y=lnx to the domain of [1,) restricts its output is [0,), on which y=x is defined. Thus the domain of f(x)=lnx is [1,).

A common way of thinking of a continuous function is that “its graph can be sketched without lifting your pencil.” That is, its graph forms a “continuous” curve, without holes, breaks or jumps. While beyond the scope of this text, this pseudo-definition glosses over some of the finer points of continuity. Very strange functions are continuous that one would be hard pressed to actually sketch by hand.

This intuitive notion of continuity does help us understand another important concept as follows. Suppose f is defined on [1,2] and f(1)=-10 and f(2)=5. If f is continuous on [1,2] (i.e., its graph can be sketched as a continuous curve from (1,-10) to (2,5)) then we know intuitively that somewhere on [1,2] f must be equal to -9, and -8, and -7,-6,, 0, 1/2, etc. In short, f takes on all intermediate values between -10 and 5. It may take on more values; f may actually equal 6 at some time, for instance, but we are guaranteed all values between -10 and 5.

While this notion seems intuitive, it is not trivial to prove and its importance is profound. Therefore the concept is stated in the form of a theorem and illustrated in Figure 1.6.5.

margin:

a

c

b

f(b)

L

f(a)

x

y

y=f(x)
(a)

a

?

b

f(a)

L

f(b)

x

y

y=f(x)
(b)
Figure 1.6.5: A situation where the Intermediate Value Theorem applies (top) and does not (bottom).
Theorem 1.6.4      Intermediate Value Theorem

Let f be a continuous function on [a,b] and, without loss of generality, let f(a)<f(b). Then for every value y, where f(a)<y<f(b), there exists at least one value c in (a,b) such that f(c)=y

One important application of the Intermediate Value Theorem is root finding. Given a function f, we are often interested in finding values of x where f(x)=0. These roots may be very difficult to find exactly. Good approximations can be found through successive applications of this theorem. Suppose through direct computation we find that f(a)<0 and f(b)>0, where a<b. The Intermediate Value Theorem states that there exists at least one c in [a,b] such that f(c)=0. The theorem does not give us any clue as to where that value is in the interval [a,b], just that it exists.

Example 1.6.5 Finding roots

Show that f(x)=x3+x+3 has at least one real root.

SolutionWe must determine an interval on which the function changes from positive to negative values. We start by evaluating f at different values. We see that f(0)=3>0 and f(1)=5>0. As we choose larger positive values of x, we can see that f(x) values will continue to grow. Looking at negative x-values, f(-1)=1>0 and f(-2)=-7<0 so we know f(x) must change sign in [-2,-1]. Because f(x) is a polynomial, it is continuous on all real numbers so is continuous on [-2,-1]. By the Intermediate Value Theorem there is a c in (-2,-1) where f(x)=0. Thus f(x) must have at least one real root on (-2,-1).

Note that in the above example you were not asked to find the root, just to show that the function had a root.

There is a technique that produces a good approximation of c. Let d be the midpoint of the interval [a,b] and consider f(d). There are three possibilities:

  1. 1.

    f(d)=0 — we got lucky and stumbled on the actual value. We stop as we found a root.

  2. 2.

    f(d)<0 Then we know there is a root of f on the interval [d,b] — we have halved the size of our interval, hence are closer to a good approximation of the root.

  3. 3.

    f(d)>0 Then we know there is a root of f on the interval [a,d] — again,we have halved the size of our interval, hence are closer to a good approximation of the root.

Successively applying this technique is called the Bisection Method of root finding. We continue until the interval is sufficiently small. We demonstrate this in the following example.

margin:

0.5

1

-1

-0.5

0.5

x

y
Figure 1.6.6: Graphing a root off(x)=x-cosx.
Example 1.6.6 Using the Bisection Method

Approximate the root of f(x)=x-cosx, accurate to three places after the decimal.

SolutionConsider the graph of f(x)=x-cosx, shown in Figure 1.6.6. It is clear that the graph crosses the x-axis somewhere near x=0.8. To start the Bisection Method, pick an interval that contains 0.8. We choose [0.7,0.9]. Note that all we care about are signs of f(x), not their actual value, so this is all we display.

Iteration 1:

f(0.7)<0, f(0.9)>0, and f(0.8)>0. So replace 0.9 with 0.8 and repeat.

Iteration 2:

f(0.7)<0, f(0.8)>0, and at the midpoint, 0.75, we see that f(0.75)>0. So replace 0.8 with 0.75 and repeat. Note that we don’t need to continue to check the endpoints, just the midpoint. Thus we put the rest of the iterations in Figure 1.6.7.

Notice that in the 12th iteration we have the endpoints of the interval each starting with 0.739. Thus we have narrowed the zero down to an accuracy of the first three places after the decimal. Using a computer, we have

f(0.7390)=-0.00014,f(0.7391)=0.000024.
margin: Itera- tion # Interval Midpoint Sign 1 [0.7,0.9] f(0.8)>0 2 [0.7,0.8] f(0.75)>0 3 [0.7,0.75] f(0.725)<0 4 [0.725,0.75] f(0.7375)<0 5 [0.7375,0.75] f(0.7438)>0 6 [0.7375,0.7438] f(0.7407)>0 7 [0.7375,0.7407] f(0.7391)>0 8 [0.7375,0.7391] f(0.7383)<0 9 [0.7383,0.7391] f(0.7387)<0 10 [0.7387,0.7391] f(0.7389)<0 11 [0.7389,0.7391] f(0.7390)<0 12 [0.7390,0.7391] Figure 1.6.7: Iterations of the Bisection Method of Root Finding

Either endpoint of the interval gives a good approximation of where f is 0. The Intermediate Value Theorem states that the actual zero is still within this interval. While we do not know its exact value, we know it starts with 0.739.

This type of exercise is rarely done by hand. Rather, it is simple to program a computer to run such an algorithm and stop when the endpoints differ by a preset small amount. One of the authors did write such a program and found the zero of f, accurate to 10 places after the decimal, to be 0.7390851332. While it took a few minutes to write the program, it took less than a thousandth of a second for the program to run the necessary 35 iterations. In less than 8 hundredths of a second, the zero was calculated to 100 decimal places (with less than 200 iterations).

It is a simple matter to extend the Bisection Method to solve problems similar to “Find x, where f(x)=0.” For instance, we can find x, where f(x)=1. It actually works very well to define a new function g where g(x)=f(x)-1. Then use the Bisection Method to solve g(x)=0.

Similarly, given two functions f and g, we can use the Bisection Method to solve f(x)=g(x). Once again, create a new function h where h(x)=f(x)-g(x) and solve h(x)=0.

In Section 4.4 another equation solving method will be introduced, called Newton’s Method. In many cases, Newton’s Method is much faster. It relies on more advanced mathematics, though, so we will wait before introducing it.

This section formally defined what it means to be a continuous function. “Most” functions that we deal with are continuous, so often it feels odd to have to formally define this concept. Regardless, it is important, and forms the basis of the next chapter.

Modern Campus CMS