Home » Continuity » Page 2

Tag: Continuity

Find a function continuous at a single point of an interval

Find a function continuous at a single point of an interval, but discontinuous at all other points of the interval.


Consider the interval (-a,a) for any a \in \mathbb{R}, and define

    \[ f(x) =  \begin{cases}  x & \text{if } x \text{ is rational},\\  0 & \text{if } x \text{ is irrational}. \end{cases} \]

for all x \in (-a,a).

We claim f is continuous at 0, but discontinuous at every other point of the interval.

Proof. First, we show f is continuous at 0. To do this we must show that for all \varepsilon  > 0 there exists a \delta > 0 such that |f(x)| < \varepsilon whenever 0 < |x| < \delta. So, let \varepsilon > 0 be given. Then, choose \delta = \varepsilon. Then we have,

    \[ |x| < \delta \quad \implies \quad |x| < \varepsilon \quad \implies \quad |f(x)| < \varepsilon \]

since |f(x)| \leq |x| from the definition of f(x). Thus, f is continuous at 0.

Now, we must show f is discontinuous at every other point of the interval. Let p \neq 0 be any nonzero point of the interval.

We consider two cases:
Case #1: p is rational. Then f(p) = p. Since p \neq 0 by assumption, we consider \varepsilon = |p| > 0. Since the irrationals are dense in the reals (see Exercise #9 of Section I.3.12 here) we know that for any \delta > 0 there is some irrational number x such that |p-x| < \delta. But then, |f(p) - f(x)| = |p - 0| = |p| \not < \varepsilon. This means f is not continuous at p since we have found an \varepsilon > 0 such that there is no \delta > 0 we can choose such that |f(p) - f(x)| < \varepsilon whenever |p - x| < \delta.

Case #2: p is irrational. Since p is irrational we know f(p) = 0. Consider \varepsilon = |p| > 0. Since the rationals are dense in the reals (see Exercise #6 of Section I.3.12 here) we know that for any \delta > 0 there exists some rational number r such that |p| < |r| < |p| + \delta. But then, |f(p) - f(r)| = |0-r| = |r| \not < \varepsilon. This means f is not continuous at p. (Again, because we have shown that there exists an \varepsilon > 0 such that for every \delta > 0 there is some number r such that |f(p) - f(r)| \not < \varepsilon with |p-r| < \delta.) \qquad \blacksquare

(Note: There are much nicer ways to do this using sequences, but Apostol doesn’t develop those techniques, so we have to work straight from the epsilon-delta definitions.)

Consider the continuity of (-1)^[1/x]

Define:

    \[ f(x) = (-1)^{\left \lfloor \frac{1}{x} \right \rfloor} \qquad \text{for } x \neq 0, \]

where \lfloor \ \rfloor denotes the greatest integer function, or floor function. Sketch the graph of f(x) for -2 \leq x \leq -\frac{1}{5} and \frac{1}{5} \leq x \leq 2. Evaluate

    \[ \lim_{x \to 0^+} f(x) \qquad \text{and} \qquad \lim_{x \to 0^-} f(x). \]

Is it possible to define f(0) in a way that makes f(x) continuous at 0.


First, we sketch the graph of f on the requested intervals.

Rendered by QuickLaTeX.com

As x \to 0^+, f(x) alternates between +1 and -1.
As x \to 0^-, f(x) alternates between +1 and -1.

There is no way to define f(0) to make f continuous at 0 since f(x) will take both values +1 and -1 no matter how small we choose our \delta > 0. (So, if we were to try to define f(0) = 1, then for \varepsilon = \frac{1}{2} > 0 there is no \delta> 0 such that f(x) < \varepsilon whenever |x| < \delta, and similarly if we try to define f(0) = -1.)

Consider the limit and continuity of the floor function of (1/x)

Define:

    \[ f(x) = \left\lfloor \frac{1}{x} \right\rfloor \qquad \text{for } x \neq 0, \]

where \lfloor \ \rfloor denotes the greatest integer function, or floor function. Sketch the graph of f(x) for -2 \leq x \leq -\frac{1}{5} and \frac{1}{5} \leq x \leq 2. Evaluate

    \[ \lim_{x \to 0^+} f(x) \qquad \text{and} \qquad \lim_{x \to 0^-} f(x). \]

Is it possible to define f(0) in a way that makes f(x) continuous at 0.


