π Limit of a function#
β± | words
References and additional materials

[Sydsæter, Hammond, Strøm, and Carvajal, 2016]
Chapters 6.5, 7.9
Why calculus is done with real numbers and not just rational video by Michael Penn
Consider a univariate function \(f: \mathbb{R} \rightarrow \mathbb{R}\) written as \(f(x)\)
The domain of \(f\) is \(\mathbb{R}\), the range of \(f\) is a (possibly improper) subset of \(\mathbb{R}\)
[Spivak, 2006] (p. 90) provides the following informal definition of a limit: βThe function \(f\) approaches the limit \(l\) near [the point \(x =\)] \(a\), if we can make \(f(x)\) as close as we like to \(l\) by requiring that \(x\) be sufficiently close to, but unequal to, \(a\).β
Definition
The function \(f: \mathbb{R} \rightarrow \mathbb{R}\) approaches the limit \(l\) near [the point \(x = a\)] if for every \(\epsilon > 0\), there is some \(\delta > 0\) such that, for all \(x\) such as \(0 < |x β a| < \delta\), \(|f(x) β l | < \epsilon\).
The absolute value \(|\cdot|\) in this definition plays the role of general distance function \(\|\cdot\|\) which would be appropriate for the functions from \(\mathbb{R}^n\) to \(\mathbb{R}^k\). We will also use \(d(x,a)\) to denote distance, i.e. \(d(x,a) = |x-a|\) in multivariate cases later in the course.
Suppose that the limit of \(f\) as \(x\) approaches \(a\) is \(l\). We can write this as

