Theorem 1
If \(f\) and \(g\) are any two functions for which \(\lim\limits_{x\to a} g(x) = L\) and \(f\) is continuous at \(L\), then
\[\lim_{x \to a} f(g(x)) = f(L)\]In other words, if the conditions of this theorem are true, then
\[\lim_{x\to a} f(g(x)) = f\left(\lim_{x\to a} g(x)\right)\]Proof
Since \(\lim\limits_{x\to a} g(x)\) exists, we know that there is some real number \(\delta > 0\) such that \(g(x)\) is defined for all values of \(x\) in the punctured neighborhood \(0 < |x - a| < \delta\).
Therefore, define a new function
\[G(x) = \begin{cases}g(x), & \text{ if } 0 < |x - a| < \delta\\ L, & \text{ if } x = a\end{cases}\]By using the same value of \(\delta\) in the definition of \(\lim\limits_{x\to a} G(x)\), it follows that
\[\lim_{x\to a} G(x) = \lim_{x\to a} g(x) = L\]\(G\) is therefore continuous at \(a\). Since \(f\) is continuous at \(L\), we may apply the theorem of continuity of composite continuous functions to conclude that that \(f(G(x))\) is continuous at \(a\), with the value \(f(L)\) at \(a\).
Since \(f(G(x)) = f(g(x))\) for all values of \(x\) in the punctured neighborhood \(0 < |x - a| < \delta\), it follows that
\[\lim_{x\to a} f(g(x)) = \lim_{x\to a} f(G(x)) = f(L)\]where we have used the definition of continuity for the last equality. This concludes the theorem.
By replacing the limits with one-sided limits, we can conclude that the same theorem holds for one-sided limits, even if the full limit does not exist.
Theorem 2
If \(f\) and \(g\) are any two functions for which \(\lim\limits_{x\to a^+} g(x) = L\) and \(f\) is right-continuous at \(L\), then
\[\lim_{x \to a^+} f(g(x)) = f(L)\]Proof
Since \(\lim\limits_{x\to a^+} g(x)\) exists, we know that there is some real number \(\delta > 0\) such that \(g(x)\) is defined for all values of \(x\) in the punctured neighborhood \(0 < x - a < \delta\), or, rearranged a little, \(a < x < a + \delta\).
Therefore, define a new function
\[G(x) = \begin{cases}g(x), & \text{ if } a < x < a + \delta\\ L, & \text{ if } x = a\end{cases}\]By using the same value of \(\delta\) in the definition of \(\lim\limits_{x\to a^+} G(x)\), it follows that
\[\lim_{x\to a^+} G(x) = \lim_{x\to a^+} g(x) = L\]\(G\) is therefore right-continuous at \(a\). Since \(f\) is right-continuous at \(L\), we may use the continuity of composite continuous functions to conclude that \(f(G(x))\) is right-continuous at \(a\), with the value \(f(L)\) at \(a\).
Since \(f(G(x)) = f(g(x))\) for all values of \(x\) in the punctured neighborhood \(a < x < a + \delta\), it follows that
\[\lim_{x\to a^+} f(g(x)) = \lim_{x\to a^+} f(G(x)) = f(L)\]where we have used the definition of continuity for the last equality. This concludes the theorem.
We can see how simple modifications to this proof would prove the similar theorem for \(\lim\limits_{x\to a^-} f(g(x))\). This theorem also has straightforward generalizations to limits at infinity.
Theorem 3
If \(\lim\limits_{x\to \infty} g(x) = L\) and \(f\) is continuous at \(L\), then
\[\lim_{x \to \infty} f(g(x)) = f(L)\]Proof
We recall that if \(\lim\limits_{x\to \infty} g(x)\) exists, then
\[\lim_{x\to \infty} g(x) = \lim_{x\to 0^+} g\left(\frac{1}{x}\right)\]Therefore, if \(\lim\limits_{x\to \infty} g(x) = L\), it follows that
\[\lim_{x\to 0^+} g\left(\frac{1}{x}\right) = L\]Since \(f\) is continuous at \(L\), the one-sided limit corollary of the original theorem (Theorem 2, above) allows us to conclude that
\[\lim_{x\to 0^+} f\left(g\left(\frac{1}{x}\right)\right) = f(L)\]Since
\[\lim_{x\to \infty} f(g(x)) = \lim_{x\to 0^+} f\left(g\left(\frac{1}{x}\right)\right)\]it follows that
\[\lim_{x\to \infty} f(g(x)) = f(L)\]The appropriate statement holds for limits as \(x\) approaches \(-\infty\) as well. Note that we can push the idea of algebraically finding the limits of composite functions pretty far without having to go down to ε-δ arguments, even if the outer function is not continuous at the limit point, or only has a one-sided limit at the one-sided limit of the inner function! In such delicate cases, we just have to be careful to preserve the one-sidedness of the inner function's limit, since the outer function only has a one-sided limit, or has different limits from either side. An example of what we would do here is given in Example 7 below.
Example 1
If \(f\) is not continuous at \(L\), then the conclusion does not necessarily follow
Let \(f\) be defined by
\[f(x) = \begin{cases}1, & \text{ if } x\in\mathbb{Q}\\ 0, & \text{ otherwise }\end{cases}\]We note that \(f\) has no limit at 0, and therefore is not continuous at 0. Although there is no way to provide a meaningfully accurate graph of this function, Figure 1 shows a figurative picture of the situation to keep in mind. The dotted lines are meant to remind us that only rational numbers, or only irrational numbers, are meant to be on either line. In reality, both lines would appear to be solid, since there is an infinite amount of rational numbers between any two rational numbers, and likewise for irrational numbers.
Let
\[g(x) = \frac{\pi}{\lfloor x\rfloor}\]where \(\lfloor x\rfloor\) is the floor function. An approximate plot of this function might look like this:
Then, since every output value of \(g(x)\) is irrational, we know that \(f(g(x)) = 0\) for all values of \(x > 1\), so we may conclude that \(\lim\limits_{x\to \infty} f(g(x)) = 0\), but
\[f\left(\lim_{x\to \infty} g(x)\right) = f(0) = 1\]which would mislead anyone who tried to apply the result of the theorem without checking whether or not the necessary conditions were true.
Example 2
The non-existence of a limit for the inner function does not imply the non-existence of a limit for the composite function.
Consider the function \(g(x) = \frac{1}{x}\) and the function \(f(x) = \frac{x}{x + 1}\). Their plots are shown below:
Figure 3
Figure 4
Then we note that \(\lim\limits_{x\to 0} g(x)\) does not exist, so \(f\left(\lim\limits_{x\to 0} g(x)\right)\) cannot be calculated. However, \(f(g(x))\) can be simplified to the fraction \(\frac{1}{1 + x}\) for all values of \(x\neq 0\).
Figure 5
Therefore,
\[\lim_{x\to 0} f(g(x)) = \lim_{x\to 0} \frac{1}{1 + x} = 1\] Therefore, once again, someone who naïvely tried to generalize the theorem to imply the non-existence of limits from the failure of one or both of the conditions would be mislead (this is called the fallacy of the inverse, or denying the antecedent).Example 3
The original theorem applied properly
Consider the function \(g(x) = x^2 + 1\) and the function \(f(x) = \ln (x)\).
Figure 6
Figure 7
Then we note that \(\lim\limits_{x\to 0} g(x) = 1\), and \(f\) is continuous at 1, so it follows that
\[\lim_{x\to 0} f(g(x)) = f(1) = 0\]Figure 8
Example 4
The one-sided limit corollary applied properly
Consider the function
\[g(x) = \begin{cases}1, & \text{ if } x > 0\\ 0, & \text{ if } x = 0\\ -1, & \text{ otherwise }\end{cases}\]and the function \(f(x) = e^x\).
Figure 9
Figure 10
Then we note that \(\lim\limits_{x\to 0^+} g(x) = 1\), and \(f\) is continuous at 1, so it follows that
\[\lim_{x\to 0} f(g(x)) = f(1) = e\]Figure 11
Example 5
A second example showing what could happen if \(f\) is not continuous at \(L\)
Consider the function
\[f(x) = \begin{cases}1, & \text{ if } x > 0\\ 0, & \text{ if } x = 0\\ -1, & \text{ otherwise }\end{cases}\]and the function \(g(x) = x\).
Figure 12
Figure 13
Then we note that \(\lim\limits_{x\to 0} g(x) = 0\), but \(f\) is not continuous at 0, so we cannot apply the theorem to conclude that
\[\lim_{x\to 0} f(g(x)) = f(0) = 0\] In fact, for these two functions, \(f(g(x)) = f(x)\), so it is straightforward to see that \(\lim\limits_{x\to 0} f(g(x))\) does not exist.Figure 14
Example 6
An application of the corollary of the theorem at \(-\infty\)
Consider the function \(f(x) = e^x\) and the function \(g(x) = e^x\).
Figure 15
Figure 16
Then we note that \(\lim\limits_{x\to -\infty} g(x) = 0\), and \(f\) is continuous at 0, so we may use the corollary of the theorem to conclude that
\[\lim_{x\to -\infty} f(g(x)) = f(0) = 1\]Figure 17
Example 7
It is still possible to analyze some composite limits if the outer and inner functions have compatible one-sided limits.
This is another demonstration that proper limits can exist when the antecedents of this theorem are false, and we can analyze them in a similar way, as long as we are careful to consider the one-sided way in which the inner function is approaching its one-sided limit. Define
\[f(x) = \begin{cases}x - 1, & \text{ if } x < 0\\ x + 1, & \text{ if } x > 0\end{cases}\]and
\[g(x) = \begin{cases}1 - x, & \text{ if } x < 1\\ x, & \text{ if } x > 1\end{cases}\]Figure 18
Figure 19
Consider \(\lim\limits_{x\to 1^-} f(g(x))\). We note that \(\lim\limits_{x\to 1^-} g(x) = 0\), but \(f\) is not continuous at 0, so we cannot use the theorem.
However, we also note that \(g(x)\) is behaving like a variable that is approaching \(0\) from above, that is to say, we can see the ability to set up a one-sided limit for a function that depends on \(g(x)\) as a variable in a continuous punctured neighborhood of values of the form \(0 < g(x) - 0 < \delta\).
Thus, we can claim that \(\lim\limits_{x\to 1^-} f(g(x)) = \lim\limits_{g\to 0^+} f(g)\), where \(g\) is now being treated as an ordinary variable in the domain of \(f\). The correct conclusion follows:
\[\lim\limits_{x\to 1^-} f(g(x)) = \lim\limits_{g\to 0^+} f(g) = 1\]Figure 20
History
Cauchy stated a similar theorem as Theorem I of Chapter 2, Section 2 of his 1821 textbook Cours d'Analyse, where he says:
Si les variables \(x,y,z,\dots\) ont pour limites respectives les quantités fixes et déterminées \(X,Y,Z,\dots\), et que la fonction \(f(x,y,z,\dots )\) soit continue par rapport à chacune des variables \(x,y,z,\dots \) dans le voisinage du système des valeurs particulières
\[x = X, y = Y, z = Z, \dots,\]\(f(x,y,z,\dots )\) aura pour limite \(f(X,Y,Z,\dots )\).
Translated to English, it reads as:
If the variables \(x,y,z,\dots\) have for their respective limits the fixed and determined quantities \(X,Y,Z,\dots\), and if the function \(f(x,y,z,\dots )\) is continuous with respect to each of the variables \(x,y,z,\dots \) in the neighborhood of the system of particular values
\[x = X, y = Y, z = Z, \dots,\]\(f(x,y,z,\dots )\) will have for its limit \(f(X,Y,Z,\dots )\).
While it is clear that Cauchy wanted to make as general a statement as possible by starting out with statements about multivariable functions, the modern student will notice that his theorem is false as stated (see this counterexample). It is true, however, for single variable functions.
The oldest explicit and correct statement of this theorem that I can find in the literature is as an exercise in Chapter 6 of Spivak's 1967 textbook Calculus, where the instructions state:
Prove that if \(f\) is continuous at \(l\) and \(\lim\limits_{x\to a} g(x) = l\), then \(\lim\limits_{x\to a} f(g(x)) = f(l)\).
It is possible that previous mathematicians knew of this theorem, but thought it a trivial consequence of the theorem of the composition of continuous functions, so as not to merit an explicit statement. This is understandable, due to the fact that very few textbooks of earlier periods focused on limits as their primary object of study for as long as Spivak does (as opposed to showing the bare minimum necessary in order to move on to demonstrating how derivatives and integrals could be rigorously defined using limits).
References
- Cauchy, Augustin-Louis (1821). Cours d'Analyse de L'École Royale Polytechnique
- Spivak, Michael (1967). Calculus W. A. Benjamin, New York.