First, we sketch the graph of f on the requested intervals.

Rendered by QuickLaTeX.com

As x \to 0^+, f(x) takes on arbitrarily large positive values.
As x \to 0^-, f(x) takes on arbitrarily large negative values.

There is no way to define f(0) to make f continuous at 0.

Prove that sin (1/x) has no limit as x approaches 0

Define the function:

    \[ f(x) = \sin \frac{1}{x} \qquad \text{for } x \neq 0. \]

Prove there is no A \in \mathbb{R} such that

    \[ \lim_{x \to 0} f(x) = A. \]


Proof. We prove this by contradiction. Suppose there does exist some A \in \mathbb{R} such that \lim_{x \to 0} f(x) = A. From the definition of limit this means that for all \varepsilon > 0 there exists a \delta > 0 such that

    \[ | f(x) - A | < \varepsilon \qquad \text{whenever} \qquad 0 < |x| < \delta. \]

First, we claim that for any such A we must have |A| \leq 1. This must be the case since if |A| > 1 then |A| - 1 > 0, so we may choose \varepsilon such that 0 < \varepsilon < (|A|-1). But then, since |f(x)| \leq 1 for all x, we have

    \[ |f(x) - A| = |A - f(x)| \geq |A| - |f(x)| \geq |A| - 1 > \varepsilon. \]

