Chain Rules Supreme

Andrew Stacey

2023-11-26

# 1 A Matter of Squares

As a lead-in to the main point of this post, here's a curious fact: it's easy to see that if you know how to multiply [two numbers] then you know how to square [a number]. Did you know that the reverse is true? That is, if you know how to square [a number] then you can do multiplication as well.

It does rely on being able to do a couple of other things; namely, addition and division by two1 but nevertheless, this separates out what of multiplication is due to multiplication and what comes from the underlying structure of the things being multiplied.

1So you need to watch your characteristic if trying to apply this to other rings, and commutativity plays a part as well.

It's not even that complicated. Here's how it's done.

1. Start with the two numbers you want to multiply, let's say $7$ and $3$.

2. Square their sum: $\left(7+3{\right)}^{2}={10}^{2}=100$.

3. Square them individually: ${7}^{2}=49$ and ${3}^{2}=9$.

4. Subtract the individual squares from the square of the sum: $100-49-9=42$.

5. Halve the result: $42÷2=21$.

And observe that $7×3$ is, indeed, $21$.

The proof is a bit of straightforward algebra. Starting with two numbers, $a$ and $b$, then the claim is that the product $ab$ is equal to half of $\left(a+b{\right)}^{2}-{a}^{2}-{b}^{2}$. Expanding out the square of the bracket2 yields:

2This is where commutativity comes in.

 $\begin{array}{rl}\left(a+b{\right)}^{2}-{a}^{2}-{b}^{2}& ={a}^{2}+2ab+{b}^{2}-{a}^{2}-{b}^{2}\\ & =2ab\end{array}$

and so half of that is $ab$.

In and of itself, this isn't exactly an earth-shattering result. However, it does turn out to be an incredibly useful tool – finding its way into the relationship between an inner product and its norm, and more generally between a bilinear form and its quadratic form. There are situations, such as those, where squaring is viewed as a separate operation to multiplication and knowing that they determine each other is useful. It also, as alluded to above, shows a little bit of how much of multiplication belongs to itself and how much comes from the space on which it is defined.

What I want to do is use it to show how the Chain Rule reigns supreme above all else.

# 2 Introducing the Chain Rule

In A level Mathematics3 there are three "rules" introduced for differentiation: the chain rule, the product rule, and the quotient rule.

3Studied in the last two years of school in the UK.

I doubt I'm alone in considering the chain rule to be the primary one in this list. However, explaining why that should be to school students is something that I've not previously found easy to do. It's simple enough to demonstrate that the quotient rule is redundant since one can just use the product rule with the chain rule in its place4. But, until recently, if asked for a similar argument to demonstrate the redundancy of the product rule then I'd've prevaricated because the one that I knew uses partial derivatives (for completeness, I've included it at the end of this post) and that takes us too far outside the curriculum.

4Which makes it a bit daft that the quotient rule is the only one of the three that is listed in the A level formula booklet.

To be clear, I'm not saying that the product rule (or quotient rule) aren't useful or shouldn't be in the curriculum. I'm just saying that there is a hierarchy of rules and the chain rule is very definitely at the top. I'm also not saying that the fact that the others can be deduced from it is the real reason for the primacy of the chain rule. The real reason is that it establishes the functorality of differentiation and so establishes it as a categorical tool. But I'm even less likely to say that to school students!

# 3 Squares to the Rescue

I recently learnt of a simple way to demonstrate that the product rule can be deduced from the chain rule, and it uses the squaring trick from the first section.

Let's start by considering the square of a function. So let $h\left(x\right)$ be a differentiable function5 and consider differentiating $h\left(x{\right)}^{2}$. This can be done by the chain rule:

