1. Home
  2. Explore
  3. Mathematics
  4. Chain Rule for Composite Functions

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Chain Rule for Composite Functions

The Chain Rule for Nested Functions

The chain rule—also called the composition rule—finds the derivative of a function built by applying one function to the output of another. For a nested function, the derivative is the product of the derivatives at each layer.

Consider the example

f(x)=sin⁡(etan⁡x).f(x)=\sin\left(e^{\tan x}\right).f(x)=sin(etanx).

This function has three layers:

  1. The innermost function is tan⁡x\tan xtanx.

  2. The next function applies the exponential, producing etan⁡xe^{\tan x}etanx.

  3. The outermost function takes the sine, producing sin⁡(etan⁡x)\sin\left(e^{\tan x}\right)sin(etanx).

The derivative is found by working through these layers and multiplying the derivatives together.


A systematic method using intermediate functions

When a function has several nested layers, it can help to name each intermediate quantity. For this example, define

u=sin⁡v,v=ew,w=tan⁡x.u=\sin v,\qquad v=e^w,\qquad w=\tan x.u=sinv,v=ew,w=tanx.

Equivalently, the outer function is u=sin⁡vu=\sin vu=sinv, the next function is v=ewv=e^wv=ew, and the innermost function is w=tan⁡xw=\tan xw=tanx. Each layer is now simple to differentiate with respect to its input:

dudv=cos⁡v,dvdw=ew,dwdx=sec⁡2x.\frac{du}{dv}=\cos v,\qquad \frac{dv}{dw}=e^w,\qquad \frac{dw}{dx}=\sec^2 x.dvdu​=cosv,dwdv​=ew,dxdw​=sec2x.

The chain rule combines these derivatives in order:

dudx=dudvdvdwdwdx.\frac{du}{dx} = \frac{du}{dv}\frac{dv}{dw}\frac{dw}{dx}.dxdu​=dvdu​dwdv​dxdw​.

The intermediate variables cancel in the same way they would in a fraction, leaving the derivative with respect to xxx. Substituting the derivatives gives

dudx=cos⁡v⋅ew⋅sec⁡2x.\frac{du}{dx} = \cos v\cdot e^w\cdot\sec^2 x.dxdu​=cosv⋅ew⋅sec2x.

Since v=ewv=e^wv=ew and w=tan⁡xw=\tan xw=tanx, replacing the intermediate variables with their expressions in xxx gives

f′(x)=cos⁡(etan⁡x)⋅etan⁡x⋅sec⁡2x.f'(x) = \cos\left(e^{\tan x}\right) \cdot e^{\tan x} \cdot \sec^2 x.f′(x)=cos(etanx)⋅etanx⋅sec2x.

Thus,

f′(x)=cos⁡(etan⁡x)etan⁡xsec⁡2x.\boxed{f'(x)=\cos\left(e^{\tan x}\right)e^{\tan x}\sec^2 x.}f′(x)=cos(etanx)etanxsec2x.​

The names of the intermediate variables are only temporary aids. The final derivative must be written in terms of the original variable, xxx.


Working from the outside inward

With practice, the same derivative can be found directly without naming intermediate functions. The method is to differentiate the outermost function first, preserve its input, and then multiply by the derivative of that input.

For f(x)=sin⁡(etan⁡x)f(x)=\sin\left(e^{\tan x}\right)f(x)=sin(etanx):

  1. The outermost function is sine. Its derivative is cosine, and its input remains unchanged:

    cos⁡(etan⁡x).\cos\left(e^{\tan x}\right).cos(etanx).
  2. The input to the sine is etan⁡xe^{\tan x}etanx. Differentiating the exponential gives the exponential multiplied by the derivative of its input:

    etan⁡x⋅ddx(tan⁡x).e^{\tan x}\cdot \frac{d}{dx}(\tan x).etanx⋅dxd​(tanx).
  3. The remaining input is tan⁡x\tan xtanx. Its derivative is sec⁡2x\sec^2 xsec2x.

Multiplying the derivatives from each layer gives

f′(x)=cos⁡(etan⁡x)⋅etan⁡x⋅sec⁡2x.f'(x) = \cos\left(e^{\tan x}\right) \cdot e^{\tan x} \cdot \sec^2 x.f′(x)=cos(etanx)⋅etanx⋅sec2x.

This outside-in process follows the same chain of layers as the method with intermediate variables. At each stage, the current input is retained while its derivative is included as another factor.


Key principles and common errors

  • Differentiate every layer. A nested function requires one derivative factor for each layer, moving from the outside inward.

  • Preserve each input while differentiating its function. For example, differentiating sin⁡(g(x))\sin(g(x))sin(g(x)) gives cos⁡(g(x))\cos(g(x))cos(g(x)) multiplied by g′(x)g'(x)g′(x); the argument g(x)g(x)g(x) does not disappear.

  • Multiply the derivative factors. The chain rule combines the derivatives of the nested functions by multiplication, not addition.

  • Stop at the original variable. Once the innermost input is xxx, its derivative with respect to itself is 111, so no additional factor changes the result.

  • Substitute back into the original variable. Intermediate variables make the work clearer, but the final derivative should ordinarily be expressed using xxx.

For a composition, differentiate the outer function, keep its input, and multiply by the derivative of that input; repeat until reaching the original variable.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent