[proofplan]
We prove each differentiation rule by manipulating the difference quotient and applying the algebra of [limits](/page/Limit). The sum and product rules use direct algebraic rearrangements. The quotient rule reduces to showing $1/g$ is differentiable (then applying the product rule). The chain rule uses an error-function technique that avoids dividing by $g(b+h) - g(b)$, which could be zero.
[/proofplan]
[step:Prove the sum rule via linearity of limits]
By definition of the [derivative](/page/Derivative):
\begin{align*}
\frac{(f+g)(a+h) - (f+g)(a)}{h} = \frac{f(a+h) - f(a)}{h} + \frac{g(a+h) - g(a)}{h}.
\end{align*}
Since $f'(a)$ and $g'(a)$ both exist, the [limit](/page/Limit) of a sum equals the sum of the limits:
\begin{align*}
(f+g)'(a) = \lim_{h \to 0}\frac{f(a+h) - f(a)}{h} + \lim_{h \to 0}\frac{g(a+h) - g(a)}{h} = f'(a) + g'(a).
\end{align*}
[/step]
[step:Prove the product rule by adding and subtracting $f(a)g(a+h)$]
Write
\begin{align*}
\frac{f(a+h)g(a+h) - f(a)g(a)}{h} &= \frac{f(a+h) - f(a)}{h} \cdot g(a+h) + f(a) \cdot \frac{g(a+h) - g(a)}{h}.
\end{align*}
Since $g$ is differentiable at $a$, it is [continuous](/page/Continuity) at $a$ by [differentiability implies continuity](/theorems/184), so $\lim_{h \to 0} g(a+h) = g(a)$. By the [algebra of limits](/theorems/104) (the limit of a product equals the product of the limits, provided both limits exist):
\begin{align*}
\lim_{h \to 0}\frac{f(a+h) - f(a)}{h} \cdot g(a+h) &= f'(a) \cdot g(a), \\
\lim_{h \to 0} f(a) \cdot \frac{g(a+h) - g(a)}{h} &= f(a) \cdot g'(a).
\end{align*}
Therefore $(fg)'(a) = f'(a)g(a) + f(a)g'(a)$.
[guided]
The add-and-subtract technique inserts $f(a)g(a+h)$:
\begin{align*}
f(a+h)g(a+h) - f(a)g(a) &= \bigl(f(a+h) - f(a)\bigr)g(a+h) + f(a)\bigl(g(a+h) - g(a)\bigr).
\end{align*}
Dividing by $h$, the first term becomes $\frac{f(a+h)-f(a)}{h} \cdot g(a+h)$. As $h \to 0$, the difference quotient tends to $f'(a)$ and $g(a+h) \to g(a)$ (by continuity of $g$), so the first term tends to $f'(a)g(a)$. The second term tends to $f(a)g'(a)$ directly.
Why do we use $g(a+h)$ rather than $g(a)$ in the first term? Because we need the identity to be exact (not approximate). The factor $g(a+h)$ is then handled by continuity of $g$.
[/guided]
[/step]
[step:Prove the quotient rule by differentiating $1/g$ and applying the product rule]
First show $(1/g)'(a) = -g'(a)/g(a)^2$. Since $g$ is differentiable at $a$, it is continuous at $a$, and $g(a) \neq 0$ implies there exists $\delta > 0$ such that $g(a+h) \neq 0$ for $|h| < \delta$. For such $h$:
\begin{align*}
\frac{\frac{1}{g(a+h)} - \frac{1}{g(a)}}{h} = \frac{g(a) - g(a+h)}{h \cdot g(a+h) \cdot g(a)} = -\frac{1}{g(a+h) \cdot g(a)} \cdot \frac{g(a+h) - g(a)}{h}.
\end{align*}
As $h \to 0$: $g(a+h) \to g(a)$ (by continuity) and $\frac{g(a+h)-g(a)}{h} \to g'(a)$. By the algebra of limits:
\begin{align*}
\left(\frac{1}{g}\right)'(a) = -\frac{1}{g(a) \cdot g(a)} \cdot g'(a) = -\frac{g'(a)}{g(a)^2}.
\end{align*}
Applying the product rule to $f \cdot (1/g)$:
\begin{align*}
\left(\frac{f}{g}\right)'(a) = f'(a) \cdot \frac{1}{g(a)} + f(a) \cdot \left(-\frac{g'(a)}{g(a)^2}\right) = \frac{f'(a)g(a) - f(a)g'(a)}{g(a)^2}.
\end{align*}
[/step]
[step:Prove the chain rule using the error-function technique]
Define the error function $\phi: E \to \mathbb{R}$ by
\begin{align*}
\phi(y) = \begin{cases} \frac{f(y) - f(g(b))}{y - g(b)} - f'(g(b)) & \text{if } y \neq g(b), \\ 0 & \text{if } y = g(b). \end{cases}
\end{align*}
Since $f$ is differentiable at $g(b)$, $\lim_{y \to g(b)} \frac{f(y) - f(g(b))}{y - g(b)} = f'(g(b))$, so $\lim_{y \to g(b)} \phi(y) = 0 = \phi(g(b))$. Therefore $\phi$ is continuous at $g(b)$.
For all $y \in E$ (including $y = g(b)$, where both sides are zero):
\begin{align*}
f(y) - f(g(b)) = (y - g(b))\bigl(f'(g(b)) + \phi(y)\bigr).
\end{align*}
Setting $y = g(b+h)$ and dividing by $h \neq 0$:
\begin{align*}
\frac{f(g(b+h)) - f(g(b))}{h} = \frac{g(b+h) - g(b)}{h} \cdot \bigl(f'(g(b)) + \phi(g(b+h))\bigr).
\end{align*}
As $h \to 0$: the first factor tends to $g'(b)$ by differentiability of $g$ at $b$. For the second factor: since $g$ is differentiable at $b$, it is continuous at $b$ (by [differentiability implies continuity](/theorems/184)), so $g(b+h) \to g(b)$, and since $\phi$ is continuous at $g(b)$, $\phi(g(b+h)) \to \phi(g(b)) = 0$. By the algebra of limits:
\begin{align*}
(f \circ g)'(b) = g'(b) \cdot \bigl(f'(g(b)) + 0\bigr) = f'(g(b)) \cdot g'(b).
\end{align*}
[guided]
Why not simply write $\frac{f(g(b+h)) - f(g(b))}{h} = \frac{f(g(b+h)) - f(g(b))}{g(b+h) - g(b)} \cdot \frac{g(b+h) - g(b)}{h}$ and take limits? Because $g(b+h) - g(b)$ could equal zero for some nonzero values of $h$ (even if $g'(b) \neq 0$, the difference quotient could vanish at isolated points), making the first fraction undefined.
The error-function $\phi$ bypasses this issue. We define
\begin{align*}
\phi(y) = \begin{cases} \frac{f(y) - f(g(b))}{y - g(b)} - f'(g(b)) & \text{if } y \neq g(b), \\ 0 & \text{if } y = g(b), \end{cases}
\end{align*}
which is [continuous](/page/Continuity) at $g(b)$ because $f$ is [differentiable](/page/Derivative) at $g(b)$ (so the difference quotient tends to $f'(g(b))$ as $y \to g(b)$). The identity
\begin{align*}
f(y) - f(g(b)) = (y - g(b))\bigl(f'(g(b)) + \phi(y)\bigr)
\end{align*}
holds for all $y \in E$, including $y = g(b)$ (where both sides are zero), so we never need to divide by $g(b+h) - g(b)$. Setting $y = g(b+h)$ and dividing by $h \neq 0$:
\begin{align*}
\frac{f(g(b+h)) - f(g(b))}{h} = \frac{g(b+h) - g(b)}{h} \cdot \bigl(f'(g(b)) + \phi(g(b+h))\bigr).
\end{align*}
As $h \to 0$, the first factor tends to $g'(b)$ and $\phi(g(b+h)) \to 0$ (by continuity of $g$ at $b$ and continuity of $\phi$ at $g(b)$), giving $(f \circ g)'(b) = f'(g(b)) \cdot g'(b)$.
[/guided]
[/step]