Differentiation - the product rule

By Martin McBride, 2023-08-03
Tags: product rule first principles derivative
Categories: differentiation calculus


The product rule allows us to find the derivative of the product of 2 or more functions. It provides a simple way to differentiate functions such as:

Product rule examples

It is also known as the Leibniz product rule, or sometimes simply the Leibniz rule.

In this article we will give some worked examples of the rule, including applying it to the case of x squared to show that it gives the same result as differentiation from first principles. We will then look at an informal geometric interpretation of the formula, before working through a formal proof. Finally, we will see how to apply it to products of 3 or more formulas.

The rule

If we have a function f that is the product of 2 functions u and v:

Product rule

The derivative is given by:

Product rule

This rule allows us to differentiate any function that is the product of 2 other functions that we already know how to differentiate. The rule can easily be extended to the product of 3 or more functions.

Example

Let's see how this applies to the first example we saw earlier:

Example of product rule

This formula is a product of two terms u and v:

Example of product rule

We also need to know the first derivative of each of these functions. These are both standard results:

Example of product rule

We can now calculate the derivative of f using the product rule we saw earlier:

Example of product rule

Substituting the terms we calculated earlier gives the final result:

Example of product rule

This simplifies to:

Example of product rule

We will look at the another example later in the article.

Verifying the formula for x squared

We can check that this method makes sense, informally, by applying it to a result we already know, x squared. The derivative of this, of course, is 2x.

We can write x squared as a product, x times x:

Example of product rule

This means that u and v are both equal to x:

Example of product rule

The derivative of x is 1:

Example of product rule

Substituting the values into the product rule formula gives:

Example of product rule

Which simplifies to:

Example of product rule

This is exactly what we expected, so we have verified that the product rule works for x squared.

Geometric interpretation of the general case

If f(x) is the product of 2 functions u(x) and v(x), we can represent the value of f(x) as the area of a rectangle with sides u(x) and v(x). This is shown on the left here:

Geometric interpretation of product rule

Now let's suppose we increment x by a small amount Δx. This caused u to change by a small amount Δu and v to change by a small amount Δv. That is shown on the right, above.

Incrementing x adds two orange rectangles to the area. The right-hand rectangle has area Δu by v, and the top rectangle has u by Δv.

There is also a tiny yellow rectangle size Δu by Δv. As Δx gets very small, this rectangle gets smaller much more quickly than the two orange rectangles, so we will ignore it in our calculations (we will justify this in the formal derivation later).

So the approximate change in f as we change x by Δx is given by:

Geometric interpretation of product rule

Dividing through by Δx we find the approximate rate of change:

Geometric interpretation of product rule

As Δx tends to 0 this resembles the product rule formula:

Product rule

Proof

The proof of the product rule isn't particularly difficult, it is quite similar to the geometric interpretation we have just looked at. But it has quite a few stages, so we will go through it one step at a time. We will be proving the result using the limit definition of the derivative:

Proof of product rule

First we replace f with u times v:

Proof of product rule

The next step isn't particularly obvious, but the reason for it will be clear in a little while. We are going to add this expression into the limit clause:

Proof of product rule

Since this expression has two identical terms, one positive and one negative, it is equal to 0. That means that if we add it to one side the equation will still be valid. Here is the equation with the extra expression added:

Proof of product rule

Now we will split the limit into two parts:

Proof of product rule

We will call these two parts a and b, and deal with them separately:

Proof of product rule

You can perhaps start to see why we added the strange expression earlier. It means that a has a factor of v(x + h) and b has a factor of u(x). Here is what happens if we take the common factor out of the expression for a:

Proof of product rule

Now as h tends towards 0, the term v(x + h) tends towards v(x). And since v(x) is independent of h, we can take it outside the limit:

Proof of product rule

Notice now that the limit term is equal to the definition of the first derivative of u. so we can write a as:

Proof of product rule

You might now be able to see where this proof is going. The expression for b has a common term in u(x) that we can extract, giving:

Proof of product rule

Again, u(x) doesn't depend on h so we can take it outside the limit:

Proof of product rule

Now the limit term is equal to the definition of the derivative of v, so we can write:

Proof of product rule

Finally, since f' = a + b we have:

Proof of product rule

This proves the product rule.

Another example

Now we will apply this to another example:

Example of product rule

This time f is the product of these two functions, u and v:

Example of product rule

The derivatives of u and v are standard results:

Example of product rule

If we plug these results into the product rule formula we get:

Example of product rule

This can be simplified to:

Example of product rule

The sin and cos terms can also be simplified (this is a standard result that we won't prove here):

Example of product rule

Applying the product rule to 3 (or more) functions

The product rule can be applied to the product of 3 functions:

Product rule 3 functions

In that case, the rule is:

Product rule 3 functions

To gain an intuitive understanding of this rule, we can consider a cuboid of sides u(x), v(x) and w(x), like this:

Product rule 3 functions

The volume of the cube represents f(x), the product of the 3 functions. This is analogous to the rectangle we used in the 2-function case.

When we increased x by Δx, the 3 faces A, B and C move, changing the volume of the cuboid. Face A moves by an amount Δu, and since the area of the face is v(x) by w(x), the change in volume is Δu.v(x).w(x). Side B moves by an amount Δv and changes the volume by an amount u(x).Δv.w(x). Side C changes the volume by an amount u(x).v(x).Δw.

As Δx tends to zero this gives the differential equation above for the 3-function product rule. This can also be formally proved in a similar way to the 2 function proof we saw earlier. The rule can be extended to products with 4 or more functions, following the same pattern.

See also



Join the GraphicMaths Newletter

Sign up using this form to receive an email when new content is added:

Popular tags

adder adjacency matrix alu and gate angle area argand diagram binary maths cartesian equation chain rule chord circle cofactor combinations complex modulus complex polygon complex power complex root cosh cosine cosine rule cpu cube decagon demorgans law derivative determinant diagonal directrix dodecagon eigenvalue eigenvector ellipse equilateral triangle euler eulers formula exponent exponential exterior angle first principles flip-flop focus gabriels horn gradient graph hendecagon heptagon hexagon horizontal hyperbola hyperbolic function hyperbolic functions infinity integration by parts integration by substitution interior angle inverse hyperbolic function inverse matrix irrational irregular polygon isosceles trapezium isosceles triangle kite koch curve l system line integral locus maclaurin series major axis matrix matrix algebra mean minor axis nand gate newton raphson method nonagon nor gate normal normal distribution not gate octagon or gate parabola parallelogram parametric equation pentagon perimeter permutations polar coordinates polynomial power probability probability distribution product rule proof pythagoras proof quadrilateral radians radius rectangle regular polygon rhombus root sech set set-reset flip-flop sine sine rule sinh sloping lines solving equations solving triangles square standard curves standard deviation star polygon statistics straight line graphs surface of revolution symmetry tangent tanh transformation transformations trapezium triangle turtle graphics variance vertical volume of revolution xnor gate xor gate