Chain Rule II
Objectives
- Use basic rules, the product/quotient rules, and the chain rule to find derivatives by hand.
- Using R, obtain and plot the derivative of a function.
1. Combining Derivative Rules
Objective. Use basic rules, the product/quotient rules, and the chain rule to find derivatives by hand.
Finding a derivative by hand combines the basic rules (Lesson 29 sections 2 to 4), the product and quotient rules (Lesson 30 section 2), and the chain rule (Lesson 32 section 3). The extended exponential rule, for constants and , is one of the basic rules (Lesson 29 section 3).
Rule 1 (Chain rule for three functions).
Let , , and be differentiable functions. When the compositions are defined,
In the composition , the middle function is the function , applied after the inside function and before the outside function .
Choosing the rules.
- Rewrite each root or reciprocal as a power (Lesson 29 section 2).
- Find the last operation performed when the function is evaluated at a number.
- When the last operation is a sum or a difference, differentiate term by term.
- When the last operation multiplies a function by a constant, keep the constant and differentiate the function (the constant multiple rule, a basic rule).
- When the last operation multiplies or divides two functions of , apply the product rule or the quotient rule.
- When the last operation applies one function to the output of another, name the outside function and the inside function, then apply the chain rule.
- Repeat steps 2 to 6 on each term, factor, and inside function until only basic rules remain.
Example 1
For each function, determine which rules apply in finding its derivative. The choices are the basic rules only, the product or quotient rule with the basic rules, the chain rule with the basic rules, and the product or quotient rule and the chain rule with the basic rules.
ShowHide solution
- For : the chain rule with the basic rules, because the function is a composition, a power of the difference .
- For : the product or quotient rule with the basic rules, because the function is a product of two factors, and each factor is differentiated by the basic rules.
- For : the basic rules only, because every term is a basic modeling function of or a constant times a basic modeling function.
- For : the product or quotient rule and the chain rule with the basic rules, because the outside function takes the product as input, and the factor is a composition.
- For : the chain rule with the basic rules, because the function is the constant times the composition .
- For : the chain rule with the basic rules, because the function is a composition of three functions: the outside function , the middle function , and the inside function .
Example 2
Find the derivative:
ShowHide solution
The inside function is , with . The outside function is , with . The chain rule, , then gives
Example 3
Find the derivative:
ShowHide solution
The derivatives of the two factors are
The product rule (Lesson 30 section 2) is
With the first factor in place of and the second factor in place of ,
Example 4
Find the derivative:
ShowHide solution
The function is the product of and . Differentiate each factor, then apply the product rule. The first factor is differentiated by the chain rule, with inside function and outside function . The second factor is differentiated by the extended exponential rule:
Substitute both factors and their derivatives into the product rule, and factor out :
Example 5
Find the derivative:
ShowHide solution
The function is a quotient. Differentiate the numerator and the denominator, then apply the quotient rule. The numerator is differentiated by the chain rule, with inside function and outside function . The denominator is differentiated by the extended exponential rule:
The quotient rule (Lesson 30 section 2) is
Substitute the numerator for and the denominator for , then cancel the factor common to every term:
Example 6
Find the derivative:
ShowHide solution
Rewrite the cube root as a power:
The inside function is , with . The outside function is , with
The constant stays in the outside function, as in section 2 of the Lesson 32 Notes. Substitute into the chain rule, distribute , and move the negative power to the denominator:
Example 7
Find the derivative:
ShowHide solution
The inside function is , with . The middle function is , with . The outside function is , with . In the diagram, the arrows run from through , , and in turn. Under each function is its factor in the derivative.
By the chain rule for three functions, is the product of the three factors:
which gives
Example 8
Find the derivative:
ShowHide solution
The inside function is the product . Find by the product rule, then substitute into the chain rule for . The factor has derivative . The factor is itself a composition, with derivative by the chain rule. By the product rule,
The outside function is , with . Substitute into the chain rule:
2. Derivatives in R
Objective. Using R, obtain and plot the derivative of a function.
The commands D() and plotFun() work as in section 2 of the Lesson 31 Notes. In a model whose input is , the formula in D() ends in ~ M, the same input variable as in makeFun().
To check a hand derivative from section 1, evaluate it and the D() result (Lesson 30 section 3) at two inputs. Matching values support the hand derivative.
Example 9
The average maximum temperature, in degrees Fahrenheit, in central Kentucky at the beginning of each month since January 2006 (month 0) is modeled by
Evaluate and in R, and interpret each value.
ShowHide solution
Define Temp and differentiate it with D() to get dTemp, R’s name for . Evaluate both at month 28, and evaluate Temp at months 27 and 29. Used R.
Temp = makeFun(23.3*sin(2*pi/11.98*(M - 3.16)) + 65.4 ~ M) dTemp = D(Temp(M) ~ M) Temp(28) [1] 75.77605 dTemp(28) [1] 10.94161 Temp(27) [1] 63.93454 Temp(29) [1] 84.82823
Month 28 is May 2008, since month 24 is January 2008. At the beginning of May 2008, the model gives an average maximum temperature in central Kentucky of about 75.776 degrees Fahrenheit: .
At month 28, the model’s average maximum temperature is increasing at about 10.942 degrees Fahrenheit per month: .
As a check, the rate lies between the model’s changes over the months before and after month 28:
It should, because falls toward zero on the approach to the next peak.
Example 10
In R, plot the function
and its derivative on .
ShowHide solution
Define Temp and differentiate it with D() to get dTemp, R’s name for . Plot each on . Used R.
Temp = makeFun(23.3*sin(2*pi/11.98*(M - 3.16)) + 65.4 ~ M)dTemp = D(Temp(M) ~ M)plotFun(Temp(M) ~ M, xlim = range(0, 60))plotFun(dTemp(M) ~ M, xlim = range(0, 60))
Multiply both sides by , then add 3.16:
The input gives . The peak value of Temp is . Each of R’s two plots appears here with a dashed line and a marked point added. The dashed line marks on both graphs: Temp is at its peak, and is zero. The derivative is positive just to the left of the line, where Temp rises, and negative just to the right, where Temp falls.
Example 11
The quotient rule and the chain rule give the hand derivative of the function :
Check this derivative against D() at and at .
ShowHide solution
Evaluate the hand derivative at each input, using , , and , with sine and cosine in radians.
Define and differentiate it with D() to get dq, R’s name for . Evaluate dq at the same inputs. Used R.
q = makeFun(cos(x^2) / exp(2*x) ~ x) dq = D(q(x) ~ x) dq(0) [1] -2 dq(1) [1] -0.3740054
At , R gives the hand value exactly. At , R’s value rounds to the hand value . The agreement at both inputs supports the hand derivative.
Found a mistake, a broken tool or something unclear? Report a problem