(Where we used part (i) this exercise (Section I.4.9, Exercise #1) for the inequality |A - f(x) \geq |A| - |f(x)|.) This contradicts our choice of \varepsilon, so |A| must be less than or equal to 1.
Next, suppose |A| \leq 1. Then choose \varepsilon = \frac{1}{2} > 0. To obtain our contradiction we must show that there is no \delta > 0 such that

    \[ |f(x) - A| < \frac{1}{2}, \qquad \text{whenever} \qquad 0 < |x| < \delta. \]

By the Archimedean property of the real numbers we know that for any x \in \mathbb{R}, there exists a positive integer n with n \equiv 1 \pmod{4} such that 0 < \frac{2}{n \pi} < |x|. (The Archimedean property guarantees us an integer, but then the inequality will hold for any larger integer, so we can choose one with the property of being 1 \pmod{4}.) But,

    \[ 0 < \frac{2}{n \pi} < |x| \quad \implies \quad 0 < \frac{2}{(n+2) \pi} < |x|. \]

Then, from the definition of f and since n \equiv 1 \pmod{4} and n+2 \equiv 3 \pmod{4} we have,

    \begin{align*}   f \left( \frac{2}{n \pi} \right) &= \sin \left( \frac{n \pi}{2} \right) = 1 \\  f \left( \frac{2}{(n+2) \pi} \right) &= \sin \left( \frac{(n+2)\pi}{2} \right) = -1. \end{align*}

But then,

    \begin{align*}   \left| f \left( \frac{n \pi}{2} \right) - A \right| < \frac{1}{2} && \implies && |1 - A| &< \frac{1}{2} \\  && \implies && \frac{1}{2} &< A \leq 1 &(\text{from above } A \leq 1). \end{align*}

Furthermore,

    \[ \left| f \left( \frac{(n+2) \pi}{2} \right) - A \right| = |-1-A| > \frac{1}{2}. \]

This contradicts that if \lim_{x \to 0} f(x) = A then for every \varepsilon > 0 we have |f(x) - A| < \varepsilon for all 0 < |x| < \delta. In other words, we found an \varepsilon greater than 0 (in particular, we found \varepsilon = \frac{1}{2}) such that no matter how small we choose \delta there exists an x such that |x| is smaller than \delta, but |f(x) - A| is bigger than \varepsilon. This exactly contradicts the definition of \lim_{x \to 0} f(x) = A. Hence, there can be no such number A \in \mathbb{R}. \qquad \blacksquare

This proof shows that there is now way to define f(0) so that f is continuous at 0. We see this since for f to be continuous at 0 we must have \lim_{x \to 0} f(x) = f(0). But if we try to define f(0) = A for any A \in \mathbb{R}, we will fail to achieve continuity since the proof shows \lim_{x \to 0} f(x) \neq A for any A we might want to choose.

Give an alternate proof of the continuity of the sine and cosine functions

  1. Use the inequality

        \[ | \sin x | < |x|, \qquad \text{for } 0 < |x| < \frac{\pi}{2}, \]

    to prove that the sine function is continuous at 0.

  2. Recall the trig identity,

        \[ \cos 2x = 1 - 2 \sin^2 x. \]

    Use this and part (a) to prove that the cosine function is continuous at 0.

  3. Use the formulas for sine and cosine of a sum to prove that the sine and cosine functions are continuous for all x \in \mathbb{R}.

  1. Proof. To show \sin is continuous at 0, we must show that \lim_{x \to 0} \sin x = \sin 0 = 0. We show this limit is zero directly from the epsilon-delta definition of the limit, i.e., given arbitrary positive \varepsilon, we have |\sin x| < \varepsilon whenever |x| < \delta. Let \varepsilon be an arbitrary number greater than 0, \varepsilon > 0. Then, let \delta = \varepsilon. Using the given inequality we have,

        \[ | \sin x | < |x| < \delta = \varepsilon, \qquad \text{whenver } 0 < |x| < \delta. \]

    Thus, \sin x is continuous at 0. \qquad \blacksquare

  2. Proof. First, using the given trig identity we have

        \[ \cos (2x) = 1 - 2 \sin^2 x \quad \implies \quad \cos x = 1 - 2 \sin^2 \frac{x}{2}. \]

    Thus,

        \begin{align*}  \lim_{x \to 0} \cos x &= \lim_{x \to 0} \left( 1 - 2 \sin^2 \frac{x}{2} \right) \\  &= 1 - 2 \cdot \lim_{x \to 0} \left( \sin \left( \frac{x}{2} \right) \sin \left( \frac{x}{2} \right) \right) \\  &= 1 = \cos 0. \end{align*}

    Thus, cosine is continuous at 0.

  3. Proof. Finally, to show sine and cosine are continuous for all x \in \mathbb{R}, we show that \lim_{x \to h} \sin x = sin h, and \lim_{x \to h} \cos x = cos h. First, we recall the formulas for the sine and cosine of a sum,

        \begin{align*}  \sin (x+h) &= \sin x \cos h + \sin h \cos x \\  \cos (x+h) &= \cos x \cos h - \sin x \sin h. \end{align*}

    So, we compute the limits

        \begin{align*}  \lim_{x \to h} \sin x &= \lim_{x \to 0} \sin (x+h) = \lim_{x \to 0} (\sin x \cos h + \sin h \cos x) = \sin h \\  \lim_{x \to h} \cos x &= \lim_{x \to 0} \cos (x+h) = \lim_{x \to 0} (\cos x \cos h - \sin x \sin ) = \cos h. \end{align*}

    Therefore, sine and cosine are continuous for all x \in \mathbb{R}. \qquad \blacksquare

Consider the continuity of (tan x)/x at the point x=0

Consider the function

    \[ f(x) = \frac{\tan x}{x} \qquad x \neq 0. \]

Determine what happens to f(x) as x \to 0. Define f(0) so that f will be continuous at x = 0, if possible.


First, we sketch the graph of f(x) = \frac{\tan x}{x} on the intervals \left[ -\frac{1}{4} \pi, 0\right) and \left( 0, \frac{1}{4} \pi \right].

Rendered by QuickLaTeX.com

To determine what happens to f(x) as x \to 0 we can take the limit, (recalling that \lim_{x \to 0} \frac{\sin x}{x} = 1),

    \begin{align*}  \lim_{x \to 0} \frac{\tan x}{x} &= \lim_{x \to 0} \frac{\sin x}{x \cos x} \\  & =\lim_{x \to 0} \left( \left( \frac{\sin x}{x} \right) \cos x \right) \\  & =\lim_{x \to 0} \cos x \\  &= 1. \end{align*}

Since f(x) = \frac{\tan x}{x} is not defined at x = 0 it is not continuous there. However, since the limit exists we could redefine f by

    \[ f(x) =  \begin{cases}  \frac{\tan x}{x}  & \text{if } x \neq 0 \\  1 & \text{if } x = 0. \end{cases} \]

Then, this new f (which has the same values as the original function everywhere the original function is defined, but has the additional feature of being defined at x=0) is continuous at x=0 since it is defined there and \lim_{x \to 0} f(x) = f(0) = 1.

Note what we have done here. We had a function f(x) = \frac{\tan x}{x} which was undefined at the point x = 0. We created a new function (which we also called f, which is a bit confusing) that took the same values as the original function for all x \neq 0, and took the value 1 when x = 0. In this way we “removed” the discontinuity of the original f at the point x = 0, but we should be aware that this is actually a new function (since it has a different domain than the original).

Find all points at which tangent and cotangent are continuous

Find the points x \in \mathbb{R} at which \tan x is continuous and at which \cot x is continuous.


Since

    \[ \tan x = \frac{\sin x}{\cos x} \]

and \sin x, \cos x are continuous everywhere we know (by Theorem 3.2) that \tan x is continuous everywhere \cos x is not zero. We proved in this exercise (Section 2.8, #1 (b) of Apostol) that

    \[ \cos x = 0 \quad \iff \quad x = \frac{\pi}{2} + n \pi, \qquad n \in \mathbb{Z}. \]

Thus, \tan x is continuous for

    \[ \left\{ x \in \mathbb{R} \mid x \neq \frac{\pi}{2} + n \pi, \ n \in \mathbb{Z} \right\} \]

Similarly,

    \[ \cot x = \frac{\cos x}{\sin x} \]

and by Theorem 3.2 we then have \cot x is continuous everywhere that \sin x is not zero. We proved in the same exercise (Section 2.8, #1(a) of Apostol) that

    \[ \sin x = 0 \quad \iff \quad x = n \pi \qquad n \in \mathbb{Z}. \]

Hence, \cot x is continuous for

    \[ \left\{ x \in \mathbb{R} \mid x \neq n \pi, n \in \mathbb{Z} \right \}. \]

Find a constant such that a given piecewise function is continuous everywhere

Given constants a,b,c \in \mathbb{R} define:

    \[ f(x) =  \begin{cases}  2 \cos x & \text{if } x \leq c, \\  ax^2 + b & \text{if } x > c. \end{cases} \]

If b,c are fixed find all values of a such that f is continuous at x = c.


By the definition of continuity, we know that f continuous at x = c means that f(c) is defined and \lim_{x \to c} f(x) = f(c). Since 2 \cos x and ax^2 + b are defined for all x \in \mathbb{R}, we know that f is defined for every c \in \mathbb{R}. Then, to show that it is continuous we must show

    \[ \lim_{x \to c} f(x) = f(c). \]

From the definition of f we know

    \[ f(c) = 2 \cos c. \]

Then, taking the limit as x approaches c from the right (since \lim_{x \to c^-} f(x) = f(c) since 2 \cos x is continuous and f(x) = 2 \cos x as x approaches c from the left),

    \[ \lim_{x \to c^+} f(x) = \lim_{x \to c^+} ax^2 + b = ac^2 + b. \]

So, we must have

    \[ ac^2 + b = 2 \cos c \quad \implies \quad a = \frac{2 \cos c - b}{c^2} \quad \text{if } c \neq 0. \]

If c = 0 then,

    \[ ac^2 + b = 2 \cos c \quad \implies \quad b= 2 \quad \text{and } a \text{ is arbitrary}. \]

Find a constant such that a given piecewise function is continuous

For a constants a,b,c \in \mathbb{R}, define:

    \[ f(x) =  \begin{cases}  \sin x & \text{if } x \leq c, \\  ax + b & \text{if } x > c. \end{cases} \]

If b,c are fixed, find all values for a such that f is continuous at x = c.


By the definition of continuity of a function at a point, we know that f is continuous at x = c means f is defined at c, and \lim_{x \to c} f(x) = f(c).

Since \sin x and ax + b are defined for all x \in \mathbb{R}, we know that f is defined at x = c for all c \in \mathbb{R}. So, we must then find values of a such that

    \[ \lim_{x \to c} f(x) = f(c). \]

From the definition of f, we know

    \[ f(c) = \sin c. \]

Then, we evaluate the limit as x \to c through values greater than c (since the limit as x \to c through values less than c is f(c) since \sin x is a continuous function, and for values less than c, f(x) = \sin x),

    \[ \lim_{x \to c^+} f(x) = \lim_{x \to c^+} ax + b = ac + b. \]

Thus, for f to be continuous at c we must have,

    \[ ac + b = \sin c \quad \implies \quad a = \frac{\sin c - b}{c} \qquad \text{if } c \neq 0. \]

If c = 0, then we have

    \[ ac + b = \sin c \quad \implies \quad b = 0, \ \ \text{and } a \text{ is arbitrary}. \]