Fig. 24 An illustration of an epsilon-delta limit argument#
The structure of \(\epsilonβ\delta\) arguments#
Suppose that we want to attempt to show that \(\lim _{x \rightarrow a} f(x)=b\).
In order to do this, we need to show that, for any choice \(\epsilon>0\), there exists some \(\delta_{\epsilon}>0\) such that, whenever \(|x-a|<\delta_{\epsilon}\), it is the case that \(|f(x)-b|<\epsilon\).
We write \(\delta_{\epsilon}\) to indicate that the choice of \(\delta\) is allowed to vary with the choice of \(\epsilon\).
An often fruitful approach to the construction of a formal \(\epsilon\)-\(\delta\) limit argument is to proceed as follows:
Start with the end-point that we need to establish: \(|f(x)-b|<\epsilon\).
Use appropriate algebraic rules to rearrange this βfinalβ inequality into something of the form \(|k(x)(x-a)|<\epsilon\).
This new version of the required inequality can be rewritten as \(|k(x)||(x-a)|<\epsilon\).
If \(k(x)=k\), a constant that does not vary with \(x\), then this inequality becomes \(|k||x-a|<\epsilon\). In such cases, we must have \(|x-a|<\frac{\epsilon}{|k|}\), so that an appropriate choice of \(\delta_{\epsilon}\) is \(\delta_{\epsilon}=\frac{\epsilon}{|k|}\).
If \(k(x)\) does vary with \(x\), then we have to work a little bit harder.
Suppose that \(k(x)\) does vary with \(x\). How might we proceed in that case? One possibility is to see if we can find a restriction on the range of values for \(\delta\) that we consider that will allow us to place an upper bound on the value taken by \(|k(x)|\).
In other words, we try and find some restriction on \(\delta\) that will ensure that \(|k(x)|<K\) for some finite \(K>0\). The type of restriction on the values of \(\delta\) that you choose would ideally look something like \(\delta<D\), for some fixed real number \(D>0\). (The reason for this is that it is typically small deviations of \(x\) from a that will cause us problems rather than large deviations of \(x\) from a.)
If \(0<|k(x)|<K\) whenever \(0<\delta<D\), then we have
In such cases, an appropriate choice of \(\delta_{\epsilon}\) is \(\delta_{\epsilon}=\min \left\{\frac{\epsilon}{K}, D\right\}\).
Example
Consider the mapping \(f: \mathbb{R} \longrightarrow \mathbb{R}\) defined by \(f(x)=7 x-4\).
We want to show that \(\lim _{x \rightarrow 2} f(x)=10\).
Note that \(|f(x)-10|=|7 x-4-10|=|7 x-14|=|7(x-2)|=\) \(|7||x-2|=7|x-2|\).
We require \(|f(x)-10|<\epsilon\), but:
Thus, for any \(\epsilon>0\), if \(\delta_{\epsilon}=\frac{\epsilon}{7}\), then \(|f(x)-10|<\epsilon\) whenever \(|x-2|<\delta_{\epsilon}\).
Example
Consider the mapping \(f: \mathbb{R} \longrightarrow \mathbb{R}\) defined by \(f(x)=x^{2}\)
We want to show that \(\lim _{x \rightarrow 2} f(x)=4\).
Note that \(|f(x)-4|=\left|x^{2}-4\right|=|(x+2)(x-2)|=|x+2||x-2|\).
Suppose that \(|x-2|<\delta\), which in turn means that \((2-\delta)<x<(2+\delta)\). Thus we have \((4-\delta)<(x+2)<(4+\delta)\).
Let us restrict attention to \(\delta \in(0,1)\). This gives us \(3<(x+2)<5\), so that \(|x+2|<5\).
Thus, when \(|x-2|<\delta\) and \(\delta \in(0,1)\), we have \(|f(x)-4|=|x+2||x-2|<5 \delta\).
We require \(|f(x)-4|<\epsilon\). One way to ensure this is to set \(\delta_{\epsilon}=\min \left(1, \frac{\epsilon}{5}\right)\).
Example
Consider the mapping \(f: \mathbb{R} \rightarrow \mathbb{R}\) defined by \(f(x) = x^2 β 3x + 1\).
We want to show that \(\lim_{x \rightarrow 2} f(x ) = β1\).
Note that \(|f(x) β (β1)| = |x^2 β 3x + 1 + 1| = |x^2 β 3x + 2|\) \(= |(x β 1)(x β 2)| = |x β 1||x β 2|\).
Suppose that \(|x β 2| < \delta\), which in turn means that \((2 β \delta) < x < (2 + \delta)\). Thus we have \((1 β \delta) < (x β 1) < (1 + \delta)\).
Let us restrict attention to \(\delta \in (0, 1)\). This gives us \(0 < (x β 1) < 2\), so that \(|x β 1| < 2\).
Thus, when \(|x β 2| < \delta\) and \(\delta \in (0, 1)\), we have \(|f(x) β (β1)| = |x β 1||x β 2| < 2\delta\).
We require \(|f(x) β (β1)| < \epsilon\). One way to ensure this is to set \(\delta_\epsilon = \min(1, \frac{\epsilon}{2} )\).
The above examples are drawn from Willis Lauritz Peterson of the University of Utah
A useful fact in these derivations is also
Fact
For any \(a, b \in \mathbb{R}\) which have opposite signs \(ab<0\) it holds that
Proof
Draw a picture, careful with implication direction!
Example
Consider the mapping \(f: \mathbb{R} \rightarrow \mathbb{R}\) defined by \(f(x) = \exp(x-1)\).
We want to show that \(\lim_{x \rightarrow 2} f(x) = e\)
We need to ensure that for any \(\epsilon>0\) it holds that \(|f(x) β e| < \epsilon\), i.e. \(|\exp(x-1) β e| < \epsilon\)
It is clear that \(\ln(e)-1 = 0\), therefore \(\ln(e-\epsilon)-1 < 0\), and similarly \(\ln(e+\epsilon)-1 > 0\). Therefore
Thus, taking \(\delta = \min\{ 1-\ln(e-\epsilon),\ln(e+\epsilon)-1\}\) ensures the required inequality.
We can further simplify by analyzing the minimum itself to conclude that it is attained at \(1-\ln(e-\epsilon)\).
Heine and Cauchy definitions of the limit for functions#
As a side note, letβs mention that there are two ways to define the limit of a function \(f\).
The above \(\epsilon\)-\(\delta\) definition is is due to Augustin-Louis Cauchy.
The limit for functions can also be defined through the limit of sequences we were talking about in the last lecture. This equivalent definition is due to Eduard Heine
Definition (Limit of a function due to Heine)
Given the function \(f: A \subset \mathbb{R} \to \mathbb{R}\), \(a \in \mathbb{R}\) is a limit of \(f(x)\) as \(x \to x_0 \in A\) if
note the crucial requirement that \(f(x_n) \to a\) has to hold for all converging to \(x_0\) sequences \(\{x_n\}\) in \(A\)
note also how the Cauchy definition is similar to the definition of a limit to a sequence
Fact
Cauchy and Heine definitions of the function limit are equivalent
Therefore we can use the same notation of the definition of the limit of a function
Properties of the limits#
In practice, we would like to be able to find at least some limits without having to resort to the formal βepsilon-deltaβ arguments that define them. The following rules can sometimes assist us with this.
Fact
Let \(c \in \mathbb{R}\) be a fixed constant, \(a \in \mathbb{R}, \alpha \in \mathbb{R}, \beta \in \mathbb{R}, n \in \mathbb{N}\), \(f: \mathbb{R} \longrightarrow \mathbb{R}\) be a function for which \(\lim _{x \rightarrow a} f(x)=\alpha\), and \(g: \mathbb{R} \longrightarrow \mathbb{R}\) be a function for which \(\lim _{x \rightarrow a} g(x)=\beta\). The following rules apply for limits:
\(\lim _{x \rightarrow a} c=c\) for any \(a \in \mathbb{R}\).
\(\lim _{x \rightarrow a}(c f(x))=c\left(\lim _{x \rightarrow a} f(x)\right)=c \alpha\).
\(\lim _{x \rightarrow a}(f(x)+g(x))=\left(\lim _{x \rightarrow a} f(x)\right)+\left(\lim _{x \rightarrow a} g(x)\right)=\alpha+\beta\).
\(\lim _{x \rightarrow a}(f(x) g(x))=\left(\lim _{x \rightarrow a} f(x)\right)\left(\lim _{x \rightarrow a} g(x)\right)=\alpha \beta\).
\(\lim _{x \rightarrow a}\left(\frac{f(x)}{g(x)}\right)=\frac{\lim _{x \rightarrow a} f(x)}{\lim _{x \rightarrow a} g(x)}=\frac{\alpha}{\beta}\) whenever \(\beta \neq 0\).
\(\lim _{x \rightarrow a} \sqrt[n]{f(x)}=\sqrt[n]{\lim _{x \rightarrow a} f(x)}=\sqrt[n]{\alpha}\) whenever \(\sqrt[n]{\alpha}\) is defined.
\(\lim _{x \rightarrow a} \ln f(x)=\ln \lim _{x \rightarrow a} f(x)=\ln \alpha\) whenever \(\ln \alpha\) is defined.
\(\lim _{x \rightarrow a} e^{f(x)}=\exp\big(\lim _{x \rightarrow a} f(x)\big)=e^{\alpha}\)
After we have learned about differentiation, we will learn about another useful rule for limits that is known as βLβHopitalβs ruleβ.
Fact
Weak inequalities are preserved in the limit. Consider two functions \(f: \mathbb{R} \to \mathbb{R}\) and \(g: \mathbb{R} \to \mathbb{R}\), when limits with \(x \to x_0\) exist, it holds that
Fact (Squeeze theorem)
Consider three functions \(f: \mathbb{R} \to \mathbb{R}\), \(g: \mathbb{R} \to \mathbb{R}\) and \(h: \mathbb{R} \to \mathbb{R}\). If
then \(\lim_{x \to x_0} g(x) = L\).
statement both about existence of the limit for \(g(x)\) as \(x \to x_0\)
and about the value of this limit

