## Section3.1Limits of functions

Note: 2–3 lectures

Before we define continuity of functions, we must visit a somewhat more general notion of a limit. Given a function $$f \colon S \to \R\text{,}$$ we want to see how $$f(x)$$ behaves as $$x$$ tends to a certain point.

### Subsection3.1.1Cluster points

First, we return to a concept we have previously seen in an exercise. When moving within the set $$S$$ we can only approach points that have elements of $$S$$ arbitrarily near.

#### Definition3.1.1.

Let $$S \subset \R$$ be a set. A number $$x \in \R$$ is called a cluster point of $$S$$ if for every $$\epsilon > 0\text{,}$$ the set $$(x-\epsilon,x+\epsilon) \cap S \setminus \{ x \}$$ is not empty.

That is, $$x$$ is a cluster point of $$S$$ if there are points of $$S$$ arbitrarily close to $$x\text{.}$$ Another way of phrasing the definition is to say that $$x$$ is a cluster point of $$S$$ if for every $$\epsilon > 0\text{,}$$ there exists a $$y \in S$$ such that $$y \not= x$$ and $$\abs{x - y} < \epsilon\text{.}$$ Note that a cluster point of $$S$$ need not lie in $$S\text{.}$$

Let us see some examples.

1. The set $$\{ \nicefrac{1}{n} : n \in \N \}$$ has a unique cluster point zero.

2. The cluster points of the open interval $$(0,1)$$ are all points in the closed interval $$[0,1]\text{.}$$

3. The set of cluster points of $$\Q$$ is the whole real line $$\R\text{.}$$

4. The set of cluster points of $$[0,1) \cup \{ 2 \}$$ is the interval $$[0,1]\text{.}$$

5. The set $$\N$$ has no cluster points in $$\R\text{.}$$

#### Proof.

First suppose $$x$$ is a cluster point of $$S\text{.}$$ For every $$n \in \N\text{,}$$ pick $$x_n$$ to be an arbitrary point of $$(x-\nicefrac{1}{n},x+\nicefrac{1}{n}) \cap S \setminus \{x\}\text{,}$$ which is nonempty because $$x$$ is a cluster point of $$S\text{.}$$ Then $$x_n$$ is within $$\nicefrac{1}{n}$$ of $$x\text{,}$$ that is,

\begin{equation*} \abs{x-x_n} < \nicefrac{1}{n} . \end{equation*}

As $$\{ \nicefrac{1}{n} \}$$ converges to zero, $$\{ x_n \}$$ converges to $$x\text{.}$$

On the other hand, if we start with a sequence of numbers $$\{ x_n \}$$ in $$S$$ converging to $$x$$ such that $$x_n \not= x$$ for all $$n\text{,}$$ then for every $$\epsilon > 0$$ there is an $$M$$ such that, in particular, $$\abs{x_M - x} < \epsilon\text{.}$$ That is, $$x_M \in (x-\epsilon,x+\epsilon) \cap S \setminus \{x\}\text{.}$$

### Subsection3.1.2Limits of functions

If a function $$f$$ is defined on a set $$S$$ and $$c$$ is a cluster point of $$S\text{,}$$ then we define the limit of $$f(x)$$ as $$x$$ gets close to $$c\text{.}$$ It is irrelevant for the definition whether $$f$$ is defined at $$c$$ or not. Even if the function is defined at $$c\text{,}$$ the limit of the function as $$x$$ goes to $$c$$ can very well be different from $$f(c)\text{.}$$

#### Definition3.1.3.

Let $$f \colon S \to \R$$ be a function and $$c$$ a cluster point of $$S \subset \R\text{.}$$ Suppose there exists an $$L \in \R$$ and for every $$\epsilon > 0\text{,}$$ there exists a $$\delta > 0$$ such that whenever $$x \in S \setminus \{ c \}$$ and $$\abs{x - c} < \delta\text{,}$$ we have

\begin{equation*} \abs{f(x) - L} < \epsilon . \end{equation*}

We then say $$f(x)$$ converges to $$L$$ as $$x$$ goes to $$c\text{.}$$ We say $$L$$ is the limit of $$f(x)$$ as $$x$$ goes to $$c\text{.}$$ We write

\begin{equation*} \lim_{x \to c} f(x) := L , \end{equation*}

