Stony Brook MAT 122 Fall 2017
Lecture 19: The Chain Rule
October 11, 2017

Start   Um if you go into Blackboard, which you don't have to do right now, and you look under documents I put up the histogram. I don't have a way to show you so anyway.
So the histogram gives you sort of the chart of how everybody did in the class.
Most people got 65-ish or higher.
Remember it's only out of 85.
And a lot of you got 75-ish or higher.
So if you want a feel for how you did if you did below about 65 you didn't do that well.
0:31Okay? Even 64 or some number like that because this does it in groups of 5 so it's not precise.
Um if you broke 75 then you got a high score.
Which should be good enough for you for now because as I said I don't compute an actual grade now.
I wait and I do the grades at the end because I want to see how the second and final exam, see how the second and the final come out.
Okay any questions?
No? Okay there's a new homework coming up I think tomorrow.
1:00So you'll, if you check my math lab you'll see a new homework tomorrow.
And there will be a new aper homework up tomorrow that'll be due next week.
Alright? I was working on that yesterday. It's almost done.
I'll finish it off today and then you guys I know excited you are to have more math homework.
Right?
Some of you are making excited faces. Some of us don't care.
We're just texting, watching videos, having a good time, which is fine.
Because opposed to your parents I actually don't care if you sit here texting the entire class.
1:32Um okay so we did the product rule and the quotient rule last time.
So for those of you who didn't take calculus before, now we're going to do the chain rule.
The chain rule is the one type of derivative that people seem to struggle with the most.
So the chain rule is what you do when you have a function inside another function.
But right now we have very simple stuff.
Like we've had find the derivative of you know something like that.
2:05That's a very easy derivative to take right? It's 2x+4.
But we've had- or we haven't had where you took this and say that we raised it to the fifth.
Take the derivative of that. It becomes complicated.
And you could write that- first of all you could expand that out.
But that's a lot of work. Suppose we had something to the 50th it would be ridiculous. Okay?
The second is you could write this times this times this times this five times and do the product rule a bunch of times.
2:32That would also be really unpleasant. So there has to be another way to take the derivative of functions that look like that.
Because these kinds of functions show up a lot.
Sometimes they're just as simple as you know an x^2 or x^3 but it's something of x^2 like we're not doing trigonometry but the sin of x^2.
So you want to know how are you going to deal with those functions and the chain rule deals with that.
So the chain rule says...
3:07we define y as a function with another function inside of it.
A composite function.
And the derivative- you take the derivative of the outer function and you leave the inside function alone, times the derivative of the inner function.
3:35Okay so you say I have an outer function and an inner function inside it.
First I'm going to do the derivative of the outside, I don't touch the inside, and then I multiply it by the derivative of the inside.
For example let's say I had (x^2+ 4x +1)^5.
As I said you wouldn't want to multiply that out. It's just a lot of work.
4:00So you say well this is really two functions.
First I'm taking x and I'm performing an operation, a function.
What do I do well I take x and I x^2 +4x +1 so that's the first thing I do.
Then I take that answer and I raise it to the fifth.
So my outer function is something to the fifth.
And my inner function is the polynomial. Does that make sense?
So the outer function is the raising to the fifth and the inner function is the polynomial.
So if I wanted to do the derivative first I just so the derivative of the fact that this outer function is to the fifth.
4:33So I'm going to do 5 times the inside to the forth.
Okay? So that's sort of my first derivative of this part where this I don't do anything to.
Okay?
So that's the derivative to the fifth. Times the derivative of the inside.
That's it.
5:00And if you multiply this out, you took the derivative and you multiplied this out, and you compared them you'd get the same answer.
So let's take an easy one and we can see if that's true.
Say I had y= (x^2 +3)^2.
And you can do this two ways. You can do the chain rule
5:30and not the chain rule.
So with the chain rule take the derivative. So you say to yourself okay two things are going on.
I have the function on the inside x^2+3 and then I'm squaring it.
So my outer is, I'm taking 2 times what's on the inside and then raising it to the 1. We don't really need the 1 there.
And then I'm going to multiply that by the derivative of the inside.
6:06And if we wanted to simplify that 2*2x is 4x so you get 4x^3 +12x.
So that's what I would get if I cleaned it up.
Remember I told you you very rarely actually have to simplify these.
Unless you want to do another derivative. So if I wanted to do the derivative again then I would want to clean this up first before I took the derivative.
6:32Now if I didn't do the chain rule I could multiply that out and I could get x^4 +6x^2 +9.
And now if I took the derivative I'd get 4x^3 +12x.
So that's not proof that the chain rule works every time of course but that shows you that there's two ways to get to the answer.
So if I were doing (x^2 +3)^2 I would multiply it out and then just take the derivative.
Because I'm pretty comfortable with that kind of algebra.
7:02Even if it was cubed I would probably do it out but some of you guys pretty fast you're going to say that algebra is too messy for me. I'm going to want to use the chain rule, which is what you should be doing.
So let's practice another one of these.
Say I had y equals...
7:30It would take a growing effort to multiply that out.
It would probably take me the better part of oh 20 minutes of frantically scribbling all that stuff down. Maybe longer.
Maybe a half hour. And then mess it up.
I'm sure. I mean it's just too easy to make a mistake.
So let's take the derivative.
The derivative says do the derivative of the outside.
So the outside function is 10 times this thing to the 9th.
8:01And what's the inside? It's 8x^3 -6x^2 +2x +1.
Times the derivative of the inside.
Of course we can't do all of them this easy. I have to make them harder.
And by the way you can have multiple layers of the chain rule.
8:33So you can have the function inside of another function inside of another function so you work your way in.
One layer at a time. The good news is since we're not doing trigonometry we're not going to run into too much of that.
We'll see it a little once we start doing next dimensionals and logarithms.
But we're not going there yet. Still just doing polynomials.
Alright let's have you practice one before I make them harder.
9:14Okay that should take you a minute.
9:55Somebody's phone is really going crazy.
Alright we got it? We need another minute?
10:05By the way you guys remember where we took the midterm last time last week?
It's the same room for the next midterm.
I'll post it at some point but same room.
Usually you get the same room twice in a row but not always.
Everybody good? Did we like that one? Easy to find?
Not an issue? Okay? No complaints?
We'll see how you feel in the winter time. Alright dy/dx.
10:35So as I said outer function is cubic.
So you're going to do 3 times that inside function squared.
Times the derivative of the inside.
All good?
Alright now let's make it a little bit harder. So how can I make it harder? Let's see.
11:12What if I gave you this? Let's see.
11:40Alright you guys ready to take that one on?
Now you have to do the product rule and the chain rule.
You can do it. I have faith.
15:03Okay so when you're doing the product rule, right? Remember the product rule is the first one, times the derivative of the second one, plus the second one times the derivative of the first one.
So the derivative of the second one you're going to need to use the chain rule.
And then you do the second one times the derivative of the first one so the derivative of the first one you're going to need to use the chain rule.
Okay?
It's not that hard it's just messy.
I'll give you another minute.
17:05Alright let's do this one.
So this is the part where people start to get thrown with the chain rule.
As I said we're going to do multiple layers with the chain rule.
Which I'll do one in a minute just to be sadistic.
Okay so remember as I said for product rule you take the first function times the derivative of the second plus the second function times the derivative of the first.
So we have the first function
17:33times the derivative of the second function. So what is the derivative of the second function?
We need the chain rule.
It's 4 times this function to the third so that's 7x^2 -2x +3.
Times the derivative of the inside. 14x-2.
You don't have to use square brackets if you don't want to.
18:00Plus the second function times the derivative of the first function which you use the chain rule.
It's 5 times that thing to the forth which x^3 +4x +1.
Times the derivative of the inside. 3x^2 +4.
Okay?
How'd we do on that one?
18:31This is painful because it's a lot, it's messy, that's why you don't do these in pen.
Some of you insist on working in pen anyway. I don't know why.
Pens are for people who never make a mistake.
Alright we're going to do another one of these.
19:18There you go. Chain rule and the quotient rule.
Get to work folks.
Remember I could ask you to take the cosine. But not in this class.
23:51Alright are we ready? Let's go over this one.
Before we go over this one I forgot the forth here.
24:04Alright so quotient rule so remember what the quotient rule is.
It's the bottom function times the derivative of the top function and it's the bottom function times the derivative of the top minus the top times the derivative of the bottom over the bottom squared.
So the bottom function times the derivative of the top function so the top function you're going to need the chain rule.
24:35[3(x^2 -4x +2)^2] Times the derivative of the inside.
Minus the top function times the derivative of the bottom.
The bottom we need the chain rule. 4(6x +5)^3 times the derivative of the inside which is 6.
25:06And then the whole thing on the bottom squared.
So that's (6x+5)^8.
So again, bottom function and the derivative of the top you use the chain rule so that's 3 times the function squared, times the derivative of the inside minus the top function, see I forgot to cube again, top function
25:31times the derivative of the bottom which is 4(6x+5)^3 times the derivative of the inside which is 6.
And then divided by the whole thing squared. How did we do?
Eh? Let's practice another one of these.
You'll get the hang of the chain rule soon and then it won't be an issue.
See the chain rule you'll need when you do the derivative of something like e to the x^2 instead of e^x.
26:04Then you need the chain rule. Um how about one of these?
Suppose we had something like that.
So remember this is the same thing as writing this.
26:30To the 1/2.
So your outer function is to the half power.
And your inner function is the quotient.
We'll let you guys do it for a minute first.
29:47Alright long enough. Derivative.
First you do the derivative of the outer function.
So the derivative of the outer function is 1/2 times the inner function to the -1/2.
30:06See how I sort of just leave that empty for a second?
So I know that that's the first thing I'm doing. You're just doing the derivative of the thing to the 1/2.
That's x^2-4x / x^3 +2x.
Now you do the derivative of the inside.
So remember with the derivative of the inside is the quotient rule.
The quotient rule is the bottom function
30:34times the derivative of the top function, minus the top function times the derivative of the bottom function, over bottom function squared.
Okay so again first you do the derivative of the outside.
31:01Which is 1/2, leave the inside alone, to the -1/2.
And then the derivative of the bottom, the quotient, sorry the inside, the quotient, is bottom function times derivative of the top, minus top function times the derivative of the bottom over the bottom suqared.
We didn't like that one did we?
I could throw in some maybe e to that or something to really mess with you.
Let's have you practice a couple more.
31:34Chain rule is really more of a technique than anything else.
And once you get the hang of it, as I said, you'll be good at it.
And the kind of chain rule stuff that will show up will actually be fairly straightforward.
We really just want to make sure you could do it.
And then once I feel that you could do it we'll leave it alone.
32:47Okay.
38:05Another minute.
38:38Alright that's good enough for now. Let's go over these.
Alright so this is to the tenth.
So the first thing you're going to want to do is take the derivative of the thing to the tenth.
Then raise it to the 9th.
So (8x-5/3x+2).
39:02Then you want to multiply by the derivative of the inside.
So it's the bottom times the derivative of the top minus the top times the derivative of the bottom.
Over bottom squared.
And believe it or not you could actually simplify this.
Because you have (3x+2)^9 and (3x+2)^2 so you could put that together and get (3x+2)^11.
39:35You'll get some cancelation here but you would only want to do that if you needed to use a simplified version of the equation to find the zero or take another derivative. As you'd imagine it's a real mess so otherwise you just leave it alone.
Alright the other one.
So this is raised to the 1/3 power. That's what cube root means.
So dy/dx is 1/3 (x^2+ 2x+1)(x^3 -5x+4) to the -2/3.
40:14Times the derivative of the inside. I made that a little big so let's see if I could squeeze that in.
Function on the left times the derivative of the function on the right.
40:31Plus the function on the right times the derivative of what's on the left. Hey I made it.
Okay?
So where do these show up? W'ere going to practice this more on Friday so don't be too depressed.
More typically you get something like this.
And you want to find the derivative.
So you say but isn't that just the 1/x so it's -1 over that squared?
41:03No this requires the chain rule.
Because this is the same as x^2 +5 -1.
So you have an inner function. You have the x^2 +5.
So the derivative would be -1(x^2 +5)^-2.
41:30Times the derivative of the inside.
Which you could rewrite as -2x / (x^2 +5x)^2.
Okay, which you don't have to but you could.
So as I said you look at this and you think this is just 1 over but it takes a little more work to do the derivative.
So there's a few like this so we're going to, as I said, we're going to practice some more of these on Friday.
42:01Then you'll start to get better at them. Okay everyone have a nice day.