Step 1: Composite Functions - One outer, one inner function
Derive with Chain Rule


Composite function is a composition of 2 or more functions. Where one function serves as the argument of the other, more outside one. And the Chain Rule is a method to derive such functions. See examples below.



It may be best to start with an example. Let's say we have the function $f(x)=sin(7x)$ and want to find its derivative:

1. The Chain Rule tells us - find the derivative of the outer function and multiply it by the derivative of the inner function:

The inner function is the one that is simply inside - the one that is closest to an "x" variable. In our example, it is 7x. Multiplying by seven is the first action we perform when x is passed.

Now, the outer function - it is the one that has the inner function as an agrument, 7x in our example.
The outer function is then $\textbf{sin}$ with the argument 7x.

Remember: the outer function is applied to the inner function!

2. Great! Now let's find the derivative of $f(x)=sin(7x)$

Inner function derivative - the inner function is 7x, its derivative is 7. Here, I assume you know how to use the table of derivatives.

Outer function derivative - the outer function is sin(), and its derivative is cos(). We use the inner function as the argument! So final derivative of the outer function is cos(7x) - remember - derive the outside function and drag the argument.

Derivative of $sin(7x)$:
$(sin(7x))'=7\cdot cos(7x)$


Note!
From the previous example, you can see that to apply a Chain Rule, it is enough to identify the outer and inner functions and know how to perform basic derivation. Than, you will be able to differentiate any composite function. In this page, it is assumed that you can differentiate single functions like sine, cosine, polynomials, and so on.



Now, you should practice determining the inner and outer functions:

Determine inner/outer function and find derivative:

1. cos(8x)

outer: cos()
- why do I write empty brackets? To emphasise that the outer function is cosine
- and its derivative is -sin(8x) - drag the argument with it

inner: 8x, its derivative is 8

derivative of cos(8x) then is:

$cos'(8x)=-sin(8x)\cdot 8$



2. sin(5x+2)

outer: sin()
as sine is applied to 5x+2!
derivative is cos(5x+2)

inner: 5x+2
its derivative is 5

you may make a mistake thinking that inner function is 5x and outer is +2. But +2 is not something you apply to 5x; it's linear action. Outer function should act on the inner one!

final derivative of this composite function:

sin'(5x+2)=5cos(5x+2)

Now, couple examples for you - identify inner/outer and find derivatives:

1) cos(10x-5)
2 ) sin(15x)
3) sin(x-9)

Answers are on the botoom of the page


Let's continue solving the examples:

3. $\sqrt{x^2+x+1}$

outer: $\sqrt()$ - square root as it is applied to the inner summation
inner: $x^2+x+1$

derivative of the outer: derivative of the square root $(\sqrt{x})'$ is $\frac{1}{2}x^{-\frac{1}{2}}$ BUT our argument is not just x but $x^2+x+1$ so the final derivative of the outer function is $\frac{1}{2}(x^2+x+1)^{-\frac{1}{2}}$

derivative of the inner: $(x^2+x+1)'=2x+1$

final derivative is the product of the inner and outer functions derivatives:

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




Now let's focus only on determining inner and outer functions

4. $(5x+11)^2$

outer: $()^2$
inner: 5x+11
as square is applied to 5x+11



5. $(5x^2+11)^{\frac{3}{2}}$

outer: $()^\frac{3}{2}$
inner: $5x^2+11$
→ as power $\frac{3}{2}$ is applied to $5x^2+11$
or in another words $5x^2+11$ is inside (an argument) of $ ()^ \frac{3}{2}$

Now, couple examples for you:

4) $(x^3-2x)^2$

5 ) $\sqrt{x^5-1}$

Answers are at the botoom of the page

6. $\frac{1}{2}\sqrt{-x-3}$

what do you think?

outer: $\frac{1}{2}\sqrt()$ → $\frac{1}{2}$ times square root as it is applied to the inner function
inner: $-x-3$



7. $\frac{1}{4}ln(x^4)$

what do you think?

outer: $\frac{1}{4}ln() $ → as it is applied to $x^4$
inner: $x^4$



8. $e^{x^3+5}$

what do you think?:)

outer: $e^{()}$ → e it to the power of inner function
inner: $x^3+5$