or

\begin{equation*} f(x) \to L \quad\text{as}\quad x \to c . \end{equation*}

If no such $$L$$ exists, then we say that the limit does not exist or that $$f$$ diverges at $$c\text{.}$$

Again the notation and language we are using above assumes the limit is unique even though we have not yet proved uniqueness. Let us do that now.

#### Proof.

Let $$L_1$$ and $$L_2$$ be two numbers that both satisfy the definition. Take an $$\epsilon > 0$$ and find a $$\delta_1 > 0$$ such that $$\abs{f(x)-L_1} < \nicefrac{\epsilon}{2}$$ for all $$x \in S \setminus \{c\}$$ with $$\abs{x-c} < \delta_1\text{.}$$ Also find $$\delta_2 > 0$$ such that $$\abs{f(x)-L_2} < \nicefrac{\epsilon}{2}$$ for all $$x \in S \setminus \{c\}$$ with $$\abs{x-c} < \delta_2\text{.}$$ Put $$\delta := \min \{ \delta_1, \delta_2 \}\text{.}$$ Suppose $$x \in S\text{,}$$ $$\abs{x-c} < \delta\text{,}$$ and $$x \not= c\text{.}$$ As $$\delta > 0$$ and $$c$$ is a cluster point, such an $$x$$ exists. Then

\begin{equation*} \abs{L_1 - L_2} = \abs{L_1 - f(x) + f(x) - L_2} \leq \abs{L_1 - f(x)} + \abs{f(x) - L_2} < \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon. \end{equation*}

As $$\abs{L_1-L_2} < \epsilon$$ for arbitrary $$\epsilon > 0\text{,}$$ then $$L_1 = L_2\text{.}$$

#### Example3.1.5.

Consider $$f \colon \R \to \R$$ defined by $$f(x) := x^2\text{.}$$ Then for any $$c \in \R\text{,}$$

\begin{equation*} \lim_{x\to c} f(x) = \lim_{x\to c} x^2 = c^2 . \end{equation*}

Proof: Let $$c \in \R$$ be fixed, and suppose $$\epsilon > 0$$ is given. Write

\begin{equation*} \delta := \min \left\{ 1 , \, \frac{\epsilon}{2\abs{c}+1} \right\} . \end{equation*}

Take $$x \not= c$$ such that $$\abs{x-c} < \delta\text{.}$$ In particular, $$\abs{x-c} < 1\text{.}$$ By reverse triangle inequality, we get

\begin{equation*} \abs{x}-\abs{c} \leq \abs{x-c} < 1 . \end{equation*}

Adding $$2\abs{c}$$ to both sides, we obtain $$\abs{x} + \abs{c} < 2\abs{c} + 1\text{.}$$ We compute

\begin{equation*} \begin{split} \abs{f(x) - c^2} &= \abs{x^2-c^2} \\ &= \abs{(x+c)(x-c)} \\ &= \abs{x+c}\abs{x-c} \\ &\leq (\abs{x}+\abs{c})\abs{x-c} \\ &< (2\abs{c}+1)\abs{x-c} \\ &< (2\abs{c}+1)\frac{\epsilon}{2\abs{c}+1} = \epsilon . \end{split} \end{equation*}

#### Example3.1.6.

Define $$f \colon [0,1) \to \R$$ by

\begin{equation*} f(x) := \begin{cases} x & \text{if } x > 0 , \\ 1 & \text{if } x = 0 . \end{cases} \end{equation*}

Then

\begin{equation*} \lim_{x\to 0} f(x) = 0 , \end{equation*}

even though $$f(0) = 1\text{.}$$

Proof: Let $$\epsilon > 0$$ be given. Let $$\delta := \epsilon\text{.}$$ For $$x \in [0,1)\text{,}$$ $$x \not= 0\text{,}$$ and $$\abs{x-0} < \delta\text{,}$$ we get

\begin{equation*} \abs{f(x) - 0} = \abs{x} < \delta = \epsilon . \end{equation*}

### Subsection3.1.3Sequential limits

Let us connect the limit as defined above with limits of sequences.

#### Proof.

