In calculus, the general Leibniz rule, named after Gottfried Wilhelm Leibniz, generalizes the product rule for the derivative of the product of two functions (which is also known as "Leibniz's rule"). It states that if <math>f</math> and <math>g</math> are -times differentiable functions, then the product <math>fg</math> is also -times differentiable and its -th derivative is given by
<math display="block">(fg)^{(n)}=\sum_{k=0}^n {n \choose k} f^{(n-k)} g^{(k)},</math>
where <math>{n \choose k}={n!\over k! (n-k)!}</math> is the binomial coefficient and <math>f^{(j)}</math> denotes the j-th derivative of f (and in particular <math>f^{(0)}= f</math>).
The rule can be proven by using the product rule and mathematical induction.
Second derivative
If, for example, , the rule gives an expression for the second derivative of a product of two functions:
<math display="block">(fg)(x)=\sum\limits_{k=0}^{2}{\binom{2}{k} f^{(2-k)}(x)g^{(k)}(x)}=f(x)g(x)+2f'(x)g'(x)+f(x)g(x).</math>
More than two factors
The formula can be generalized to the product of m differentiable functions f<sub>1</sub>,...,f<sub>m</sub>.
<math display="block">\left(f_1 f_2 \cdots f_m\right)^{(n)}=\sum_{k_1+k_2+\cdots+k_m=n} {n \choose k_1, k_2, \ldots, k_m}
\prod_{1\le t\le m}f_{t}^{(k_{t})}\,,</math>
where the sum extends over all m-tuples (k<sub>1</sub>,...,k<sub>m</sub>) of non-negative integers with <math display="inline">\sum_{t=1}^m k_t=n,</math> and
<math display="block"> {n \choose k_1, k_2, \ldots, k_m} = \frac{n!}{k_1!\, k_2! \cdots k_m!}</math>
are the multinomial coefficients. This is akin to the multinomial formula from algebra.
Proof
The proof of the general Leibniz rule proceeds by induction. Let <math>f</math> and <math>g</math> be <math>n</math>-times differentiable functions. The base case when <math>n=1</math> claims that:
<math display="block"> (fg)' = f'g + fg',</math>
which is the usual product rule and is known to be true. Next, assume that the statement holds for a fixed <math>n \geq 1,</math> that is, that
<math display="block"> (fg)^{(n)}=\sum_{k=0}^n\binom{n}{k} f^{(n-k)}g^{(k)}. </math>
Then,
<math display="block">\begin{align}
(fg)^{(n+1)} &= \left[ \sum_{k=0}^n \binom{n}{k} f^{(n-k)} g^{(k)} \right]' \\
&= \sum_{k=0}^n \binom{n}{k} f^{(n+1-k)} g^{(k)} + \sum_{k=0}^n \binom{n}{k} f^{(n-k)} g^{(k+1)} \\
&= \sum_{k=0}^n \binom{n}{k} f^{(n+1-k)} g^{(k)} + \sum_{k=1}^{n+1} \binom{n}{k-1} f^{(n+1-k)} g^{(k)} \\
&= \binom{n}{0} f^{(n+1)} g^{(0)} + \sum_{k=1}^{n} \binom{n}{k} f^{(n+1-k)} g^{(k)} + \sum_{k=1}^n \binom{n}{k-1} f^{(n+1-k)} g^{(k)} + \binom{n}{n} f^{(0)} g^{(n+1)} \\
&= \binom{n+1}{0} f^{(n+1)} g^{(0)} + \left( \sum_{k=1}^n \left[\binom{n}{k-1} + \binom{n}{k} \right]f^{(n+1-k)} g^{(k)} \right) + \binom{n+1}{n+1} f^{(0)} g^{(n+1)} \\
&= \binom{n+1}{0} f^{(n+1)} g^{(0)} + \sum_{k=1}^n \binom{n+1}{k} f^{(n+1-k)} g^{(k)} + \binom{n+1}{n+1}f^{(0)} g^{(n+1)} \\
&= \sum_{k=0}^{n+1} \binom{n+1}{k} f^{(n+1-k)} g^{(k)} .
\end{align}</math>
And so the statement holds for and the proof is complete.
Relationship to the binomial theorem
The Leibniz rule bears a strong resemblance to the binomial theorem, and in fact the binomial theorem can be proven directly from the Leibniz rule by taking <math>f(x) = e^{ax}</math> and <math>g(x) = e^{bx},</math> which gives
:<math>(a + b)^n e^{(a+b)x} = e^{(a+b)x}\sum_{k=0}^n \binom{n}{k} a^{n-k}b^k,</math>
and then dividing both sides by <math>e^{(a+b)x}.</math>
