# The generalized product rule ( Leibniz Formula )

If f and g are n-times differentiable functions, then :

$(fg)^{'} = fg^{'} + gf^{'}$

Now, we would like to find out a generalized expression for the n-th derivative of fg. In order to arrive at that formulation lets calculate a few derivatives to see whether we can find a pattern:

$(fg)^{'} = fg^{'} + gf^{'}$

$(fg)^{''} = \left(fg^{'} + gf^{'}\right)^{'} = fg^{''} + 2 f^{'}g^{'} + gf^{''}$

$(fg)^{'''} = \left(fg^{''} + 2 f^{'}g^{'} + gf^{''} \right)^{'} = fg^{'''} + 3 f^{''}g^{'} + 3 f^{'}g^{''} + gf^{'''}$

$(fg)^{''''} = fg^{''''} + 4 f^{'''}g^{'} + 6f^{''}g^{''} + 4 f^{'}g^{'''} + gf^{''''}$

$\vdots$

You must have noticed a pattern in the above expressions. The coefficients seem are the one in the binomial expansion of $(x+y)^n$

Therefore we can write the expression for the n-derivative of fg as the following expression:

$(fg)^n = \sum\limits_{i=0}^{n} \binom{n}{i} f^{(i)}g^{(n-i)}$
where (i) means to differentiate i-times.

This is also known as Leibniz Formula.

** This plays an important role when we start discussing about the Associated Legendre Differential Equation.