Definition:

The chain rule is a method for differentiating a function of a function, or differentiating composite functions.

Consider the expression y = sin(x^2). We notice that this is not a normal sine function. It has an x^2 as argument for the sine function. Therefore, we can consider the x^2 in the sine function as a whole different function. This can be broken into two functions, f(x) and g(x).

If we consider f(x) =  sin(x); g(x) = x^2, we can write y = f(g(x)).

In order to differentiate a composite function, y = f(g(x)), i.e; to find y', we let

u = g(x)  and  y = f(u)

What this implies is that whatever g(x) is, u will be equal to that. Then, the process of differentiating is to find

  • \frac{du}{dx} (as u will be a function of x).
  • \frac{dy}{du}

Finally, we can write,

\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}

Back to our example, y = sin(x^2); remember that f(x) = sin(x) and g(x) = x^2. We let

u =  x^2  and  y = f(u) = sin(u)

Therefore,  \frac{du}{dx} = 2x and  \frac{dy}{du} = cos(u)

This leaves us with  \frac{dy}{dx} = cos(u) \cdot 2x. We can simplify the equation by writing

\frac{dy}{dx} = 2xcos(x^2)

Note that the u in the cosine function is replaced with x^2.

Mathematically, the derivative of a composite function can be written as

 (f\circ g)'(x) = g'(x) \cdot f'(g(x))

Looking back to our example, we would write the derivative as follows:

y' = (x^2)' \cdot (sin'(x^2))

This gives us

y' = 2xcos(x^2)

NOTE:

It is important to see that the derivative, g'(x) is multiplied by the derivative, f'(g(x)). The derivative f'(g(x)) implies that only the function f should be differentiated, not g(x).

Example 2: Suppose we want to differentiate y = cos^2(x).

The function can be written as y = (cos(x))^2. So, f(x) = x^2 and g(x) = cos(x). We let

u = g(x), y = f(u)

This gives us

u = cos(x)  and  y = u^2

Therefore  \frac{du}{dx} = -sin(x)  and  \frac{dy}{du} = 2u. We get

\frac{dy}{dx} = 2u \cdot -sin(x)

Replacing u with cos(x), we get  \frac{dy}{dx} = -2sin(x)cos(x).

Example 3: Let’s now find the derivative of y = sin^4(x).

Assuming

g(x) = sin(x) and f = x^4.

We let

u = sin(x)  and  y = u^4

Therefore,

\frac{du}{dx} = cos(x) ;  \frac{dy}{du} = 4u^3.

\frac{dy}{dx}  =  4u^3 \cdot cos(x)

Replacing u with sin(x), we get

\frac{dy}{dx} = 4sin^3(x)cos(x)

Hopefully, by now, you would have noticed a pattern when it comes to Power Trig functions.

Assume y = sin^n(x) (n is some positive number). As a general rule for the derivatives of Power Trig functions, we can write it as:

\frac{dy}{dx} = nsin^{n-1}(x)cos(x)

For cos^n(x), it’s derivative is:

(cos^n(x))' =ncos^{n-1}(x)(-sin(x)) = -ncos^{n-1}(x)sin(x)

Convince yourself that this is the case looking back at the previous Power Trig functions examples.

The Chain Rule is very helpful when it comes to differentiating complex functions. The process is to break down the function in parts and make a composite function.

Consider this example:

y = \sqrt[4]{sin\bigg(\sqrt{tan\Big(ln\sqrt{x^2 +1}\Big)}\bigg)}

By looking at this function, you may think it is tedious to solve and have no idea where to begin. But, by using the Chain Rule, it can be differentiated quite easily.

Let’s break the function into different functions to make a composite function. Assume:

  • f(x) = \sqrt[4]{x}
  • g(x) = sin(x)
  • h(x) = \sqrt{x}
  • i(x) = tan(x)
  • j(x) = ln(x)
  • k(x) = \sqrt{x^2 + 1}

Therefore, we can write the function as:

y = f(g(h(i(j(k(x))))))

The derivative of y is

y' = k'(x) \cdot j'(k(x)) \cdot i'(j(k(x))) \cdot h'(i(j(k(x)))) \cdot g'(h(i(j(k(x))))) \cdot f'(g(h(i(j(k(x))))))

Here, using the Chain Rule, we find the derivative of the starting function which is k(x) and we multiply it with the other functions. But note that when we are finding j'(k(x)), only the function j is being differentiated, not k(x). But we take whatever k(x) is and we put that in j'(x). Also, for i'(j(k(x))), we are finding i'(x), then we take the composite function j(k(x)) and put it in i'(x) to get i'(j(k(x))) and so forth.

Let’s find the derivative of each function individually.

f(x) = \sqrt[4]{x}  \rightarrow  f'(x) = \frac{1}{4}x^\frac{-3}{4}

g(x) = sin(x)  \rightarrow  g'(x) = cos(x)

h(x) = \sqrt{x}  \rightarrow  h'(x) = \frac{1}{2\sqrt{x}}

i(x) = tan(x)  \rightarrow  i'(x) = sec^2(x)

j(x) = ln(x)  \rightarrow  j'(x) = \frac{1}{x}

k(x) = \sqrt{x^2 + 1}  \rightarrow  k'(x) = \frac{1}{2\sqrt{x^2 + 1}}(2x)

For e.g;

(i) j'(x) = \frac{1}{x}, therefore,

j'(k(x)) = j'(\sqrt{x^2 + 1}) = \frac{1}{\sqrt{x^2+1}}

(ii) i'(x) = sec^2(x), therefore,

i'(j(k(x)))  =  i'(j(\sqrt{x^2 + 1}))  =  i'(ln\sqrt{x^2 + 1}) = sec^2(ln\sqrt{x^2 + 1})

(iii) h'(x) = \frac{1}{2\sqrt{x}}, therefore,

h'(i(j(k(x))) = h'(i(j(\sqrt{x^2 + 1})) = h'(i(ln\sqrt{x^2 + 1})) = h'(tan(ln\sqrt{x^2 + 1})) = \frac{1}{2\sqrt{tan(ln\sqrt{x^2 + 1})}}

I would recommend that you complete the remaining steps to understand how it works.

Proceeding with the differentiation, we should get:

y' = \frac{1}{2\sqrt{x^2+1}}(2x) \cdot \frac{1}{\sqrt{x^2+1}} \cdot sec^2\Big(ln\sqrt{x^2 + 1}\Big) \cdot  \frac{1}{2\sqrt{tan\big(ln\sqrt{x^2 + 1\big)}}} \cdot cos\Bigg(\sqrt{tan\Big(ln\sqrt{x^2 + 1}\Big)}\Bigg) \cdot \frac{1}{4}\Bigg(sin\sqrt{tan\Big(ln\sqrt{x^2 + 1}\Big)}\Bigg)^\frac{-3}{4}

After completion,

y' = \frac{xsec^2\Big(ln\sqrt{x^2 + 1}\Big)cos\Bigg(\sqrt{tan\Big(ln\sqrt{x^2 + 1}\Big)}\Bigg)}{8(x^2+1)\Bigg(sin\sqrt{tan\Big(ln\sqrt{x^2 + 1}\Big)}\Bigg)^\frac{3}{4}\sqrt{tan\big(ln\sqrt{x^2 + 1}\big)}}

Note that you can make up any function and differentiate it. Do all the exercises in the tutorials, and when you feel confident, you can come up with more difficult functions and find their derivatives. Check out this website to see if you are correctly differentiating the functions: symbolab.com.

How clear is this post?