Example
Limits can sometimes exist even when the function being considered is not so well behaved. One such example is provided by [Spivak, 2006] (pp. 91β92). It involves the use of a trigonometric function.
The example involves the function \(f: \mathbb{R} \setminus 0 \rightarrow \mathbb{R}\) that is defined by \(f(x) = x \sin ( \frac{1}{x})\).
Clearly this function is not defined when \(x = 0\). Furthermore, it can be shown that \(\lim_{x \rightarrow 0} \sin ( \frac{1}{x})\) does not exist. However, it can also be shown that \(\lim_{x \rightarrow 0} f(x) = 0\).
The reason for this is that \(\sin (\theta) \in [β1, 1]\) for all \(\theta \in \mathbb{R}\). Thus \(\sin ( \frac{1}{x} )\) is bounded above and below by finite numbers as \(x \rightarrow 0\). This allows the \(x\) component of \(x \sin (\frac{1}{x})\) to dominate as \(x \rightarrow 0\).
Formally, we can use the squeeze theorem noting that \(-1 \leqslant \sim(1/x) \leqslant 1\). We can write the following double inequality and take limits on the left and right sides as \(x \to 0\):
Therefore by the squeeze theorem \(\lim_{x \to 0} x \sin (\tfrac{1}{x}) = 0\).
Example
Limits do not always exist. In this example, we consider a case in which the limit of a function as \(x\) approaches a particular point does not exist.
Consider the mapping \(f: \mathbb{R} \rightarrow \mathbb{R}\) defined by
We want to show that \(\lim_{x \rightarrow 5} f(x)\) does not exist.
Suppose that the limit does exist. Denote the limit by \(l\). Let \(\delta > 0\).
If \(|5 β x | < \delta\), then \(5 β \delta < x < 5 + \delta\), so that \(x \in (5 β \delta, 5 + \delta) = (5 β \delta, 5) \cup [5, 5 + \delta)\), where \((5 β \delta, 5) \ne \varnothing\) and \([5, 5 + \delta) \ne \varnothing\).
Thus we know the following:
There exist some \(x \in (5 β \delta, 5) \subseteq (5 β \delta, 5 + \delta)\), so that \(f(x) = 0\) for some \(x \in (5 β \delta, 5 + \delta)\).
There exist some \(x \in [5, 5 + \delta) \subseteq (5 β \delta, 5 + \delta)\), so that \(f(x) = 1\) for some \(x \in (5 β \delta, 5 + \delta)\).
The image set under \(f\) for the interval \((5 β \delta, 5 + \delta)\) is \(f \big((5 β \delta, 5 + \delta)\big) = \{ f(x) : x \in (5 β \delta, 5 + \delta) \} = \{ 0, 1 \} \subseteq [0, 1]\).
Note that for any choice of \(\delta > 0\), \([0, 1]\) is the smallest connected interval that contains the image set \(f \big((5 β \delta, 5 + \delta)\big) = \{ 0, 1 \}\).
Hence, in order for the limit to exist, we need \([0, 1] \subseteq (l β \epsilon, l + \epsilon)\) for all \(\epsilon > 0\). But for \(\epsilon \in (0, \frac{1}{2})\), there is no \(l \in \mathbb{R}\) for which this is the case. Thus we can conclude that \(\lim_{x \rightarrow 5} f(x)\) does not exist.
Example
In the above example the limit definition by Heine is also useful for the proof.
Consider two sequences \(\{x_n\}\) and \(\{y_n\}\) such that \(x_n \to 5\) and \(y_n \to 5\). Let \(x_n = 5 - 1/n\) and \(y_n = 5+ 1/n\).
Function \(f(x)\) computed at the values of \(\{x_n\}\) forms a sequence of zeros which converges to \(0\).
Function \(f(x)\) computed at the values of \(\{y_n\}\) forms a sequence of ones which converges to \(1\).
Therefore, the limit of \(f(x)\) does not exist.
Function continuity#
Our focus here is on continuous real-valued functions of a single real variable. In other words, functions of the form \(f : X \rightarrow \mathbb{R}\) where \(X \subseteq \mathbb{R}\).
Before looking at the picky technical details of the concept of continuity, it is worth thinking about that concept intuitively. Basically, a real-valued function of a single real-valued variable is continuous if you could potentially draw its graph without lifting your pen from the page. In other words, there are no holes in the graph of the function and there are no jumps in the graph of the function.
Definition
Let \(f \colon A \to \mathbb{R}\)
\(f\) is called continuous at \(a \in A\) if
Or, alternatively,
Definition
\(f: A \to \mathbb{R}\) is called continuous if it is continuous at every \(x \in A\)