Suppose $$f(x) \to L$$ as $$x \to c\text{,}$$ and $$\{ x_n \}$$ is a sequence such that $$x_n \in S \setminus \{c\}$$ and $$\lim\, x_n = c\text{.}$$ We wish to show that $$\{ f(x_n) \}$$ converges to $$L\text{.}$$ Let $$\epsilon > 0$$ be given. Find a $$\delta > 0$$ such that if $$x \in S \setminus \{c\}$$ and $$\abs{x-c} < \delta\text{,}$$ then $$\abs{f(x) - L} < \epsilon\text{.}$$ As $$\{ x_n \}$$ converges to $$c\text{,}$$ find an $$M$$ such that for $$n \geq M\text{,}$$ we have that $$\abs{x_n - c} < \delta\text{.}$$ Therefore, for $$n \geq M\text{,}$$

\begin{equation*} \abs{f(x_n) - L} < \epsilon . \end{equation*}

Thus $$\{ f(x_n) \}$$ converges to $$L\text{.}$$

For the other direction, we use proof by contrapositive. Suppose it is not true that $$f(x) \to L$$ as $$x \to c\text{.}$$ The negation of the definition is that there exists an $$\epsilon > 0$$ such that for every $$\delta > 0$$ there exists an $$x \in S \setminus \{c\}\text{,}$$ where $$\abs{x-c} < \delta$$ and $$\abs{f(x)-L} \geq \epsilon\text{.}$$

Let us use $$\nicefrac{1}{n}$$ for $$\delta$$ in the statement above to construct a sequence $$\{ x_n \}\text{.}$$ We have that there exists an $$\epsilon > 0$$ such that for every $$n\text{,}$$ there exists a point $$x_n \in S \setminus \{c\}\text{,}$$ where $$\abs{x_n-c} < \nicefrac{1}{n}$$ and $$\abs{f(x_n)-L} \geq \epsilon\text{.}$$ The sequence $$\{ x_n \}$$ just constructed converges to $$c\text{,}$$ but the sequence $$\{ f(x_n) \}$$ does not converge to $$L\text{.}$$ And we are done.

It is possible to strengthen the reverse direction of the lemma by simply stating that $$\{ f(x_n) \}$$ converges without requiring a specific limit. See Exercise 3.1.11.

#### Example3.1.8.

$$\displaystyle \lim_{x \to 0} \, \sin( \nicefrac{1}{x} )$$ does not exist, but $$\displaystyle \lim_{x \to 0} \, x\sin( \nicefrac{1}{x} ) = 0\text{.}$$ See Figure 3.1. Figure 3.1. Graphs of $$\sin(\nicefrac{1}{x})$$ and $$x \sin(\nicefrac{1}{x})\text{.}$$ Note that the computer cannot properly graph $$\sin(\nicefrac{1}{x})$$ near zero as it oscillates too fast.

Proof: We start with $$\sin(\nicefrac{1}{x})\text{.}$$ Define a sequence by $$x_n := \frac{1}{\pi n + \nicefrac{\pi}{2}}\text{.}$$ It is not hard to see that $$\lim\, x_n = 0\text{.}$$ Furthermore,

\begin{equation*} \sin ( \nicefrac{1}{x_n} ) = \sin (\pi n + \nicefrac{\pi}{2}) = {(-1)}^n . \end{equation*}

Therefore, $$\bigl\{ \sin ( \nicefrac{1}{x_n} ) \bigr\}$$ does not converge. By Lemma 3.1.7, $$\lim_{x \to 0} \, \sin( \nicefrac{1}{x} )$$ does not exist.

Now consider $$x\sin(\nicefrac{1}{x})\text{.}$$ Let $$\{ x_n \}$$ be a sequence such that $$x_n \not= 0$$ for all $$n\text{,}$$ and such that $$\lim\, x_n = 0\text{.}$$ Notice that $$\abs{\sin(t)} \leq 1$$ for all $$t \in \R\text{.}$$ Therefore,

\begin{equation*} \abs{x_n\sin(\nicefrac{1}{x_n})-0} = \abs{x_n}\abs{\sin(\nicefrac{1}{x_n})} \leq \abs{x_n} . \end{equation*}

As $$x_n$$ goes to 0, then $$\abs{x_n}$$ goes to zero, and hence $$\bigl\{ x_n\sin(\nicefrac{1}{x_n}) \bigr\}$$ converges to zero. By Lemma 3.1.7, $$\displaystyle \lim_{x \to 0} \, x\sin( \nicefrac{1}{x} ) = 0\text{.}$$

