# How does the chain rule for limits work?

I have to evaluate the limit of this function,

$$\lim_{x\to0^+} \arctan(\ln x)$$

I already know the answer, it's $-\dfrac{π}{2}$, but the only part I don't get it, how does it come to that? I did the following steps:

$$\lim_{x\to0^+} \arctan(\ln x) = \arctan\left(\lim_{x\to0^+} \ln x\right)$$

The limit of $\ln(x)$ when $x$ approaces $0^+$ is negative infinity, wouldn't that mean the answer we're looking for is arctan of negative infinity, which is something we can't find?

Still, it goes to:

$$\lim_{x\to -\infty} \arctan (x) = -\dfrac{\pi}{2}$$, which is how the answer seem to work? How does this happen? And, how does the chain rule come in all this?

• You don't mean "chain rule" here, rather "composition of functions". – Doc Sep 24 '13 at 1:26
• @Doc : Any rule about how to apply an operation to a composite of functions may be called a chain rule. The chain rule for differentiation is most famous, but there's also a chain rule for limits. (Similarly for product rules, sum rules, etc.) – Toby Bartels Feb 16 '19 at 5:12
• Where you read that? @TobyBartels – Eduardo Sebastian Jun 14 '20 at 22:47
• @EduardoS. : You can read it at google.com/search?q=%22chain+rule+for+limits%22 (or google.com/search?tbm=bks&q=%22chain+rule+for+limits%22 if you only want to see it in textbooks). The book search gives very few hits, but it probably leaves out most textbooks that use the term; a book that lists a ‘chain rule’ in a chapter on ‘limits’ without using the exact phrase ‘chain rule for limits’ is harder to search for. (I can probably find such a book when I get back to my office in August.) – Toby Bartels Jun 15 '20 at 21:52
• There are some more results at google.com/search?q=%22limit+chain+rule%22 (but the results at google.com/search?tbm=bks&q=%22limit+chain+rule%22 are all false positives, so ‘limit chain rule’ seems to be only an informal term). – Toby Bartels Jun 15 '20 at 22:07

Look at the expression $$\lim_{x \to 0^+} \arctan(\ln x)$$ Let $u = \ln x$. Then $u \to -\infty$ as $x \to 0^+$. So we can substitute $u$ for $\ln x$ and $u \to -\infty$ for $x \to 0^+$ to obtain $$\lim_{x \to 0^+} \arctan(\ln x) = \lim_{u \to -\infty} \arctan(u)$$ This evaluates to $-\dfrac{\pi}{2}$.

All we did was substitute a new variable; nothing too in-depth!

• Thank you, that makes sense! – Daniel Cook Sep 24 '13 at 1:38
• Unfortunately, this sort of substitution does not in general work with limits. It works here because the intermediate limit is infinite (and the logarithm function is finite as $x \to 0^+$); it also works with a finite intermediate limit if the inner function never takes the value of that limit (or if either function is continuous, of course); probably there are other situations where it's valid. But it fails if the inner function is constant and the outer function is discontinuous at that value! – Toby Bartels Jan 29 '14 at 23:03
• Here is a fancier situation where it fails: $$lim_{x \to 0} [-|x \sin(1/x)|].$$ (Here $[t]$ is the floor of $t$, the largest integer not larger than $t$.) As $x \to 0$, $x \sin(1/x) \to 0$ (a classic example of the squeeze/sandwich theorem). As $u \to 0$, $[-|u|] \to -1$ (because $-|u| < 0$ for $u \ne 0$). But as $x \to 0$, $[-|x sin(1/x)|]$ has no limit, because it takes the value $0$ at $x = 1/\pi, 1/(2\pi), 1/(3\pi), \ldots$, which can be arbitrarily close to $0$. – Toby Bartels Jan 29 '14 at 23:03
• I can no longer edit my first comment above, but it has a minor error; where it says ‘or if either function is continuous’, it should say ‘or if the outer function is continuous’. – Toby Bartels Jan 29 '14 at 23:53

As $x$ approaches $0$ from the right, $\ln x$ becomes very large negative. As $w$ becomes very large negative, $\arctan w$ approaches $-\frac{\pi}{2}$.

• My question is this, how does arctan(−∞) suddenly become limx→−∞arctan(w) ? – Daniel Cook Sep 24 '13 at 1:29
• you cant take the arctan of -infinity, -infinity is not a number, but you can take a limit as it approaches infinity – YYC Sep 24 '13 at 1:30

As $x$ approaches $-\dfrac{π}{2}$ from the right it will approach negative infinity, so $$\lim_{x\to-\infty}\arctan (x)=-\dfrac{π}{2}$$

