Lesson Explainer: The Chain Rule Mathematics • Higher Education

In this explainer, we will learn how to find the derivatives of composite functions using the chain rule.

Once we have learned how to differentiate simple functions, we might start to wonder how we can differentiate more complex functions. Generally, more complex functions are created from simpler ones by combining them together in various ways. There are a few basic ways to combine two functions 𝑓(π‘₯) and 𝑔(π‘₯):

  1. addition or subtraction: 𝑓(π‘₯)±𝑔(π‘₯);
  2. multiplication or division: 𝑓(π‘₯)𝑔(π‘₯) or 𝑓(π‘₯)𝑔(π‘₯);
  3. composition: 𝑓(𝑔(π‘₯)).

To be able to differentiate more complex functions, it would be very helpful to have rules that tell us how to differentiate functions combined in these particular ways. At this point in a calculus course, we already know that the derivative of a sum is the sum of the derivatives: (𝑓±𝑔)=𝑓±𝑔.

Furthermore, we know that differentiation is actually a linear operation. This means that, in addition to the sum rule, we have the following rule for multiplication by a constant 𝑐: (𝑐𝑓)=𝑐𝑓.

There are also rules for multiplication and division known as the product and quotient rules. However, in this explainer, we will focus on the rule for differentiating composite functions.

Let’s begin by considering an example where we differentiate a composite function by first simplifying the composite expression and then applying the power rule to the resulting expression. This example will lead us to the general formula for differentiating composite functions.

Example 1: Derivatives of Composite Functions

Consider the function 𝑓(π‘₯)=(2π‘₯+1).

  1. By expanding the binomial, find the derivative of 𝑓.
  2. Let 𝑔(π‘₯)=π‘₯ and β„Ž(π‘₯)=2π‘₯+1. Find the derivative of 𝑔 and β„Ž.
  3. Express π‘“οŽ˜ in terms of β„Ž, π‘”οŽ˜, and β„ŽοŽ˜.

Answer

Part 1

We begin by expanding the parentheses. We can do this using the binomial theorem or by simply multiplying out the parentheses. Below, we simply multiply out the parentheses: 𝑓(π‘₯)=(2π‘₯+1)=(2π‘₯+1)ο€Ή4π‘₯+4π‘₯+1=8π‘₯+8π‘₯+2π‘₯+4π‘₯+4π‘₯+1=8π‘₯+12π‘₯+6π‘₯+1.

We can now use the power rule, ddπ‘₯π‘₯=𝑛π‘₯, to differentiate each term as follows: 𝑓(π‘₯)=3(8)π‘₯+2(12)π‘₯+6=24π‘₯+24π‘₯+6.

Part 2

Using the power rule, we can easily find the derivatives of 𝑔 and β„Ž as follows: 𝑔(π‘₯)=3π‘₯,β„Ž(π‘₯)=2.

Part 3

We would like to try to find an expression for π‘“οŽ˜ in terms of β„Ž, π‘”οŽ˜, and β„ŽοŽ˜. To do this, we begin by factoring the expression we found for π‘“οŽ˜ in part 1. We start by factoring out the common factor of 6 from the expression: 𝑓(π‘₯)=6ο€Ή4π‘₯+4π‘₯+1.

We can now factor the expression in parentheses as follows: 𝑓(π‘₯)=6(2π‘₯+1).

Since β„Ž(π‘₯)=2π‘₯+1, we can rewrite this as 𝑓(π‘₯)=6(β„Ž(π‘₯)).

Furthermore, we know that 𝑔(π‘₯)=3π‘₯; therefore, 𝑓(π‘₯)=2𝑔(β„Ž(π‘₯)).

Finally, since β„Ž(π‘₯)=2, we have 𝑓(π‘₯)=β„Ž(π‘₯)𝑔(β„Ž(π‘₯)).

In the previous example, we had function 𝑓 defined as the composition of two functions 𝑔 and β„Ž; that is, 𝑓(π‘₯)=𝑔(β„Ž(π‘₯)).

We found that the derivative of this function was given by 𝑓(π‘₯)=β„Ž(π‘₯)𝑔(β„Ž(π‘₯)).

