[Music]
the first concept that we're going to
look at is the chain rule now this is
also known as a function of a function
rule and that's purely because of the
nature of the kind of function that
you're looking at let me show you an
example we have a question which says
find the gradient of y equals to 2x
cubed plus 1 to the power of 5 now if
you look at this closely we haven't done
a question like this before
purely because it's a function inside of
another function we have 2x cubed plus 1
and inside it's inside another function
which is to the power of 5 so you can
see that this is a function of a
function and in order to do this we will
have to use the chain rule I'm going to
give you the definition for this before
and then we're going to go into licking
breaking it down and proving the
definition and also doing a little proof
for the chain rule so given a function f
of G of X so you have G of X as a
function which is within another
function which we are calling f the
gradient of this function can be given
as f differentiated as a whole so you
differentiate the outside function and
then you differentiate the inside
function so we're differentiating G of X
multiply them together and that should
give you the entire differential of F G
of X which is f differentiated as a
whole and then the inside function
differentiated by itself and they're
multiplied together don't worry too much
about this if you don't understand we're
going to look at numerical examples
break it down and then also prove it so
let's look at our problem again a little
bit closely now we have y equals to 2x
cubed plus 1 to the power of 5 now let
me just explain what I meant earlier
when I said a function of a function you
have one individual function here which
is 2x cubed plus 1 and then that is
inside another function which is
something to the power of 5 it's quite
important that we practiced looking at
functions of functions or functions
where we use the chain rule so you as we
go through the course
you'll see that we'll do a variety of
different questions which helps you find
functions of functions so we can apply
the chain rule now I'm going to show you
how to do this numerically and we'll
bring back the definition shortly to
make life a little bit easier we're
going to say let two u equals to two x
cubed plus one so we've taken the inside
function here and we're just calling it
2x cubed plus one and so our entire Y
function now becomes y equals to u to
the power of five you see that we've
separated them the two functions and
we're now going to deal with them
separately which makes our lives a lot
easier remember the objective is we're
trying to differentiate so we're
calculating the gradient so we're going
to differentiate each one of them
separately we're going to differentiate
U with respect to X because that has an
X function within it and that gives us
6x squared but then we're also going to
differentiate Y but in this case we're
going to differentiate Y with respect to
U so we'll write that out as dy by D U
which then gives us five bring the power
down U and decrease the power by one so
five minus 1 so that gives us five u to
the for now we've differentiated the two
separately but remember what we're
looking for when you differentiate we're
looking for dy by DX because that's what
the gradient is do you lay DX and dy by
D U at the moment makes no sense
that's not telling us the gradient so in
order to find the gradient we somehow
need to find dy by DX or dy over DX
observe these two differentials here if
we need dy at the top we do have dy at
the top here and we need DX at the
bottom so we do have DX at the bottom
here so how about we attempt to multiply
those two functions if I rewrite it as
dy by D u so that's this function here
multiplied by D u by DX which is this
function here you will observe that the
D U is cancel out leaving you with just
dy by DX
and that simply put is the definition of
the chain rule or it's what we're doing
and we'll look at the other definition
or a faster way of doing it in a second
let's just apply this here so we take
our dy by D U which is this term here so
we've got five u to the four we multiply
it with our D u by DX which is this term
here so that's 6x squared
we tie you this up the two numbers can
multiply to give us 30 u to the four x
squared the question or the answer
shouldn't have a UNH remember u was our
own doing so we kind of used you as our
own substitution so you can replace this
u with this function here just replace
it back to what we changed it to earlier
to give us 32 x cubed plus one x squared
or just to write this correctly we can
write it as 30x squared 2x cubed plus
one to the four and here is your
differential so if there you've just
found the differential of this function
here which looks fairly complicated but
just by using the chain rule we have
come to our derivative which is 30x
squared brackets 2x cubed plus 1 to the
power of four now let me just rewrite
the definition here for a chain rule you
can say that dy by DX is dy by d u x d u
by D X so remember this that's one of
the definitions for the chain rule and
luckily for us there is once again a
faster way of doing it which we can just
do by observation if you just think of
what we've done here so let's just
observe and see if we can ourselves find
shortcuts we have taken the inside
function which is 2x cubed plus 1 and
we've differentiated to give us this we
have also taken the outside function
which is just u to the 5 and we have
differentiated to give us this function
here so basically if you just think of
what you're doing without having to
writer or break it down into these steps
we are taking the outside function and
differentiating it
and then we are separately separately
differentiating the inside function and
timesing it together let me just show
you that quickly here on the side and
how we can do it faster so if I use my
function once again y equals to two X
cubed plus 1 to the power of five I'm
just going to use the logic that I've
used I'm going to differentiate the
outside function without changing
anything so I bring the power down
should do that the next line here let's
just do that as dy by DX so I'm gonna
get rid of this so dy by DX we're going
to differentiate the outside function as
a whole so ignore anything that's on the
inside just ignore this for now we
differentiate this bring the 5 down that
gives you 2x cubed plus 1 so observe how
I'm not changing the insight at all
nothing's happening to it I just brought
the power to the front and I'm
decreasing the power by 1 once I've done
this I'm now going to focus on the
inside function here so what is the
differential of 2x cubed it's 6x squared
and now if you write it all together if
we just do that here that gives me 30 x
squared 2x cubed plus 1 to the 4 and you
can see that they're the same answers
and it's really up to you which one you
choose as mathematicians we always like
a full definition so this is our chain
rule definition in case we're ever faced
with more complicated problems we know
where it comes from but we also like
shortcuts we like faster ways of doing
it and we like observation so just by
observing how to get to this answer here
by using the rule we can say that we can
use a much faster rule which is the
outside function first and then the
inside and then we can come to the same
answer so we'll mix between the two and
see whichever method is more appropriate
obviously we will give preference to the
faster method because it's easier but if
we ever need to we will come back to the
other chain rule 4 method in the future
[Music]
you