The theorem says that if $\lim_{x \to c} g(x) = w$ and $f$ is continous at $w$, then $\lim_{x \to c} f(g(x)) = f( \lim_{x \to c} g(x))$. Clearly, the statement "$f$ is continous at $w$ assumes that $w$ is a real number. This is the premise your limit fails. Your $w$ is "$\infty"$.

I see that some years ago, I commented on the accepted answer (by @Clive Newstead) and said why it was incomplete. And there is an answer by @Ovi explaining why a common chain-rule theorem for limits doesn't apply. But no answer yet states a precise, true theorem about limits that does apply here to explain the answer. So let me fix that.

As Ovi noted, one theorem is that $$\lim \limits _ { x \to c } f ( g ( x ) ) = f ( w )$$ if $$w = \lim \limits _ { x \to c } g ( x )$$ exists and $$f$$ is continuous there. This is completely inapplicable, since $$w$$ is infinite in this case, and so there's no way that $$f$$ could be continuous there; we can't even say that $$f$$ is defined at $$w$$.

But another theorem is that $$\lim \limits _ { x \to c } f ( g ( x ) ) = \lim \limits _ { u \to w } f ( u )$$ if $$w = \lim \limits _ { x \to c } g ( x )$$ exists (possibly as a form of infinity) and $$w$$ is not in the range of $$g$$ (including when $$w$$ is a form of infinity), as long as $$\lim \limits _ { u \to w } f ( u )$$ also exists. And that's what we have here! (Actually, it's even possible for $$w$$ to be in the range of $$g$$ as long as there is a deleted neighbourhood of $$c$$ on which it is not; that is, whenever there is a $$\delta > 0$$ such that $$g ( x )$$ is never $$w$$ when $$0 < \lvert x - c \rvert < \delta$$.)

I should link to some reference where this theorem is stated, but I haven't found one, and writing out the general proof involves tedious cases. So instead, let me run through this example, showing how, given $$\epsilon > 0$$, to find $$\delta > 0$$ such that whenever $$0 < x - 0 < \delta$$, $$\lvert \arctan \ln x - ( - \pi / 2 ) \rvert < \epsilon$$, without using any knowledge about arctangents and logarithms other than the two relevant limits and the fine print about the range.

So given $$\epsilon _ 1 > 0$$, since $$\lim \limits _ { u \to - \infty } \arctan u = - \pi / 2$$, there exists $$\delta _ 1 > 0$$ such that whenever $$0 < - 1 / u < \delta _ 1$$, $$\lvert \arctan u + \pi / 2 \rvert < \epsilon _ 1$$. Now let $$\epsilon _ 2$$ be $$\delta _ 1$$; since $$\lim \limits _ { x \to 0 ^ + } \ln x = - \infty$$ and $$\epsilon _ 2 > 0$$, there exists $$\delta _ 2 > 0$$ such that whenever $$0 < x < \delta _ 2$$, $$0 \leq - 1 / \ln x < \epsilon _ 2$$. So if we start with $$\epsilon = \epsilon _ 1$$, in the end we want $$\delta = \delta _ 2$$.

Let's check that ths works! So given $$x$$ such that $$0 < x < \delta = \delta _ 2$$, we know that $$0 \leq - 1 / \ln x < \epsilon _ 2$$. Since $$- 1 / \ln x$$ cannot equal $$0$$ (in other words, $$- \infty$$ is not in the range of the natural logarithm, which is less trivial when you apply this reasoning to finite limits), in fact $$0 < - 1 / \ln x < \epsilon _ 2 = \delta _ 1$$. Let $$u$$ be $$\ln x$$; since $$0 < - 1 / u < \delta _ 1$$, $$\lvert \arctan u + \pi / 2 \rvert < \epsilon _ 1$$. In other words, $$\lvert \arctan \ln x + \pi / 2 \rvert < \epsilon$$, which is what we need.

tl;dr: $$\lim \limits _ { x \to c } f ( g ( x ) ) = \lim \limits _ { u \to w } f ( u )$$ if $$w = \lim \limits _ { x \to c } g ( x )$$ exists (possibly as a form of infinity) and $$w$$ is not in the range of $$g$$ (including when $$w$$ is a form of infinity), as long as $$\lim \limits _ { u \to w } f ( u )$$ also exists. (And it's also OK if $$w$$ is in the range of $$g$$ because $$g ( c ) = w$$ and/or because $$w = g ( x )$$ for values of $$x$$ far from $$c$$. And finally, if $$f$$ is continuous at $$w$$, as already noted, then no conditions apply to the range of $$g$$.)