# Limit Laws for Composite Functions

There are two rules I've seen for composite Limits. The first one is:

If $$f(x)$$ is continuous at $$x=b$$ and $$\newcommand{\limto}[2]{\lim\limits_{{#1}\to{#2}}}\limto xa g(x)=b$$ then, $$\limto xa f(g(x))= f \left( \limto xa g(x)\right) = f(b).$$

Assume that $$g(x)$$ and $$f(x)$$ are two functions. Assume that the domain of $$g(x)$$ contains an open interval containing $$a$$, with exception of possibly $$a$$, and that the domain of $$f(x)$$ contains an interval containing $$b$$, with exception of possibly $$b$$.
Furthermore assume that for some number $$L$$ $$\limto xa g(x)=b \qquad\text{and}\qquad \limto yb f(y)=L.$$ Then $$\limto xa f\circ g(x) = \limto yb f(y) = L.$$

I was wondering if these are saying the same thing, with different variables, or if the 1st case is just a special case of the 2nd. It seems to me like they have different conditions (continuity vs a limit existing).

Is there a way to remember both of these in one rule?

• They say essentially the same thing. The second one has ever so slightly weaker hypotheses. You are unlikely ever to encounter a situation where the first won't work and the second will. Just focus on understanding what they say. Dec 26, 2021 at 2:42
• I don't remember those two as a separate theorem. They are basically saying the same concept, i.e. convergence can be conveyed by composition when $f$ and $g$ both converge. As @Ethan pointed out, the difference is technical but not that essential. It is good to recognize the slight difference though.
– I H
Dec 26, 2021 at 2:52
• For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to. (To help you get started, I have edited the post a bit.) Dec 26, 2021 at 12:41
• Thanks Martin, will do Dec 27, 2021 at 4:08

The theorem deals with the following situation. We're given that $$\lim_{x\to a}g(x)=b$$ and $$\lim_{x\to b}f(x)=L$$. We want to conclude that $$\lim_{x\to a}f(g(x))=L$$. The intuition is that as $$x\to a$$, $$g(x)$$ is close to $$b$$ (by the first limit), and if $$g(x)$$ is close to $$b$$, then $$f(g(x))$$ is close to $$L$$ (by the second limit). Putting these two statements together, the desired conclusion "should" follow.
However, the two versions you cited aren't saying the same thing. Notice that the first version additionally assumes that $$f$$ is continuous at $$x=b$$. The second version is actually wrong. Here's a simple example which demonstrates the issue: $$g(x)=0\text{ for all }x\in\mathbb{R}\\ f(x)=\begin{cases}1, & x\ne 0\\ 0, & x=0\end{cases}$$ We have $$\lim_{x\to 0}g(x)=0$$ and $$\lim_{x\to 0}f(x)=1$$. If you were to apply the second version, you'd expect $$\lim_{x\to 0}f(g(x))=1$$. But that's wrong because $$f(g(x))=0$$ for all $$x$$, so the last limit is $$0$$. Meanwhile, you can't apply the first version because $$f$$ is not continuous at $$x=0$$. In other words, an additional assumption (as in the first version) is needed to make this theorem work (more details here). In practice, though, the functions we work with are "nice" enough that we usually don't have to bother checking these things.
• Excellent answer! People always want the Chain Rule for limits to be simpler than it really is. (I know I do!) It might be worth noticing where the error lies in the cited reference's alleged proof of the incorrect theorem: they set up $\epsilon$s and $\delta$s so that $|f(y)-L|<\epsilon$ whenever $0<|y-b|<\delta_1$ and so that $|g(x)-b|<\delta_1$ whenever $0<|x-a|<\delta_2$, then conclude that $|f(g(x))-L|<\epsilon$ whenever $0<|x-a|<\delta_2$. But you can't chain these together, because $|g(x)-b|<\delta_1$ does not imply $0<|g(x)-b|<\delta_1$. Dec 26, 2021 at 3:08
• (That proof is also riddled with typos, writing $f(b)$ once when it should be $f(y)$, $g(a)$ once when it should be $g(x)$, and $<\epsilon]<\delta_1$ twice when it should be $<\delta_1$, which leads to unbalanced brackets. I fixed the typos in my comment above, but that doesn't fix the proof.) Dec 26, 2021 at 3:10
• @bgcode I added something to my answer to explain the gist of the theorem (I feel like I sent you too deep into technicalities). Also, I wouldn't count it as separate. Notice that in the first version, $f$ continuous at $x=b$ means that you have $\lim_{x\to b}f(x)=L=f(b)$, just as elsewhere. Dec 26, 2021 at 3:54
• Aren't there these two differences between them: 1) the variables approach different values in the 2nd one, while it's only x approaching $a$ in the first one. 2) in the 2nd one (using wiki, instead of the faulty proof I linked), it can apparently can work so long as "g does not take the value b near a" Dec 26, 2021 at 4:01