Keep in mind the phrase “for every sequence” in the lemma. For example, take $$\sin(\nicefrac{1}{x})$$ and the sequence given by $$x_n := \nicefrac{1}{\pi n}\text{.}$$ Then $$\bigl\{ \sin (\nicefrac{1}{x_n}) \bigr\}$$ is the constant zero sequence, and therefore converges to zero, but the limit of $$\sin(\nicefrac{1}{x})$$ as $$x \to 0$$ does not exist.

Using Lemma 3.1.7, we can start applying everything we know about sequential limits to limits of functions. Let us give a few important examples.

#### Proof.

Take $$\{ x_n \}$$ be a sequence of numbers in $$S \setminus \{ c \}$$ that converges to $$c\text{.}$$ Let

\begin{equation*} L_1 := \lim_{x\to c} f(x), \qquad \text{and} \qquad L_2 := \lim_{x\to c} g(x) . \end{equation*}

Lemma 3.1.7 says that $$\{ f(x_n) \}$$ converges to $$L_1$$ and $$\{ g(x_n) \}$$ converges to $$L_2\text{.}$$ We also have $$f(x_n) \leq g(x_n)\text{.}$$ We obtain $$L_1 \leq L_2$$ using Lemma 2.2.3.

By applying constant functions, we get the following corollary. The proof is left as an exercise.

Using Lemma 3.1.7 in the same way as above, we also get the following corollaries, whose proofs are again left as exercises.

### Subsection3.1.4Limits of restrictions and one-sided limits

Sometimes we work with the function defined on a subset.

#### Definition3.1.14.

Let $$f \colon S \to \R$$ be a function and $$A \subset S\text{.}$$ Define the function $$f|_A \colon A \to \R$$ by

\begin{equation*} f|_A (x) := f(x) \qquad \text{for } x \in A. \end{equation*}

The function $$f|_A$$ is called the restriction of $$f$$ to $$A\text{.}$$

The function $$f|_A$$ is simply the function $$f$$ taken on a smaller domain. The following proposition is the analogue of taking a tail of a sequence.

#### Proof.

First, let $$c$$ be a cluster point of $$A\text{.}$$ Since $$A \subset S\text{,}$$ then if $$( A \setminus \{ c\} ) \cap (c-\epsilon,c+\epsilon)$$ is nonempty for every $$\epsilon > 0\text{,}$$ then $$( S \setminus \{ c\} ) \cap (c-\epsilon,c+\epsilon)$$ is nonempty for every $$\epsilon > 0\text{.}$$ Thus $$c$$ is a cluster point of $$S\text{.}$$ Second, suppose $$c$$ is a cluster point of $$S\text{.}$$ Then for $$\epsilon > 0$$ such that $$\epsilon < \alpha$$ we get that $$( A \setminus \{ c\} ) \cap (c-\epsilon,c+\epsilon) = ( S \setminus \{ c\} ) \cap (c-\epsilon,c+\epsilon)\text{,}$$ which is nonempty. This is true for all $$\epsilon < \alpha$$ and hence $$( A \setminus \{ c\} ) \cap (c-\epsilon,c+\epsilon)$$ must be nonempty for all $$\epsilon > 0\text{.}$$ Thus $$c$$ is a cluster point of $$A\text{.}$$

Now suppose $$c$$ is a cluster point of $$S$$ and $$f(x) \to L$$ as $$x \to c\text{.}$$ That is, for every $$\epsilon > 0$$ there is a $$\delta > 0$$ such that if $$x \in S \setminus \{ c \}$$ and $$\abs{x-c} < \delta\text{,}$$ then $$\abs{f(x)-L} < \epsilon\text{.}$$ Because $$A \subset S\text{,}$$ if $$x$$ is in $$A \setminus \{ c \}\text{,}$$ then $$x$$ is in $$S \setminus \{ c \}\text{,}$$ and hence $$f|_A(x) \to L$$ as $$x \to c\text{.}$$