9. $\frac{1}{5x}$

we can write $\frac{1}{5x}=(5x)^{-1}$

outer: $()^{-1}$ → raising to the power of minus one
inner: $5x$



10. $\frac{3}{4x}$

we can write $\frac{3}{4x}=3\cdot (4x)^{-1}$

what do you think?:)

outer: $3\cdot ()^{-1}$
inner: $4x$



11. $\frac{2}{3x^2}$

we can write $\frac{2}{3x^2}=2\cdot (3x^2)^{-1}$

what do you think?:)

outer: $2\cdot ()^{-1}$
inner: $3x^2$

OR
we can write equivalently:
$\frac{2}{3x^2}=2\cdot (3x^2)^{-1}=\mathbf{2\cdot (3x)^{-2}}$

outer: $2\cdot ()^{-2}$
inner: $3x$

Now, couple examples for you

Identify the inner and outer function:

6) $\frac{5}{(3x)^3}$

7) $\frac{2}{\sqrt {5x}}$

8) $e^{x^4+2}$

9) $2\cdot ln(2x-10)$

10) $e^{-x}$

Answers are at the bottom of the page




Now, you should be ready to calculate couple examples of derivatives of composite function. We will do 3 together and you will do 5 on your own.



Identify inner/outer function and find derivative

12. $3e^{5x^2-8}$

what do you think?

outer: $3e^{()}$ with derivative $3e^{5x^2-8}$ - keep the inner function as the argument!

inner: $5x^2-8$ with derivative $10x$

derivative:
($3\cdot e^{5x^2-8}$)'= $3e^{5x^2-8}\cdot 10x=30xe^{5x^2-8}$

now your turn:

11) $2e^{3x^5-x+1}$

12) $10e^{x^5-2x^4}$

Answers are at the bottom

13. $\frac{10}{(6x)^4}$

we can write equivalently:
$\frac{10}{(6x)^4}=10\cdot (6x)^{-4}$

outer: $10()^{-4}$ and its derivative: $-4\cdot 10()^{-5}$, plugging in the argument: $-4\cdot 10(6x)^{-5}$

inner: $ 6x$ with derivative 6

final derivative:

$\Big(\frac{10}{(6x)^4}\Big)$'= $-4\cdot 10(6x)^{-5}\cdot 6 $



14. $cos(sin(x))$

outer: $cos()$ and its derivative: $-sin()$, plugging in the argument in derivative: $-sin(cos(x))$

inner: $ sin(x)$ with derivative cos(x)

final derivative:

$(cos(sin(x)))'$=$ -sin(cos(x))\cdot cos(x) $



15. $ln(\frac{1}{x})$

outer: $ln()$ and its derivative: $\frac{1}{x}$,
plugging in the argument ($\mathbf{\frac{1}{x}}$) in derivative: $\frac{1}{\mathbf{\frac{1}{x}}}=x$

inner: $\frac{1}{x}=x^{-1} $, and its derivative: $-x^{-2}$

final derivative:

$ln(\frac{1}{x})'$=$ x\cdot (-x^{-2})=-x^{-1} $

now your turn:

13) $\frac{11}{ln(x)}$

14) $sin(cos(x))$

15) $ln(sin(x))$


Check the Answers. Step 1 is completed.



Now, you should proceed to the Step 2 where you will practice harder examples with more that one inner function, like $ln(cos(x^2))$. Can you already tell what is the most inner, "less inner" and outer function?




Step 2: Two Inner Function Composition Chain Rule


Assuming you are confident in identifying the inner/outer function for simple composite functions like $tan(x^3)$, we can move to Step 2. Here, we will have two inner functions, like $tan(ln(5x))$.

Let's go! As usual, identify the inner/outer functions and differentiate.



We will start with an example. Let's consider a function:

$sin(ln(x^2))$

My preference is to always start from the most inner function. So, it must be the first thing we apply to x - here we square it.

⭢ So, the most inner function is $x^2$.

Then we take natural logarithm of it - ln()

⭢ So, the second inner function is natural logarithm $ln()$.

Then finally we apply outer function to it - sine:
outer function is sin()

Now the derivative of $sin(ln(x^2))$ is as you know from the Step 1 the product of derivatives of each inner and outer functions:

