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 it?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 looking, 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 were 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 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 practice looking at functions of functions
or functions where we use the chain rule. So as we go through the course
we?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 gonna 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 to u equals to 2x cubed plus 1.
So we?ve taken the inside function here and we?re just calling it 2x cubed plus 1.
And so our entire y function now becomes y equals to u to the power of 5.
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 it that has an x function within it and that gives us 6x squared
but then we?ll 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/du, which then gives us 5 bring the power down u
and decrease the power by one so 5 minus 1 so that gives us 5u to the 4.
Now we?ve differentiated the two separately but remember what we?re looking for
when you differentiate we?re looking for dy/dx, because that?s what the gradient is.
du/dx and dy/du 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/dx or dy/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/du, so that?s this function here multiplied by du/dx which is this function here.
You will observe that the du?s cancel out leaving you with just dy/dx.
And that?s simply put is the definition of the chain rule
or what we are doing and we?ll look at the other definition or faster way of doing it in a second.
Let?s just apply this here, so we take our dy/du, which is this term here so we?ve got 5u to the 4.
We multiply it with our du/dx which is this term here so that?s 6x squared.
We tidy this up, the two numbers can multiply to give us 30u to the 4x squared.
The question or the answer shouldn?t have the u in it.
Remember u was our own doing, so we kind of used u 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 30, 2x cubed plus 1, x squared
or just to write this correctly we can write it as 30x squared, 2x cubed plus 1 to the 4.
And here is your differential so 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 4.
Now, let me just rewrite the definition here.
For a chain rule you can say that dy/dx is dy/du multiplied by du/dx.
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 differentiate it 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 write it or break it down
into these steps, we are taking the outside function and differentiating it
and then we are separately differentiating the inside function and timesing it together.
Let me just show you that quickly here on the side on how we can do it faster.
So if I use my function once again, y equals to 2x cubed plus 1 to the power of 5,
I?m just gonna 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 in the next line here let?s just do that as dy/dx.
So I?m gonna get rid of this. So dy/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 inside at all, nothing?s happening to it.
I just brought the power to the front and I?m decreasing the power by one.
Once I have done this, I?m now gonna 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 30x 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 will 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 full method in the future.