"

Class Notes Calculus I

The Chain Rule


The quiz problem for today was to write down the limit definition of the derivative of the product function f(x) * g(x). This expression is shown in the top line of the figure below.

The quiz also asked for the derivative of the function ( 3 t - 4 / t^3) * 7^t. This function is the product of f(t) = 3t - 4 / t^3 and g(t) = 7^t. The derivative of the first function is found as the difference of two functions by the power function formula to be 3 + 12 / t^4. The derivative of the second function, and exponential function, is ln(7) * 7^t.

Using these quantities the derivative of the function is found in the figure below. The final simplified version of the derivative, which is not completely shown below, should read (3 ln(7) t + 3 - 4 ln(y) / t^3 + 12 / t^4) * 7^t, with the terms of the first factor listed as decreasing powers of t.

Derivative of f(x) * g(x) is limiting value of (f(x + delta x) * g(x + delta x) - f(x) * g(x) ) / delta x.  The derivative of (3 t - 4 / t^3) * 7^t is found using the product rule.

Video file #01

A text problem asked for the derivation of the formula ( x^(1/2) ) ' = 1 / [ 2 x^(/2) ] using the product rule, and gave the hand to use the expression x^(1/2) * x^(1/2). There are many things we could do with this expression. Probably the most fruitful thing to do this to take its derivative and see if anything useful happens.

In the first line we take the derivative of the expression after first doing the multiplication x^.5 * x^.5 = x^1 = x. It should be clear that the result will be 1, so we can say with certainty that the derivative of x^(1/2) * x^(1/2) is 1.

In the second line we take the derivative of the same expression using the product rule. Both terms end up being identical, except for the order of multiplication, so we see that the derivative simplifies to 2 x^(1/2) * (x^(1/2)) '. So we cannot say with certainty that the derivative of x^(1/2) is 2 x^(1/2) * (x^(1/2)) '.

But we just said that the derivative of this expression is 1. We therefore conclude that 2 x^(1/2) * (x^(1/2)) ' = 1. Solving this expression for (x^(1/2)) ' we obtain (x^(1/2) )' = 1 / (2 x^(1/2)).

The formula for the derivative of x raised to the 1/2 power is found by applying the product rule to x^(1/2) * x^(1/2).  The derivative must be 1.  It must also be 2 * x^(1/2) * (derivative of x^(1/2)).  Conclusion:  the derivative is 1 / (2 x^(1/2)).

Video file #02

Another text problem asked when the derivative of x e^-x was concave down. A function is concave down when its derivative is decreasing; when its derivative is decreasing its second derivative is negative. So we need to find when (x e^-x) '' is negative.

We begin by taking the derivative of (x e^-x). We obtain x' e^-x + x (e^-x)'. The first term gives us just e^-x. The second term is problematic. How do we find the derivative of e^(-x)? We could in fact use a trick like the one used in the preceding example, using the product rule on e^x * e^-x to find that (e^-x)' = - e^-x. However, we note that we will shortly, in fact almost immediately, accounted the chain rule, which makes it easy to find the derivative of e^-x. At this point we therefore abandon our attempt to solve this problem, except to say for anyone who is interested that the second derivative of our function is the derivative of the last expression shown below, and turns out to be - 2 e^-x + x e^-x = (-2 + x) e^-x which, since e^-x is always positive, is negative wherever -2 + x < 0. Thus we see that x e^-x is concave down whenever x < 2.

x e^(-x) is concave down when its second derivative is negative.  The first derivative itself has two terms.

Video file #03

The Chain Rule

We illustrate the chain rule below with the example of y = e^(x^2)). This function is a composite f(g(x)) with g(x) = x^2 and f(x) = e^x. We verify this by noting that for these functions f(g(x)) = e^(g(x)) = e^(x^2).

Therefore to determine the derivative of e^(x^2), we can use the chain rule. First we notice that we need to derivative functions g'(x) and f'(x), which are easily found to be g'(x) = 2x and f'(x) = e^x. These derivatives are noted below.

We are now ready to calculate the derivative. By the chain rule, for the functions f and g as specified above, we have (e^(x^2))' = (f(g(x))' = g'(x) * f'(g(x)). The factor g'(x) is just 2x, while the other factor f'(g(x)) is e^(g(x)) = e^(x^2). We therefore obtain as the derivative the expression 2x e^(x^2).