first inner function is $x^2$ with derivative 2x

second inner function is ln(argument) with derivative $\frac{1}{argument}$, in our case the argument is $x^2$, so we just plug it in: the derivative is $\frac {1}{x^2}$

outer function sin() with derivative cos() and plugging in the argument we get: $cos(ln(x^2))$

Final derivative is: $(sin(ln(x^2)))'=2x\cdot \frac{1}{x^2}\cdot cos(ln(x^2))$



Let's do 3 more examples together, and than you will do a couple on your own

Identify first inner, second inner and outer function and differentiate:

16. $e^{ln(x^2+1)}$

first inner: $x^2+1$

- and its derivative: 2x

second inner: ln(), its derivative is $\frac{1}{()}$ where in empty brackets is the argument of ln(): $x^2+1$. So $\frac{1}{x^2+1}$.

outer: $e^{()}$, its derivative is $e^{()}$ where in empty brackets is the argument of $e^{()}$: $ln(x^2+1)$. So $e^{ln(x^2+1)}$.

derivative of $e^{ln(x^2+1)}$ then is:

$(e^{ln(x^2+1)})'=e^{ln(x^2+1)}\cdot \frac{1}{x^2+1}\cdot 2x$



17. sin(cos(5x+2))

first inner: 5x+2
derivative is 5

second inner: cos()
its derivative is -sin()
plugging in the argument: $-sin(5x+2)$

outer: sin()
derivative is cos(), plugging in its argument: $cos(cos(5x+2))$

final derivative of this composite function:

$(sin(cos(5x+2)))'=\\=cos(cos(5x+2))(-sin(5x+2))\cdot 5$




18. $e^{cos^{2}(x)}$

first inner: cos(x) - because first cosine is applied to x and only after it is being squared
derivative is -sin(x)

second inner: $()^2$
with derivative: $2cos(x)$

outer: $e^{()}$
derivative is function itself $e^{()}$,
plugging in its argument: $e^{cos^{2}(x)}$

final derivative:

$(e^{cos^{2}(x)})'=e^{cos^{2}(x)} 2cos(x)(-sin(x)) $

Now, a couple similar examples for you - identify inner/outer and find derivatives:

16) $e^{cos(ln(x))}$
17) cos(sin(15x))
18) sin(sin(x+2))

Answers are at the botoom
of the page


Let's continue solving the examples:

19. $tan(\sqrt{x^2+x+1})$

first inner: $x^2+x+1$ with derivative 2x+1

second inner: $()^{\frac{1}{2}}$ with derivative $\frac{1}{2}()^{-\frac{1}{2}}$ plugging in the argument: $\frac{1}{2}(x^2+x+1)^{-\frac{1}{2}}$

outer: $tan()$ with derivative $sec ^{2}()$,
plugging in the argument: $sec ^{2}(\sqrt{x^2+x+1})$ - I will do it in one step from now

final answer:
$(tan(\sqrt{x^2+x+1}))'=\\=( 2x+1)\cdot \frac{1}{2}(x^2+x+1)^{-\frac{1}{2}}\times \\ \times sec ^{2}(\sqrt{x^2+x+1})$

Example for you: Identify and Derive
19) $ tan(cos^{2}(x))$




Let's do more together:

20. $(log_{8}(log_{10}(x)-5))^2$

first inner: $log_{10}(x)-5$
with derivative $\frac{1}{xln(10)}$ (have the table of derivatives with you:) )

second inner: $log_{10}()$
with derivative: $\frac{1}{(log_{10}(x)-5)ln(10)}$

outer $()^2$ as square is applied to everything that is inside
with derivative : $2(log_{10}(log_{10}(x)-5))$

final answer:
$ \Big((log_{10}(log_{10}(x)-5))^2\Big)'= \\= \frac{1}{xln(10)}\frac{1}{(log_{10}(x)-5)ln(10)} 2\times \\ \times (log_{10}(log_{10}(x)-5))$


Finally, couple examples for you and Step 2
is done

Identify the inner and outer function:

20) $log_{8}e^{2x}$

21) $log_{5}^2 (sin(x))$


Answers.

Practice identifying inner/outer function in the next worksheet in Step 3.