Derivative of the composition of functions (chain rule)

This is the most important rule that will allow us to derive any type of function. This function can be as complicated as we want, but we will always be able to rewrite it with elementary functions and the compositions between them.

Example

f(x)=sin(ax+b) is a composition of the elementary functions g(x)=sinx and h(x)=ax+b.

The function composition says that f(x)=g(h(x)) or, in another notation, f=hg. We might also do compositions for three different functions, or four, or of all the functions that we want.

In the following table there appear several functions built from the composition of elementary functions and its derivatives.

Study it carefully and try to deduce the so-called chain rule:

f(x) f(x)
sin2x cos2x2
ex2 ex22x
(x3+x)12 12(x3+x)12(3x2+1)
lnx2 1x22x
g(h(x)) ?

If you have obtained it: congratulations! Verify your result and step up to the examples. If you could not deduce the chain rule, take a look at the next definition and apply it to the functions of the table to verify the results.

Chain rule

f(x)=g(h(x))f(x)=gh((x))h(x)

Example

Let: f(x)=sin2x We identify g(x)=sinx and h(x)=2x, so f(x)=g(h(x))=sin2x.

Now we can apply the chain rule, f(x)=cos2x2=2cos2x

Example

Let's complicate our functions a little bit more.

Let f(x)=ex3+2x+1.

We identify g(x)=ex and h(x)=x3+2x+1.

Let's apply the chain rule, f(x)=ex3+2x+1(3x2+2)

Example

Let's keep on complicating it f(x)=ln(sinx2)).

In this case we identify three functions:

g(x)=lnxh(x)=sinxt(x)=x2

The chain rule still applies. Let's go with the calculation:

f(x)=1sinx2cosx22x=2xtanx2

Example

Let's now see that the quotient rule is, in fact, the same as the product rule by using the chain rule:

f(x)g(x)=f(x)(g(x)1

(f(x)g(x))=f(x)g(x)1+(1)f(x)g(x)2= =f(x)g(x)1g(x)g(x)f(x)g(x)2g(x)=f(x)g(x)f(x)g(x)g2(x)

Apparently this rule will allow us to derive any expression. The development of the calculation can be longer or shorter - since our function can be a composition of two, three or up to N elementary functions - but, technically, this should not be a big problem.

It is also necessary to say that we can mix functions that need the chain rule, the product rule and the quotient rule at the same time. In these cases the calculation might be boring, but technically it is the same done until now.

Let's see a complex example:

Example

f(x)=lnsin2x3x24

From a quick look it is already obvious that we will have to use the quotient rule.

So,f(x)=(lnsin2x3)(x24)ln(sin2x3)2x(x24)2

Now it is necessary to use the chain rule to derive the numerator (lnsin2x3)=1sin2x3(13sin2/32x)cos2x2=2cos2x3sin32x3=23tan2x

Using this result and introducing it into the first expression, f(x)=2(x24)3tan2x2xlnsin2x3(x24)2f(x)=23tan2x(x24)2xlnsin2x3(x24)2