Finally suppose $$f|_A(x) \to L$$ as $$x \to c\text{.}$$ For every $$\epsilon > 0$$ there is a $$\delta' > 0$$ such that if $$x \in A \setminus \{ c \}$$ and $$\abs{x-c} < \delta'\text{,}$$ then $$\bigl\lvert f|_A(x)-L \bigr\rvert < \epsilon\text{.}$$ Take $$\delta := \min \{ \delta', \alpha \}\text{.}$$ Now suppose $$x \in S \setminus \{ c \}$$ and $$\abs{x-c} < \delta\text{.}$$ As $$\abs{x-c} < \alpha\text{,}$$ then $$x \in A \setminus \{ c \}\text{,}$$ and as $$\abs{x-c} < \delta'\text{,}$$ we have $$\abs{f(x)-L} = \bigl\lvert f|_A(x)-L \bigr\rvert < \epsilon\text{.}$$

The hypothesis of the proposition is necessary. For an arbitrary restriction we generally only get implication in only one direction, see Exercise 3.1.6.

The usual notation for the limit is

\begin{equation*} \lim_{\substack{x \to c\\x \in A}} f(x) := \lim_{x \to c} f|_A(x) . \end{equation*}

The most common use of restriction with respect to limits are the one-sided limits 1 .

#### Definition3.1.16.

Let $$f \colon S \to \R$$ be function and let $$c$$ be a cluster point of $$S \cap (c,\infty)\text{.}$$ Then if the limit of the restriction of $$f$$ to $$S \cap (c,\infty)$$ as $$x \to c$$ exists, define

\begin{equation*} \lim_{x \to c^+} f(x) := \lim_{x\to c} f|_{S \cap (c,\infty)}(x) . \end{equation*}

Similarly, if $$c$$ is a cluster point of $$S \cap (-\infty,c)$$ and the limit of the restriction as $$x \to c$$ exists, define

\begin{equation*} \lim_{x \to c^-} f(x) := \lim_{x\to c} f|_{S \cap (-\infty,c)}(x) . \end{equation*}

The proposition above does not apply to one-sided limits. It is possible to have one-sided limits, but no limit at a point. For example, define $$f \colon \R \to \R$$ by $$f(x) := 1$$ for $$x < 0$$ and $$f(x) := 0$$ for $$x \geq 0\text{.}$$ We leave it to the reader to verify that

\begin{equation*} \lim_{x \to 0^-} f(x) = 1, \qquad \lim_{x \to 0^+} f(x) = 0, \qquad \lim_{x \to 0} f(x) \quad \text{does not exist.} \end{equation*}

We have the following replacement.

That is, a limit exists if both one-sided limits exist and are equal, and vice versa. The proof is a straightforward application of the definition of limit and is left as an exercise. The key point is that $$\bigl( S \cap (-\infty,c) \bigr) \cup \bigl( S \cap (c,\infty) \bigr) = S \setminus \{ c \}\text{.}$$

### Subsection3.1.5Exercises

#### Exercise3.1.1.

Find the limit (and prove it of course) or prove that the limit does not exist

 a) $$\displaystyle \lim_{x\to c} \sqrt{x} \text{,}$$ for $$c \geq 0$$ b) $$\displaystyle \lim_{x\to c} x^2+x+1 \text{,}$$ for $$c \in \R$$ c) $$\displaystyle \lim_{x\to 0} x^2 \cos (\nicefrac{1}{x})$$ d) $$\displaystyle \lim_{x\to 0}\, \sin(\nicefrac{1}{x}) \cos (\nicefrac{1}{x})$$ e) $$\displaystyle \lim_{x\to 0}\, \sin(x) \cos (\nicefrac{1}{x})$$

#### Exercise3.1.5.

Let $$A \subset S\text{.}$$ Show that if $$c$$ is a cluster point of $$A\text{,}$$ then $$c$$ is a cluster point of $$S\text{.}$$ Note the difference from Proposition 3.1.15.

#### Exercise3.1.6.

Let $$A \subset S\text{.}$$ Suppose $$c$$ is a cluster point of $$A$$ and it is also a cluster point of $$S\text{.}$$ Let $$f \colon S \to \R$$ be a function. Show that if $$f(x) \to L$$ as $$x \to c\text{,}$$ then $$f|_A(x) \to L$$ as $$x \to c\text{.}$$ Note the difference from Proposition 3.1.15.

#### Exercise3.1.7.