5I'll work over $ℝ$, but the idea would generalise.

 $\frac{dh\left(x{\right)}^{2}}{dx}=2h\left(x\right)h\text{'}\left(x\right)$

Now consider two differentiable functions, $f\left(x\right)$ and $g\left(x\right)$. Our aim is to differentiate their product, $f\left(x\right)g\left(x\right)$. Inspired by the squaring idea, we'll consider differentiating the square of their sum:

 $\frac{d\left(f\left(x\right)+g\left(x\right){\right)}^{2}}{dx}=2\left(f\left(x\right)+g\left(x\right)\right)\left(f\text{'}\left(x\right)+g\text{'}\left(x\right)\right)$

We can expand the brackets on both sides and use the linearity of differentiation to see that:

 $\frac{df\left(x{\right)}^{2}}{dx}+2\frac{df\left(x\right)g\left(x\right)}{dx}+\frac{dg\left(x{\right)}^{2}}{dx}=2f\left(x\right)f\text{'}\left(x\right)+2f\left(x\right)g\text{'}\left(x\right)+2g\left(x\right)f\text{'}\left(x\right)+2g\left(x\right)g\text{'}\left(x\right)$

We recognise the first and last terms on each side as being equal and so removing them leaves us with:

 $2\frac{df\left(x\right)g\left(x\right)}{dx}=2f\left(x\right)g\text{'}\left(x\right)+2g\left(x\right)f\text{'}\left(x\right)$

Whence, providing we can divide by $2$, the product rule drops out.

Now, I wouldn't advocate using this as an introduction to the product rule. And indeed, I might stick with my current justification (using $f\left(x+h\right)\simeq f\left(x\right)+hf\text{'}\left(x\right)$) simply because it reinforces an important use of the derivative. Nevertheless, I do at last have an explanation for how to deduce the product rule from the chain rule that I can use in a classroom.

And there's something satisfying about that.

I said above that I'd recently learnt of this method, implying that I learnt it from somewhere else. I didn't. I deduced it myself. However, I'd be extremely surprised to learn that it wasn't already known (and possibly well-known in some circles). It's just that I haven't come across it elsewhere.

But my phrasing "learnt of" is deliberate even beyond that because even though I deduced it for myself, I had a very definite prompt. I can't attribute the result to the prompt (and thereby the prompter) because they didn't know what they were prompting and I still had to make the connection to this result. However, it does make it feel very much like discovery rather than invention.

Just for interest's sake, the prompt was a student considering how to differentiate the square of a function, I think it was $\left(\mathrm{ln}\left(x\right){\right)}^{2}$. My instinct was to use the chain rule, and so that came to the forefront of my mind on seeing it. The student thought of it as $\mathrm{ln}\left(x\right)×\mathrm{ln}\left(x\right)$ and so used the product rule. That was enough to bring to mind the link between squaring and multiplying, and to pose the question as to whether that could be used to connect the chain rule to the product rule.

Just to show that Pratchett is completely right with his theory of inspiration particles, I'm fully aware of the way of proving the derivative of ${x}^{2}$ using the product rule and yet had never made the connection with that starting point.

The mind is curious.

# 5 Postscript: Using Partial Derivatives

To make this post complete, here's how to use partial derivatives to deduce the product rule from the chain rule. We start with the multiplication operator, $M\left(x,y\right)=xy$. It has total derivative:

 $dM\left(x,y\right)=\left[\begin{array}{cc}\frac{\partial M}{\partial x}& \frac{\partial M}{\partial y}\end{array}\right]=\left[\begin{array}{cc}y& x\end{array}\right]$

Given two differentiable functions, say $f\left(x\right)$ and $g\left(x\right)$, we can view their product $f\left(x\right)g\left(x\right)$ as the composition of $M$ with the map:

 $x↦\left[\begin{array}{c}f\left(x\right)\\ g\left(x\right)\end{array}\right]$

The derivative of this is:

 $\left[\begin{array}{c}f\text{'}\left(x\right)\\ g\text{'}\left(x\right)\end{array}\right]$

The chain rule then says that to find the derivative of $x↦M\left(f\left(x\right),g\left(x\right)\right)$ we compose these derivatives to get:

 $\begin{array}{rl}dM\left(f\left(x\right),g\left(x\right)\right)\cdot \left[\begin{array}{c}f\text{'}\left(x\right)\\ g\text{'}\left(x\right)\end{array}\right]& =\left[\begin{array}{cc}g\left(x\right)& f\left(x\right)\end{array}\right]\left[\begin{array}{c}f\text{'}\left(x\right)\\ g\text{'}\left(x\right)\end{array}\right]\\ & =g\left(x\right)f\text{'}\left(x\right)+f\left(x\right)g\text{'}\left(x\right)\end{array}$