Although we considered this for two specific functions, the rule itself generalizes to any composition of differentiable functions; this result is known as the chain rule.

Rule: The Chain Rule

Given a function β„Ž(π‘₯) that is differentiable at π‘₯=π‘₯ and a function 𝑔(𝑒) that is differentiable at β„Ž(π‘₯), their composition 𝑓=π‘”βˆ˜β„Ž defined by 𝑓(π‘₯)=𝑔(β„Ž(π‘₯)) is differentiable at π‘₯ and its derivative 𝑓(π‘₯) is given by 𝑓(π‘₯)=β„Ž(π‘₯)𝑔(β„Ž(π‘₯)).

We can write this in Leibniz notation as dddddd𝑦π‘₯=𝑦𝑒⋅𝑒π‘₯, where 𝑦=𝑔(𝑒) and 𝑒=β„Ž(π‘₯).

The nice thing about using Leibniz notation is that it makes the chain rule very intuitive since the fractional notations on the right-hand side of the equation formally simplify to the expression on the left-hand side.

We let Δ𝑒 be the change in 𝑒 as a result of a small change in π‘₯, Ξ”π‘₯, which we can write as Δ𝑒=β„Ž(π‘₯+Ξ”π‘₯)βˆ’β„Ž(π‘₯).

This change in 𝑒 has a corresponding change in 𝑦: Δ𝑦=𝑔(𝑒+Δ𝑒)βˆ’π‘”(𝑒).

We can now consider the difference quotient Δ𝑦Δπ‘₯; if Δ𝑒≠0, we can multiply the numerator and denominator by Δ𝑒 to get Δ𝑦Δπ‘₯=Δ𝑦Δ𝑒⋅Δ𝑒Δπ‘₯.

We can then take limits as Ξ”π‘₯β†’0 and arrive at the expression for the chain rule. This reasoning is not quite good enough for a proof since it is quite possible that Δ𝑒 is zero even if Ξ”π‘₯β‰ 0. Therefore, to prove the chain rule, we need to be careful with this point. However, a reasoning like this demonstrates how reasonable and intuitive the formula for the chain rule is.

Let’s consider an example where we apply the chain rule using the Leibniz notation.

Example 2: Finding Derivatives Using the Chain Rule

Determine the derivative of 𝑦=ο€Ήβˆ’2π‘₯βˆ’3π‘₯+4ο…οŠ¨οŠ«οŠ«.

Answer

An example like this really demonstrates the importance of the chain rule. It is of course possible to expand the parentheses and get a long polynomial expression. However, clearly, this would be a considerable amount of algebra. Instead, we can apply the chain rule which will prove much simpler and less prone to error.

We begin by identifying the inner and outer functions. We let 𝑒=βˆ’2π‘₯βˆ’3π‘₯+4, and then 𝑦=π‘’οŠ«οŠ«. We now find the derivatives of dd𝑦𝑒 and dd𝑒π‘₯. Using the power rule, we have dddd𝑒π‘₯=βˆ’4π‘₯βˆ’3,𝑦𝑒=55𝑒.οŠͺ

Substituting 𝑒=βˆ’2π‘₯βˆ’3π‘₯+4 into the expression dd𝑦𝑒, we obtain dd𝑦𝑒=55ο€Ήβˆ’2π‘₯βˆ’3π‘₯+4.οŠͺ

Substituting these into the formula for the chain rule, dddddd𝑦π‘₯=𝑦𝑒⋅𝑒π‘₯, we can find the derivative of 𝑦 as follows: 𝑦=55ο€Ήβˆ’2π‘₯βˆ’3π‘₯+4(βˆ’4π‘₯βˆ’3).οŠͺ

As we can see from the last example, one of the key skills in applying the chain rule is identifying the function composition.

Let us consider another example where we apply the chain rule. In this example, we will use the prime notation rather than the Leibniz notation for the chain rule.

Example 3: Using the Chain Rule

Determine the derivative of 𝑓(π‘₯)=2√2π‘₯βˆ’1.

Answer

