The following calculation is a proof for the Leibniz rule. I start with the limit definition of the derivative, using the version with \(h \rightarrow 0\text{.}\)
\begin{equation*}
\frac{d}{dx} fg = \lim_{h \rightarrow 0}
\frac{f(x+h)g(x+h) - f(x)g(x)}{h}
\end{equation*}
Then I’m going to use a strange but surprisingly common algebraic trick. I want to do some particular kind of factoring in the numerator. To make that work, I add and subtract the same term from the numerator. Adding and subtracting the same thing doesn’t change the expression, so equality is preserved.
\begin{equation*}
= \lim_{h \rightarrow 0} \frac{f(x+h)g(x+h) - f(x+h)
g(x) + f(x+h) g(x) - f(x)g(x)}{h}
\end{equation*}
Then I’m going to write the first two terms as one limit and the next two terms as another limit. In the first two terms, \(f(x+h)\) is a common factor, so I can pull it out of the fraction. In the second two terms, \(g(x)\) is a common factor, so I can likewise pull it out of the fraction.
\begin{equation*}
= \lim_{h \rightarrow 0} f(x+h)\frac{g(x+h) - g(x)}{h} +
\lim_{h \rightarrow 0} g(x) \frac{f(x+h) - f(x)}{h}
\end{equation*}
I can use the limit rules for the first limit. The limit of \(f(x+h)\) as \(h \rightarrow 0\) is just \(f(x)\text{,}\) so I’ll evaluate that piece of the product and leave the remaining limit. In the second limit, \(g(x)\) doesn’t involve the variable \(h\) at all, so it can simply be pulled out of the limitl.
\begin{equation*}
= f(x) \lim_{h \rightarrow 0} \frac{g(x+h) - g(x)}{h} +
g(x) \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h}
\end{equation*}
Finally, I can simplify identify these two limits as the definitions of the derivatives of \(g(x)\) and \(f(x)\text{,}\) respectively.
\begin{equation*}
= f(x) \frac{dg}{dx} + f(x) \frac{df}{dx}
\end{equation*}