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 $(f * g * h)'(x)$ 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 $n$ times, because $n$ 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 $n$ 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 $\LaTeX$) 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 $n = 2$ factors. How does the induction step for $n > 2$ work? We split the product and apply the induction hypothesis for $2$ and $n-1$:

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

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

## Fun facts (n = 1, n = 0)

We started the induction at the base case $n=2$. For some nice edge case thinking, let’s consider $n=1$ and $n=0$.

• $n=1$: 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 $i=1$. The product runs over all indices from $1$ to $1$ which are not $1$, or in other words no indices at all. The empty product is usually defined as $1$ exactly for cases like this one. So we get the correct derivative in this case, because multiplying by one never hurts.

• $n=0$: 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 $1$. The derivative of the constant function $1$ is $0$. And indeed, now both the sum and the product run over indices from $1$ to $0$ which makes them empty. Since the sum is the outer construct, the total result is indeed $0$.