1
$\begingroup$

On wikipedia it says the following on the first chain rule proof:

$\lim_{x \to a} \frac{f(g(x)) - f(g(a))}{g(x) - g(a)} \cdot \frac{g(x) - g(a)}{x - a}$

When $g$ oscillates near $a$, then it might happen that no matter how close one gets to $a$, there is always an even closer $x$ such that $g(x)$ equals $g(a)$. For example, this happens for $g(x) = x^2sin(\frac 1 x)$ near the point $a = 0$. Whenever this happens, the above expression is undefined because it involves division by zero.

I can see that with the function $g(x) = x^2sin(\frac 1 x)$ when $x$ approaches 0 that the amplitude goes to 0 and the frequency goes to infinity, and also know that by the squeeze theorem $\lim_{x \to 0} g(x) = 0$, but $g(a)$ at $a=0$ is undefined, since $(0^2)sin(1/0)=undefined$, so how can $g(x) - g(a) = 0$ or $g(x)=g(a)$? If the statement is not true at the point 0, but only near the point 0 how can it be shown that $g(x)=g(a)$ at such a point?

  • 4
    Probably the article is silently using the unique continuous extension of $x^2 \sin(\frac1x)$ to all of $\mathbb R$ by setting $g(0) = 0$. Because the limit is well-defined at $0$, it is common to think of this completion as synonymous with the original function, even though you're right that it's technically undefined. It's a convenience similar to not distinguishing between $x^2/x$ and $x$.2017-01-01
  • 1
    That's not the issue, actually; setting $g(0)=0$ makes most things fine - in this context at least. The issue is that $g(\frac{1}{n\pi})=0=g(0)$ for any integer $n$, so in any neighbourhood of $0$, the denominator $[g(x)-g(0)]$ in the limit will lead to a division by 0.2017-01-01
  • 2
    @πr8 How is that not the issue? The OP is wondering how $g(x) = g(0)$ can happen when $g(0)$ is undefined. I am explaining why the article considers $g(0)$ to be defined.2017-01-01
  • 2
    @ErickWong Apologies, the comment wasn't directed at you. My point was that defining $g$ at $0$ can actually be disposed with relatively quickly; the substance of the remark from Wikipedia is that we're not allowed to treat the product of the limits as naively as we'd like to, and this requires a bit more careful thought. I concede that possibly I've not read OP's comment as carefully as I should, but I do believe this is the crux of why the remark on Wikipedia is included.2017-01-01
  • 0
    But what if I want to have $f(g(x))$ defined at $x=0$? Now what should I do? You have to do it somehow, and this usually involves having $g(0)=0$.2017-01-01
  • 0
    @ErickWong *Because the limit is well-defined at $0$* And this is why restricting functions to the reals hides the **real** problems.2017-01-01
  • 0
    @ErickWong That would explain it, thanks! I am wondering how this confusion could have been prevented.. Would the Wikipedia article be improved by choosing a function for $g$ that does not need this explanation? What if the function is just a constant? Or would it be better to just explicitly name that it is not actually the function $g$, but the continuous extension to the function $g$?2017-01-01
  • 0
    It probably runs on the assumption that if $f(g(x))$ is being differentiated, and $f(x)$ and $g(x)$ are both differentiable, then they should be defined as continuous, which implies that case should be $g(0)=0$. Alternatively, the Wikipedia should've defined $g(x)$ like I did below, as a piece-wise function.2017-01-01
  • 0
    Ah! That puts it all together for me! It was assumed to be differentiable and therefore must be the continuous extension (a concept I didn't know about).2017-01-01

2 Answers 2

1

It happens to be the case that chain rule cannot handle such functions as you have given. Let us define here that

$$f(x)=x^2\sin(1/x),\quad x\ne0$$

At $x=0$, we want the function to be continuous so that it may be differentiable, hence,

$$f(0)=\lim_{x\to0}f(x)=0\tag{problem?}$$

which may be observed by the squeeze theorem $(-1\le\sin(1/x)\le1)$. Now see that

$$f'(0)=\lim_{h\to0}\frac{f(h)-f(0)}h=\lim_{h\to0}h\sin(1/h)=0$$

Again, by squeeze theorem.

But by chain rule, it is easy enough to see that for $x\ne0$, we have

$$f'(x)=2x\sin(1/x)-\cos(1/x)$$

Which is not continuous at $x=0$ for the very reason that the inside function $g(x)$ is not continuous at $x=0$.

It is easy enough to see this problem pop up since it is actually not the case that $\lim_{x\to0}f(x)=0$ over the complex plane. This is since $\sin(1/x)$ has an essential singularity around $x=0$.

  • 0
    I understand, but you are defining $f(0)$ to be 0, but it is actually undefined. How can you justify that? How should I understand this from reading this text, should I have learned this somewhere?2017-01-01
  • 0
    @beginnermind My last sentence tries to say that you actually **can't**. Particularly, try looking at $\lim_{x\to0}f(ix)$ and it will blow up to $\infty$. But, if you are going to do anything, it is most natural to have $f(0)=0$. It appears...reasonable, but everything you say is right.2017-01-01
  • 0
    The flaw is not in chain rule, but in its proofs given in most textbooks of calculus and Wikipedia is trying to highlight the same. Chain rule works as expected in all the cases.2017-01-01
  • 0
    Also I don't see how the behavior of sine function in the complex plane is relevant to the discussion here.2017-01-01
  • 0
    @ParamanandSingh It doesn't really work if we have $g'(0)f'(g(0))=0\times\infty$ or anything like that.2017-01-01
  • 0
    The chain rule states that if $g'(a), f'(g(a)) $ exist then $(f\circ g) '(a) $ also exists and $(f\circ g)' (a) = f'(g(a)) g'(a) $. By existence we mean that they are real numbers.2017-01-02
0

Wikipedia article is actually trying to point out a common flaw seen in most usual proofs of chain rule. The typical proof uses the limit expression given in your question and then says that first factor tends to $f'(g(a)) $ and second factor tends to $g'(a) $. Thus the final limit is $f'(g(a)) g'(a) $ and proof of chain rule is complete. Wikipedia is saying that this does not work when $g(x) = g(a)$ as $x\to a$. In such cases the proof of chain rule has to proceed in a different manner. Wikipedia uses the phrase "to work around this" to show that the proof has an issue which needs to be circumvented somehow.

When $g(x) =g(a) $ as $x\to a$ then we have $g'(a) =0$ and one needs to prove that $(f\circ g) '(a) =0$ in order to establish the chain rule.