Fig. 25 Continuous function#
Example
Function \(f(x) = \exp(x)\) is continuous at \(x=0\)
Proof:
Consider any sequence \(\{x_n\}\) which converges to \(0\)
We want to show that for any \(\epsilon>0\) there exists \(N\) such that \(n \geq N \implies |f(x_n) - f(0)| < \epsilon\). We have
Because due to \(x_n \to x\) for any \(\epsilon' = \ln(1-\epsilon)\) there exists \(N\) such that \(n \geq N \implies |x_n - 0| < \epsilon'\), we have \(f(x_n) \to f(x)\) by definition. Thus, \(f\) is continuous at \(x=0\).
Fact
Some functions known to be continuous on their domains:
\(f: x \mapsto x^\alpha\)
\(f: x \mapsto |x|\)
\(f: x \mapsto \log(x)\)
\(f: x \mapsto \exp(x)\)
\(f: x \mapsto \sin(x)\)
\(f: x \mapsto \cos(x)\)
Fact
Let \(f\) and \(g\) be functions and let \(\alpha \in \mathbb{R}\)
If \(f\) and \(g\) are continuous at \(x\) then so is \(f + g\), where
If \(f\) is continuous at \(x\) then so is \(\alpha f\), where
If \(f\) and \(g\) are continuous at \(x\) then so is \(f \cdot g\), where
If \(g(x) \ne 0\), \(f\) and \(g\) are continuous at \(x\) then so is \(f / g\), where
If \(f\) and \(g\) are continuous at \(x\) and real valued then so is \(f \circ g\), where
Proof
Just repeatedly apply the properties of the limits
Letβs just check that
Let \(f\) and \(g\) be continuous at \(x\)
Pick any \(x_n \to x\)
We claim that \(f(x_n) + g(x_n) \to f(x) + g(x)\)
By assumption, \(f(x_n) \to f(x)\) and \(g(x_n) \to g(x)\)
From this and the triangle inequality we get
As a result, set of continuous functions is βclosedβ under elementary arithmetic operations
Example
The function \(f \colon \mathbb{R} \to \mathbb{R}\) defined by
is continuous (we just have to be careful to ensure that denominator is not zero β which it is not for all \(x\in\mathbb{R}\))
Types of discontinuities#