The function 𝑓 is the composition of two functions. We first need to identify the correct choice of inner and outer functions. In this case, the natural choice of inner function is β„Ž(π‘₯)=2π‘₯βˆ’1, which gives an outer function of 𝑔(𝑒)=2βˆšπ‘’. We can now find the derivatives of 𝑔 and β„Ž. Using the power rule, the derivative of β„Ž is simply β„Ž(π‘₯)=2.

Similarly, we can use the power rule to find the derivative of 𝑔: 𝑔(𝑒)=ο€Ί2βˆšπ‘’ο†=2𝑒=2Γ—12𝑒=1βˆšπ‘’.οŽͺ

Substituting these into the formula for the chain rule, 𝑓(π‘₯)=β„Ž(π‘₯)𝑔(β„Ž(π‘₯)), we can find the derivative of 𝑓 as follows: 𝑓(π‘₯)=2ο€Ώ1√2π‘₯βˆ’1=2√2π‘₯βˆ’1.

In the previous example, there was one apparent choice for the inner and outer functions to the chain rule. Often, there is a natural choice; however, sometimes we will find that there is more than one possible choice. In these cases, we try to pick the functions to minimize the work we need to do. Let us consider an example where we need to consider our choice of the inner and outer functions carefully.

Example 4: Finding the Derivative at a Point Using the Chain Rule

Evaluate dd𝑦π‘₯ at π‘₯=1, where 𝑦=1√4π‘₯βˆ’1.

Answer

For a question like this, we have more than one possible choice for our inner and outer functions. We could choose our inner function to be 𝑒=√4π‘₯βˆ’1, which would result in an outer function of 𝑦=1𝑒, or we could choose an inner function of 𝑒=4π‘₯βˆ’1, which yields 𝑦=1βˆšπ‘’ as the outer function. If we choose the first example, we would find that we need to apply the chain rule a second time to find the derivative of √4π‘₯βˆ’1; for this reason, the second choice of inner and outer functions is better since it will only necessitate that we apply the chain rule once. Therefore, setting 𝑒=4π‘₯βˆ’1 and 𝑦=1βˆšπ‘’. Using the power rule, we can find the derivatives of dd𝑦𝑒 and dd𝑒π‘₯ as follows: dddd𝑒π‘₯=12π‘₯,𝑦𝑒=ο€Ώ1βˆšπ‘’ο‹=𝑒=βˆ’12𝑒=βˆ’12βˆšπ‘’.οŽͺοŽͺ

Replacing 𝑒 with 4π‘₯βˆ’1 in the expression dd𝑦𝑒, we obtain dd𝑦𝑒=βˆ’12(4π‘₯βˆ’1).

Substituting these into the formula for the chain rule, dddddd𝑦π‘₯=𝑦𝑒⋅𝑒π‘₯, we have dd𝑦π‘₯=βŽ›βŽœβŽœβŽβˆ’12(4π‘₯βˆ’1)βŽžβŽŸβŽŸβŽ ο€Ή12π‘₯=βˆ’6π‘₯(4π‘₯βˆ’1).

We can now evaluate this at π‘₯=1 as follows: dd𝑦π‘₯=βˆ’6√(4βˆ’1)=βˆ’63√3=βˆ’23√3.

Sometimes, we might need to apply the chain rule in situations where we do not have an expression for a particular function, but we have information about the value of the derivative at a given point. The following question is an example of this.

Example 5: Using the Chain Rule with Unknown Functions

Given that 𝑦=βˆšπ‘“(π‘₯), 𝑓(4)=2, and 𝑓(4)=7, determine dd𝑦π‘₯ at π‘₯=4.

Answer

Given that 𝑦=βˆšπ‘“(π‘₯), we can apply the chain rule to find the derivative where our inner function is 𝑒=𝑓(π‘₯) and our outer function is 𝑦=βˆšπ‘’. We begin by calculating the derivatives dd𝑦𝑒 and dd𝑒π‘₯ as follows: dddd𝑦𝑒=12βˆšπ‘’,𝑒π‘₯=𝑓(π‘₯).

We can now substitute these expressions into the chain rule as follows: dddddd𝑦π‘₯=𝑦𝑒⋅𝑒π‘₯=12βˆšπ‘“(π‘₯)𝑓(π‘₯)=𝑓(π‘₯)2βˆšπ‘“(π‘₯).

