Is there anything wrong with this proof of chain rule? Is there anything wrong with this proof of the Chain Rule?
$$\begin{align}
(f(g(x)))'&=\lim_{h\to 0} \frac{f(g(x+h))-f(g(x))}{h}\tag{eq 1}\\
g'(x) &= \lim _{h\to 0} 
\frac{g(x+h))-g(x)}{h}\\
g'(x)\cdot\lim_{h\to 0} h &= \lim _{h\to 0}\,(g(x+h)-g(x))\\
g'(x)\cdot\lim _{h\to 0} h + \lim _{h\to 0} g(x) &= \lim _{h\to 0} g(x+h)\\
\lim _{h\to 0} g(x+h)) &= g'(x)\cdot \lim _{h\to 0} h + \lim _{h\to 0} g(x)\tag{eq 2}
\end{align}$$
Substitute Equation 2 into Equation 1:
$$
\begin{align}
(f(g(x)))'&=\lim _{h\to 0}
\frac{f(g(x+h))-f(g(x))}{h}\\
&=\lim _{h\to 0} \frac{f(g'(x)\cdot h + g(x))-f(g(x))}{h}
\end{align}$$
Let $g'(x)\cdot h = h'$.
$$\begin{align}
\lim _{h'\to 0}
\frac{f(g'(x)\cdot h+ g(x))-f(g(x)))}{h}
&=\lim _{h'\to 0} \frac{
f(h' + g(x))-f(g(x))}{h}\\
&=g'(x)\cdot\lim _{h'\to 0}
\frac{f(h'+g(x))-f(g(x))}{g'(x)h}\\
&= g'(x)\cdot\lim_{h'\to 0}
\frac{f(h'+g(x))-f(g(x))}{h'}\\
&= g'(x) f'(g(x))
\end{align}$$
Hence $\;(f(g(x)))' = g'(x) f'(g(x))$
 A: This is mathematically illiterate, I'm afraid. The line
$$g'(x) \lim_{h\to 0} h = \lim _{h\to 0} g(x+h)-g(x)$$
is true, but only because $\lim_{h\to 0} h$ and $\lim _{h\to 0} g(x+h)-g(x)$ are both zero. So the conclusion
$$\lim _{h\to 0} g(x+h) = g'(x)\lim _{h\to 0} h + \lim _{h\to 0} g(x)$$
is also true, but only because it reduces to $g(x)=g(x)$. You can't actually deduce anything from it.
A: There are a number of problems in what you write. There isn't a single problem, there are multiple problems. Here's three of them.

*

*Your step from Line 2 to Line 3 is incorrect. You got from
$$g'(x) = \lim_{h\to 0}\frac{g(x+h)-g(x)}{h}$$
to
$$g'(x)\lim_{h\to 0} h = \lim_{h\to 0}(g(x+h)-g(x)).$$
This step is not reversible. You seem to be using that the limit of a quotient is the quotient of the limits... but that is only valid of the limit of the denominator is not zero... which is not the case here.  The second equality holds, but is not reversible (you can't go from Line 3 to Line 2). Line 3 is really trivial when you look at it closely: it just says that $0=0$. Replace $g'(x)$ with $17$, and it still holds. Replace $g'(x)$ with $2g'(x)$ and it still holds... and the substitution you would try later (which is invalid anyway, see below) would give you an extra factor of $2$ that would mess up your calculations...


*You are trying to substitute Equation 2 into Equation 1. But Equation 2 is
$$\lim_{h\to 0}g(x+h) =g'(x)\lim_{h\to 0}h + g(x). \tag{Eq 2}$$
You are instead substituting $g'(x)\lim_{h\to 0}h + g(x)$ for $g(x+h)$. But that is not valid; you can't just ignore the $\lim_{h\to 0}$ on the left hand side of Eq 2, because in general it is not true that $g(x+h) = g'(x)\lim_{h\to 0}h + g(x)$. The left hand side depends on both $x$ and $h$, while the right hand side is just $g(x)$. So you are not even in a position to make that substitution.


*The reason you can't do the substitution is also the reason why your manipulation after the substitution is invalid. You have a limit, and are trying to "add" a limit inside the limit to justify the substitution. And later, you have a limit inside a limit and you are converting that into a single limit. Neither is in general true.  You need to keep the limit variables separate. If you were actually able to do your substitution, it should really look like
$$\begin{align}
(f(g(x)))'&=\lim _{h\to 0}
\frac{f(g(x+h))-f(g(x))}{h}\\
&=\lim _{h\to 0} \frac{f(g'(x)\cdot\left(\lim_{k\to 0}k\right) + g(x))-f(g(x))}{h}
\end{align}$$
and this is not the same thing as
$$\lim_{h\to 0}\frac{f(g'(x)\cdot h + g(x))-f(g(x))}{h}$$
which is what you claimed.
For instance, suppose you have
$$\lim_{x\to 0}\frac{x}{x+x}.$$
You are saying that I could consider this as
$$\lim_{x\to 0}\frac{x}{x+\lim_{x\to 0}x}$$
to make the first substitution, and something similar in the other direction to convert it back to a single limit. But replace the limit-inside-the-limit with $\lim_{y\to 0}y$ to see what this does not work: compare
$$\lim_{x\to 0}\frac{x}{x+\lim_{y\to 0}y} = \lim_{x\to 0}\frac{x}{x+0} = \lim_{x\to 0}\frac{x}{x} = 1$$
with
$$\lim_{x\to 0}\frac{x}{x+x} = \lim_{x\to 0}\frac{x}{2x} = \frac{1}{2}.$$
So you can't just convert what you actually have to what you claim you get. That step is invalid both coming and going.