Find an example of a function $$f \colon [-1,1] \to \R\text{,}$$ where for $$A:=[0,1]\text{,}$$ we have $$f|_A(x) \to 0$$ as $$x \to 0\text{,}$$ but the limit of $$f(x)$$ as $$x \to 0$$ does not exist. Note why you cannot apply Proposition 3.1.15.

#### Exercise3.1.8.

Find example functions $$f$$ and $$g$$ such that the limit of neither $$f(x)$$ nor $$g(x)$$ exists as $$x \to 0\text{,}$$ but such that the limit of $$f(x)+g(x)$$ exists as $$x \to 0\text{.}$$

#### Exercise3.1.9.

Let $$c_1$$ be a cluster point of $$A \subset \R$$ and $$c_2$$ be a cluster point of $$B \subset \R\text{.}$$ Suppose $$f \colon A \to B$$ and $$g \colon B \to \R$$ are functions such that $$f(x) \to c_2$$ as $$x \to c_1$$ and $$g(y) \to L$$ as $$y \to c_2\text{.}$$ If $$c_2 \in B\text{,}$$ also suppose that $$g(c_2) = L\text{.}$$ Let $$h(x) := g\bigl(f(x)\bigr)$$ and show $$h(x) \to L$$ as $$x \to c_1\text{.}$$ Hint: Note that $$f(x)$$ could equal $$c_2$$ for many $$x \in A\text{,}$$ see also Exercise 3.1.14.

#### Exercise3.1.10.

[note 2 ] Let $$c$$ be a cluster point of $$A \subset \R\text{,}$$ and $$f \colon A \to \R$$ be a function. Suppose for every sequence $$\{x_n\}$$ in $$A\text{,}$$ such that $$\lim\, x_n = c\text{,}$$ the sequence $$\{ f(x_n) \}_{n=1}^\infty$$ is Cauchy. Prove that $$\lim_{x\to c} f(x)$$ exists.

#### Exercise3.1.11.

Prove the following stronger version of one direction of Lemma 3.1.7: Let $$S \subset \R\text{,}$$ $$c$$ be a cluster point of $$S\text{,}$$ and $$f \colon S \to \R$$ be a function. Suppose that for every sequence $$\{x_n\}$$ in $$S \setminus \{c\}$$ such that $$\lim\, x_n = c$$ the sequence $$\{ f(x_n) \}$$ is convergent. Then show that the limit of $$f(x)$$ as $$x \to c$$ exists.

#### Exercise3.1.13.

Suppose $$S \subset \R$$ and $$c$$ is a cluster point of $$S\text{.}$$ Suppose $$f \colon S \to \R$$ is bounded. Show that there exists a sequence $$\{ x_n \}$$ with $$x_n \in S \setminus \{ c \}$$ and $$\lim\, x_n = c$$ such that $$\{ f(x_n) \}$$ converges.

#### Exercise3.1.14.

(Challenging)   Show that the hypothesis that $$g(c_2) = L$$ in Exercise 3.1.9 is necessary. That is, find $$f$$ and $$g$$ such that $$f(x) \to c_2$$ as $$x \to c_1$$ and $$g(y) \to L$$ as $$y \to c_2\text{,}$$ but $$g\bigl(f(x)\bigr)$$ does not go to $$L$$ as $$x \to c_1\text{.}$$

#### Exercise3.1.15.

Show that the condition of being a cluster point is necessary to have a reasonable definition of a limit. That is, suppose $$c$$ is not a cluster point of $$S \subset \R\text{,}$$ and $$f \colon S \to \R$$ is a function. Show that every $$L$$ would satisfy the definition of limit at $$c$$ without the condition on $$c$$ being a cluster point.

#### Exercise3.1.16.

1. Prove Corollary 3.1.13.

2. Find an example showing that the converse of the corollary does not hold.

There are a plethora of notations for one-sided limits. E.g. for $$\lim\limits_{x \to c^-} f(x)$$ one sees $$\lim\limits_{\substack{x \to c\\x < c}} f(x)\text{,}$$ $$\lim\limits_{x \uparrow c} f(x)\text{,}$$ or $$\lim\limits_{x \nearrow c} f(x)\text{.}$$
This exercise is almost identical to the next one. It will be replaced in the next major edition.
For a higher quality printout use the PDF versions: https://www.jirka.org/ra/realanal.pdf or https://www.jirka.org/ra/realanal2.pdf