In one dimensional calculus we have a simple formula to compute the derivative of a product of two functions. In german we call it the “Produktregel” (product rule) and it looks like this:

It can be proved by applying the definition of differentation and some limit calculus. However, sometimes you encounter a product of more than two functions. If you have three factors, say then one option is to apply the product rule twice to obtain the result. It gets trickier when the number of factors is a parameter to your calculation:

We cannot apply the product rule times, because is a variable. In the past I was simply given the formula and that was that. This actually happened in multiple courses and nobody ever bothered giving a proof for the thing. Well, the proof is essentialy apply the product rule times which needs to be done by induction. I have a feeling that proofs by induction often get skipped or hand-waved. I do not like skipping things and a little practice in proof writing (and ) is always welcome, so let’s do it.

The formula

It looks quite fancy:

I won’t bother stating assumptions on differentiability and these things, I just want to see that the formula works.

Sanity check (n = 2)

The first sanity check is to verify that for two factors we get the simple product rule back. And indeed, there are two terms in the sum and one term in the product which is simply the function we did not derive in this term. Sorry if that sounds confusing, the point of a formula is to avoid weird sentences like this one.

Induction step (n - 1 -> n)

Hey, we already started the proof by induction: Our sanity check above is the base case for factors. How does the induction step for work? We split the product and apply the induction hypothesis for and :

  • (1): By distributivity we can multiply each term of the sum instead of the whole sum by .

  • (2): The first term is exactly the summand for in the sum at the end. No computation happened here.

Fun facts (n = 1, n = 0)

We started the induction at the base case . For some nice edge case thinking, let’s consider and .

  • : In this case the function we want to derive is a product of one factor which is just the function itself. So the result we should get is just the derivative of this function. And indeed, the sum contains only one term for . The product runs over all indices from to which are not , or in other words no indices at all. The empty product is usually defined as exactly for cases like this one. So we get the correct derivative in this case, because multiplying by one never hurts.

  • : This is the weird stuff, but I think it works. The function we want to derive is a product of zero factors which is again . The derivative of the constant function is . And indeed, now both the sum and the product run over indices from to which makes them empty. Since the sum is the outer construct, the total result is indeed .