Knowing that the derivative of e^x is e^x, we might be tempted to say that the derivative of e^(x^2) is just e^(x^2). We wouldn't be far off in one sense, since the derivative does contain e^(x^2) as a factor. However, it also contains 2x, which is the derivative of the exponent x^2, as a 'correction' for the fact that the exponent is not simply x.

The chain rule is applied to find the derivative of e^(x^2).

Video file #04

As a slightly more complex example we determine the derivative of 2 ^ (x^3 + 4x). We first note that the function is a composite f(g(x)), where g(x) = x^3 + 4x and f(x) = 2^x. These functions and their derivatives are documented in the same fashion is in the previous example.

The process of calculating the derivative continues to follow the same template as before. We find that g'(x) * f'(g(x)) = (3x^2 + 4) * ln(2) * 2 ^ (g(x)) = (3x^2 + 4) * ln(2) * 2 ^ (3x^2 + 4).

Again we note that we might be tempted to say that the derivative of 2 ^ (x^3 + 4x) is ln(2) * 2 ^ (x^3 + 4x), just as (2^x)' = ln(2) * 2^x. However, we need the 'correction' term (x^3 + 4x) ' = 3x^2 + 4.

The chain rule is applied to find the derivative of 2 ^ ( x^3 + 4 x).

Video file #05

The example in the figure below calculates the derivative of (e^x) ^ 2. We first note that (e^x) ^ x = e^(2x), and we could instead calculate the derivative of the function in this form. You should do so and compare the process and your results with the calculations below.

We identify (e^x) ^ 2 as a composite of g(x) = e^x and f(x) = x^2, whose derivatives are g'(x) = e^x and f'(x) = 2x. When we calculate the derivative we therefore obtain g'(x) f'(g(x) = e^x * 2 g(x) = e^x * 2 e^x = 2 (e^x) ^ 2 = 2 e^(2x).

The derivative of e^(x^2)

We next calculate the derivative of `sqrt(e^x). This function is the composite of g(x) = e^x and f(x) = `sqrt(x), whose derivatives are g'(x) = e^x and f'(x) = 1 / (2 `sqrt(x)).

We therefore obtain g'(x) f'(g(x)) = e^x * 1 / (2 `sqrt(g(x) ) ) = e^x * 1 / (2 `sqrt(e^x)) = .5 e^(.5x).

The derivative of the square root of e^x.

Video file #06

Video file #07

To calculate the derivative of (e^x) ^ 2 + `sqrt(e^x) in the example below, we could separately calculate the derivatives of the two terms then add them. Or we could, with greater insight, notice that the first thing that happens to x is that we calculate e^x, so we have a composite of something with the function g(x) = e^x. A little reflection shows that the 'something' is f(x) = x^2 + `sqrt(x). We can then proceed to calculate the derivative of f(g(x)).

The derivative of (e^x)^2 + square root of e^x:  g(x) = e^x, f(x) = x^2 + square root of x, so f(g(x)) = g(x)^2 + square root of g(x) = (e^x)^2 + square root of e^x.

We finally note the 'chain notation' for the derivative. In this notation we can write dy / dx = dy / dz * dz / dx, just as if the dz's were algebraic quantities that could cancel out. They aren't, but they are often treated as if they were.

The idea is to express y as a function of some 'intermediate variable' z, then z as a function of x, in such a way that the composite y(z(x)) is equal to the original function.

For example, if y = e ^ (x^2), we could write y(z) = e^z and z(x) = x^2. Then y(z(x)) = e^(z(x)) = e^(x^2).

Noting that for this sequence of functions, dy / dz = e^z and dz / dx = 2x, we see that dy / dx = dy / dz * dz / dx = e^z * 2x = 2x * e^(x^2). This result agrees with our previous calculation of the derivative of e^(x^2).

Alternative expression of the chain rule:  dy/dx = dy/dz * dz/dx.  Applied to y = e^(x^2) where z(x) = x^2, y(z) = e^z.

Video file #08

As we will see soon, this 'chain' notation can be extended to composites involving three or more functions.  We might, for example, use a 'chain' like dy / dx = dy / dz * dz / dw * dw / dx to calculate a composite of three functions.

"