Fig. 26 4 common types of discontinuity#
Example
The indicator function \(x \mapsto \mathbb{1}\{x > 0\}\) has a jump discontinuity at \(0\).
Example
An example of oscillating discontinuity is the function \(f(x) = \sin(1/x)\) which is discontinuous at \(x=0\).
Example
Consider the mapping \(f : \mathbb{R} \rightarrow \mathbb{R}\) defined by \(f(x ) = x^2\). We want to show that \(f(x)\) is continuous at the point \(x = 2\).
Note that \(|f (2) β f(x)| = |f(x) β f (2)| = |x^2 β 4| = |x β 2||x + 2|\).
Suppose that \(|2 β x | < \delta\). This means that \(|x β 2| < \delta\), which in turn means that \((2 β \delta) < x < (2 + \delta)\). Thus we have \((4 β \delta) < (x + 2) < (4 + \delta)\).
Let us restrict attention to \(\delta \in (0, 1)\). This gives us \(3 < (x + 2) < 5\), so that \(|x + 2| < 5\).
We have \(|f (2) β f(x)| = |f(x) β f (2)| = |x β 2||x + 2| < (\delta)(5) = 5\delta\).
We require \(|f (2) β f(x)| < \epsilon\). One way to ensure this is to set \(\delta = \min(1, \frac{\epsilon}{5})\).
Example
Consider the mapping \(f: \mathbb{R} \rightarrow \mathbb{R}\) defined by
We have already shown that \(\lim_{x \rightarrow 5} f(x)\) does not exist. This means that it is impossible for \(\lim_{x \rightarrow 5} f(x) = f (5)\). As such, we know that \(f(x)\) is not continuous at the point \(x = 5\).
This means that f(x) is not a continuous function.
However, it can be shown that (i) \(f(x )\) is continuous on the interval \((β\infty, 5)\), and that (ii) \(f(x)\) is continuous on the interval \((5, \infty)\). Why this is the case?
Example
Consider the mapping \(f: \mathbb{R} \rightarrow \mathbb{R}\) defined by
This function is a rectangular hyperbola when \(x \ne 0\), but it takes on the value \(0\) when \(x = 0\). Recall that the rectangular hyperbola part of this function is not defined at the point \(x = 0\).
This function is discontinuous at the point \(x = 0\). Illustrate the graph of this function on the whiteboard.
Example
Consider the mapping \(f: \mathbb{R} \rightarrow \mathbb{R}\) defined by
This function is sometimes known as Dirichletβs discontinuous function. It is discontinuous at every point in its domain.
One-sided limits#
Definition
Given the function \(f: A \subset \mathbb{R} \to \mathbb{R}\), \(a \in \mathbb{R}\) is a limit from above of \(f(x)\) as \(x \to x_0^+ \in A\) if
Notation for the limit from above is
Definition
Given the function \(f: A \subset \mathbb{R} \to \mathbb{R}\), \(a \in \mathbb{R}\) is a limit from below of \(f(x)\) as \(x \to x_0^- \in A\) if
Notation for the limit from below is
Note
Compare to normal Heine limit definition
One-sided limits are useful for defining continuity of functions on closed intervals and in other situations
Fact
If \(\lim_{x \to x_0} f(x) = a\) then \(\lim_{x \to x_0^+} f(x) = \lim_{x \to x_0^-} f(x) = a\).
If \(\lim_{x \to x_0^+} f(x) = \lim_{x \to x_0^-} f(x) = a\) then \(\lim_{x \to x_0} f(x) = a\).
Proof
Proof is by careful definition of Heine limit and observing that the restrictions on the sequences in the one-sided limits are complementary. \(\blacksquare\)
When the two one-sided limits of a function take different values, the function has a jump discontinuity at that point

Fact
All properties of the limits hold for one-sided limits.
Limit at infinity#
Consider the logistic function (aka sigmoid)

How to express the notion that the function approaches \(1\) as \(x\) goes to infinity?
Definition
The function \(f: \mathbb{R} \rightarrow \mathbb{R}\) approaches the limit \(l\) at infinity if for every \(\epsilon > 0\), there is some \(M > 0\) such that, for all \(x\) such as \(x > M\), \(|f(x) β l | < \epsilon\).
Limit at infinity is denoted as
Definition
The function \(f: \mathbb{R} \rightarrow \mathbb{R}\) approaches the limit \(l\) at negative infinity if for every \(\epsilon > 0\), there is some \(M < 0\) such that, for all \(x\) such as \(x < M\), \(|f(x) β l | < \epsilon\).
Limit at negative infinity is denoted as
Example
In statistics, the probability density functions have zero limit on infinity and negative infinity, and cumulative distribution functions have limits of 1 and 0 on infinity and negative infinity, respectively.
Fact
Limits at infinity support addition and multiplication rules for limits:
But not subtraction and division rules!
Example
Now, compute their limits as \( x \to \infty \):
The division of these functions is:
Simplifying,
However, applying the division rule formally would suggest infinity over infinity which is an indeterminate form.