Chain rule proof. “when $g(x) \neq g(a)$ when $x$ and $a$ are close”

calculuschain ruleproof-explanation

Why in the rigorous chain rule proof (exampled at Wikipedia) do we have to specify $g(x)$ does not equal $g(a)$ as $x$ approaches $a$, but not for a single function definition of a derivative?

Aren't $g(x)$ and $g(a)$ going to be the same for the limit as $x$ approaches $a$ for any function; isn't that true for single function derivatives and the term ($ x – a $) approaching zero on the bottom?

If it is assumed that the limit as $x$ is not equal to $a$ (thus avoiding division by zero), then why can we say for example that the limit as $b$ approaches $1$ of $b$ is equal to $1$?

Best Answer

The derivative of $f\colon \mathbb R\to\mathbb R$ at $x$ is defined as $$ \lim_{a\to x} \frac{f(x)-f(a)}{x-a}. $$ The expression $\frac{f(x)-f(a)}{x-a}$ is defined whenever $x\neq a$. Here $a$ may be arbitrarily close to $x$ but as long as it doesn't equal $x$, the expression is well defined.

For the chain rule, you want to rewrite the expression $$ \frac{f(g(x))-f(g(a))}{x-a} $$ as $$ \frac{f(g(x))-f(g(a))}{g(x)-g(a)} \cdot \frac{g(x)-g(a)}{x-a}. $$ For this to be a well defined expression, you still need $x\neq a$ but you also need $g(x)\neq g(a)$. This is a problem since we might have $g(x)=g(a)$ even though $x\neq a$.

For example consider the differentiable function $$ g(x) = \begin{cases} (x+1)^2 & \text{if $x\le -1$}, \\ 0 & \text{if $-1\le x\le 1$}, \\ (x-1)^2 & \text{if $1\le x$}. \end{cases} $$ When you now want to take the derivative of $f(g(x))$ for some $f$ at $x=0$, you are running into the problem that $g(a)=0=g(0)$ whenever $-1\le a\le 1$, so you can't divide by $g(x)-g(a)$ for $a$ close to $x$, even though you only consider $a\neq x$.