To evaluate this at π‘₯=4, we have dd𝑦π‘₯|||=𝑓(4)2βˆšπ‘“(4).ο—οŠ²οŠͺ

Substituting in 𝑓(4)=2 and 𝑓(4)=7, we get dd𝑦π‘₯|||=22√7=√77.ο—οŠ²οŠͺ

In our final example, we will consider a function that is the composition of multiple functions.

Example 6: Applying the Chain Rule Multiple Times

Find the derivative of the function 𝑦=ο„žπ‘₯+π‘₯+√π‘₯.

Answer

The first thing we need to do is identify our outer and inner functions. We set 𝑒=π‘₯+π‘₯+√π‘₯; then, 𝑦=βˆšπ‘’. We can now find the derivatives of each of these parts and apply the chain rule. We begin by finding the derivative dd𝑦𝑒 as follows: dd𝑦𝑒=12βˆšπ‘’.

We now need to find the derivative of 𝑒 with respect to π‘₯. The first term is easy to differentiate, but the second term is a composition of functions. Hence, to find the derivative of this term, we will need to apply the chain rule. We begin by writing dddd𝑒π‘₯=1+π‘₯π‘₯+√π‘₯.

We let 𝑧=π‘₯+√π‘₯; then, we can set our inner function as 𝑣=π‘₯+√π‘₯, which results in an outer function of 𝑧=βˆšπ‘£. The definition of 𝑧 corresponds exactly to the definition of 𝑦. Hence, its derivative will be dd𝑧𝑣=12βˆšπ‘£.

We can now find the derivative of 𝑣 with respect to π‘₯, which we can easily do using the product rule as follows: dd𝑣π‘₯=1+12√π‘₯=2√π‘₯+12√π‘₯.

We can now apply the chain rule to 𝑧 to get dddddd𝑧π‘₯=𝑧𝑣⋅𝑣π‘₯=12π‘₯+√π‘₯ο€Ώ2√π‘₯+12√π‘₯=2√π‘₯+14√π‘₯π‘₯+√π‘₯.

Substituting this back into the expression for dd𝑒π‘₯, we have dd𝑒π‘₯=1+2√π‘₯+14√π‘₯π‘₯+√π‘₯=4√π‘₯π‘₯+√π‘₯+2√π‘₯+14√π‘₯π‘₯+√π‘₯.

We can now apply the chain rule to 𝑦 as follows: dddddd𝑦π‘₯=𝑦𝑒⋅𝑒π‘₯=12ο„žπ‘₯+π‘₯+√π‘₯βŽ›βŽœβŽœβŽ4√π‘₯π‘₯+√π‘₯+2√π‘₯+14√π‘₯π‘₯+√π‘₯⎞⎟⎟⎠=4√π‘₯π‘₯+√π‘₯+2√π‘₯+18√π‘₯π‘₯+√π‘₯ο„žπ‘₯+π‘₯+√π‘₯.

When we are applying the chain rule multiple times, we should apply a top-down approach as if we are pealing the layers off an onion. Hence, we should find the outermost function and then deal with the inner function which might require a fresh application of the chain rule.

Let’s recap a few important points from this explainer.

Key Points

  • The chain rule states that, given a function β„Ž that is differentiable at π‘₯ and a function 𝑔 that is differentiable at β„Ž(π‘₯), their composition 𝑓=π‘”βˆ˜β„Ž defined by 𝑓(π‘₯)=𝑔(β„Ž(π‘₯)) is differentiable at π‘₯ and its derivative π‘“οŽ˜ is given by 𝑓(π‘₯)=β„Ž(π‘₯)𝑔(β„Ž(π‘₯)). We can write this in Leibniz notation as dddddd𝑦π‘₯=𝑦𝑒⋅𝑒π‘₯, where 𝑦=𝑔(𝑒) and 𝑒=β„Ž(π‘₯).
  • Sometimes we will find that there is more than one possible choice. In these cases, we try to pick the functions to minimize the work we need to do.
  • When we differentiate the composition of three or more functions, we need to apply the chain rule multiple times. We begin with the outermost function, and the derivative of the inner function will require an additional chain rule.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.