Stony Brook MAT 125 Spring 2015
Lecture 23: l'Hopital's rule and Newton's method
April 27, 2015

Start   There's only a little bit of stuff left before the final.
People have been asking me what's gonna happen What if I get, you know, a B on here and an A on here and an F there and what is my final grade gonna look like?
Okay?
The final is designed to help your grade, not hurt your grade.
Final part 2, ok?
If you take the final part two and you do well, it's gonna make a big difference on your final grade.
If you do badly, it's not gonna make a big difference because, you know, you have all the other stuff.
It's not gonna drag you down very much.
But, good grades on the final will help.
0:31The final is not really gonna be harder, it's just gonna be material we haven't put on part 1.
Related rates, implicit differentiation, um, maximum minimum, graph, some of the word problems that you love so much, I saw a couple eye rolls just then.
um, and then the new stuff.
So this week we're gonna go through the final material, the final set of material.
And next week I have a review on Monday and Wednesday for the final homework.
And then we have a review session scheduled
1:03a week from Monday Monday, May 11th.
Ah, I forget what it is. I'll post it.
I think its 12-2.
Ok?
And it's in Javits so you can bring your friends.
You can bring your enemies.
You can bring your dog.
Actually you can't bring your dog.
Ok?
Are we good?
So we're going to do l'Hopital's Rule and what's called Newton's method,
1:30I need to look something up for a second.
One person brought their book.
It's very exciting to buy the textbook.
Most people don't.
I didn't hear you.
Yeah, we use this book again for 126.
But again, you don't need to buy it.
if you don't want to.
Ok? I'm gonna design the course you do not need to buy the book.
But you should feel free to buy the book.
2:00Come on, where is it? There it is So now we're going to learn l'Hopital's Rule.
Okay.
So L'Hopital was a French guy.
He actually wrote the first calculus book in 17 whatever.
And he's the hospital. He's the hospital's rule.
2:31Ok? I don't know who Marquis de L'Hopital was but he was a rich guy.
Who paid very smart people to do lots of research and then he took their research and claimed it was his own.
But he paid them for it, so it was ok.
He told them in advance. He said I'm going to hire you to do research And then if it comes out well I'm going to put my name on it.
Um, and that's ok.
That's what makes America great.
Except he was French.
Um, so what is L'Hopital's rule?
3:01And by the way, you might find this very useful on part 1.
Even though you technically don't need it, you may find it useful.
L'Hopital's rule is a way to do limits for what are called indeterminate forms.
So, an indeterminate form is a limit where you end up with something like 0/0, ∞,∞ A couple other types.
So we see some examples of that already.
3:31So L'Hopital's rule is another way to solve these.
Ok?
And it says Suppose the limit as x goes to a of f(x)=0 and the limit as x goes to a g(x)=0
4:00then the limit, and some minor constraints here and there, of f(x)/g(x) Ok, suppose the limit as x goes to a of f(x) is 0.
and the limit as x goes to a g(x) is 0.
Then the limit as x goes to a of f(x)/g(x) which is gonna give you 0/0,
4:30is the same as the limit, you can't really see this, of f'(x)/g'(x) That's very handy.
For example, Suppose you wanna do the limit as x goes to 1 of natural log of x also known as e(x)
5:03over x-1 Ok?
So you get log(x)/(x-1) I'll put it this way.
Is that backwards or is that forwards?
This is forwards. This is backwards.
Um What do we do?
Well, you look at this you say well if I plug in 1, the log(1) is 0, and if I plug in 1 in the bottom I get 0,
5:32So it's 0/0 The limit does not exist.
Wrong.
The limit does exist.
So what do we do? You take the derivative.
Now this isn't quotient rule.
It's just the derivative of the top divided by the derivative of the bottom.
Now to take the limit.
And that gives you 1 on top, 1 on the bottom, So that's 1.
6:00It's not does not exist.
It's not 0/0, it's just 1.
Suppose we had So this is already kind of following my rule You can also do this with infinities.
6:32So as well as where f(x) goes to 0 g(x) goes to 0, they could both go to infinity which would give you this form.
You could do L'Hopital's rule again.
So you have (e^x)/(x^2) This is the same as the limit as x goes to infinity.
of (e^x)/2x And now in the part with infinity you get ∞/∞
7:00So what do you think we do?
We do L'Hopital's rule again.
You get the limit as x goes to ∞ of (e^x)/2 Ok? Now, its infinity, so we know the answer's infinity.
Yes.
7:30∞/∞ wasn't 1 here it was ∞.
∞/∞ depends on the type of ∞. Ok? In other words It depends on how fast the top is going to infinity versus how fast the bottom is going to infinity.
They're both going there.
But one is going so much faster than the other that it dominates the function.
And it's as if the other function doesn't matter.
Ok?
Alright, what if we had
8:09Now you should be able to look at that and instantly tell me what the limit is.
Right?
3/5 but let's do L'Hopital's rule cause you got ∞/∞.
So take the derivative.
And you get (6x+6)/(10x-2)
8:31Once again, that's ∞/∞.
So you do it again.
And now you get 6/10, which, oh my god, is 3/5.
Awesome.
Ok?
I think it's that way actually.
9:00Did we have a good time at the concert on Friday?
Was 21 Pirates or whatever it was Death at the Disco or something like that?
I thought there were pirates I was all excited. I had my mask and my eye patch.
No.
No, it didn't happen.
Alright so that is one aspect of L'Hopital's rule.
This could be handy, for example, if we had a trig function.
I know you're saying why didn't you teach this to us earlier?
9:40Suppose we had something like that.
Where you plug in 0 and you get 0/0.
That's bad.
Cause we don't know what to do with 0/0.
So we do L'Hopital's rule.
Mr. L'Hopital is very proud of his rule.
10:02Even though he didn't actually do it. It was one of the Bernoulli's.
We're just not sure which one. We'd have to do a little research to figure it out.
As I said, it's like, the Pythagorean Theorem wasn't actually necessarily done by Pythagoras.
I know, you're shocked.
But he gets the credit anyway because, well you know, there you go.
Alright, what's the derivative of sin4x?
Cos4x.
times 4.
10:31And what's the derivative of sin5x?
Cos5x times 5.
Now when you plug in 0, cosine of 0 is One.
Cos0 is 1 so this is just 4/5.
Ok?
So, L'Hopital's rule is very handy.
I would make sure that I knew this rule for at least the next 2 1/2 weeks.
11:00After that, you should remember it for second semester, and then you could forget it. Or not.
Now, there's other types of what they call indeterminate forms.
Suppose we had, I'll wait. Does somebody have this written down?
Gonna be on video. But you don't really watch these videos do you?
No, ok.
Madison watches them.
11:38What do you do if you have, like, ∞/∞ or 0/0 Suppose the limit as x goes to something if f(x) is ∞
12:00g(x) is ∞. What would you do with f(x)-g(x) Which is ∞-∞?
∞-∞ should be either ∞ or 0.
That would kinda make sense.
But not necessarily.
Suppose you had to find wait, we'll erase for a second while you guys copy.
12:40Any ideas?
What do we do?
Well, that's always a good answer in calculus classes, to take the derivative.
But not quite yet.
13:01Well, we wanna turn it into what we just did a minute ago with L'Hopital.
So what could we do?
Remember the trig identities?
Secant is the same as what?
I know you memorized these and forgot them.
That's called not actually memorizing them.
Right.
And tangent is sin/cos
13:33You're gonna need to know the unit circle next semester too.
I know.
Tattoo.
You come back with a tattoo, you get an A for the course.
No problem.
You should tattoo the unit circle here too. It would be very entertaining during the exam.
Well the people sitting behind you would be very grateful.
No mirrors.
No mirrors, sorry.
He's right it's not a calculator. We'll think about it.
14:01First get the tattoo and then we'll talk.
It would be great if they screw it up.
Alright. So now, we could turn this into (1-sinx)/cosx Aha. Now Mr. L'Hopital has discovered a problem.
14:36Oh, I keep writing infinity, this isn't to infinity. I'm sorry.
Phew.
My bad.
That's as x goes to pi/2 Doesn't work with infinity. Yea.
Wow. One of those days.
15:04Okay, that should be x goes to pi/2 from the left side now it's a minus.
So, you're thinking the graph. Coming out of the origin the first branch of the graph.
Alright now, we could take the derivative.
And you would get -cosx/-sinx Ok? Thats cotangent of x.
Or you could just plug in pi/2 and see what happens.
15:32This gives you 0/1=0 Ok?
So, you had, when you plugged in pi/2 you get ∞-∞, Ok?
You do a little rearranging and you can turn it into a fraction.
Now when you do L'Hopital's rule you get an answer.
You look confused.
You ok?
16:00Got it? Alright?
So, that's another fun example of L'Hopital's rule.
What are some other ones that we thought we would test?
Let's try.
17:58Alright, here's three to try.
18:01Have some fun with L'Hopital's rule for a couple minutes.
23:43I think enough people are waiting for me that I should move on.
Are you ready?
Yes?
24:01Ya?
Ya? Ok.
So, the limit as x goes to infinity of log(x)/square root of x Well let's see.
Log(∞) is ∞ Square root of ∞ is ∞ So we can't do much with that.
We can take the derivative of the top and bottom.
And we get the limit as x goes to infinity The derivative of log(x) is 1/x And the derivative of the square root of x is 1/(2 rootx)
24:40Ok.
Now We could take this Right now if we plugged in infinity we'd get 0/0 That's not helping.
So, invert and multiply Flip and multiply And you get 1/x times (2 root x) / 1
25:02Which simplifies to Limit as x goes to infinity 2 over square root of x.
Now when you plug in infinity, you get 0.
Ok?
How'd we do on that one?
Good?
Ok.
You're gonna win tonight. Ok.
Second one. Let's take some derivatives.
25:33Limit as x goes to 0. Everybody see this am I still in the way?
0.
Ok?
What's the derivative of sin8x?
Cos8x times 8.
Derivative of tan4x is sec^2(4x) times 4.
26:04Ok.
Now the fun part is from the sine of 0 and 0 that causes you a problem.
But the cosine of 0 is 1 that does not cause you a problem So, 8 times cos0 is 8 times 1 is 8.
4sec^2(0) well, cos(0) is 1 so sec(0) is also 1 So that's 4.
So this comes out to 2.
26:34You get 2?
Well you got 8 over 4.
Well this guy might not have accepted that, but, I will accept it.
Alright.
I'm gonna just give myself a little, better room for this one.
I have 1+2x square root - 1-4x square root
27:06All over x.
When I plug in 0 I get 1-1 is 0 over 0.
So now what do I do?
I copy off my smart friend.
Or, I could use L'Hopital's rule.
But why did I break this into 2 fractions first?
27:37And do that.
It just makes it easier to do all the stuff, right?
I don't have to, you know?
You want me to rationalize it?
Let's rationalize it.
You wanna do that?
Let's see.
How about,
28:00You think that's gonna work?
Why?
Well we're gonna need L'Hopital's rule eventually because that's what we're doing right now.
I know you guys can't hear what they're saying but they don't have anything important to say.
It's ok.
It's just, you know, audience chatter.
What happens if we rationalize this?
We'll get 1+2x
28:31-(1-4x) What did I do here?
So, let's see. We get 6x on top And some x's cancel so we get 6.
29:03How did I get that?
(1+2x)-(1-4x) is 6x.
Which cancels with that x so I get, well leave it there for a moment.
I get 6x over x times Ok?
So I've still got 0/0.
And now what happens?
That should be a 2.
29:35Does that work?
What do I get? X's cancel.
And now I get 6 over 2 is 3.
Here you go.
I didn't even need L'Hopital's rule.
You don't always need L'Hopital's rule.
I just copied this problem from the book I didn't check.
It says use L'Hopital's rule if you need to use L'Hopital's rule.
So you didn't on this one.
30:00No, actually.
The question was do you need to use L'Hopital's rule on this one? The answer is no.
Ok?
You should have a bag of tricks.
So, when we give you limits on the final, Ok?
You should try to do it without, you should try to do it with L'Hopital's rule.
You should see what works out.
Ok?
I don't know if we're gonna say use L'Hopital's rule on the exam or not.
Haven't figured that out yet.
It's cause we haven't written the exam.
30:30Alright, that's enough L'Hopital.
Let's do the other thing.
This is called Newton's method.
Newton actually did Newton's method.
31:37Alright, hat goes back off.
Serious now.
Alright, Newton's method is a method for finding roots of an equation.
Suppose we know that we have some graph
32:04And, there's a 0 right here.
How could we find that 0?
Well, plug it in your calculator.
But, if we didn't have that calculator, Newton came up with a very clever method.
So we know what's here so let's take a value that's close.
Like here.
And draw the tangent line.
Ok?
So you'd say, well now you get an answer right around there.
32:31Now you draw a tangent line at this spot.
And now you get an answer that's right around there. Then you draw the tangent line in that spot You're really close.
So, you use the answer each time to find a new answer. Let's do that again, let's blow that up.
So you can see what's going on.
I'd wanna find the 0 which I know would be here.
So first I take a place close to that, like lets say that's 1 and that's 2.
33:02Then I draw the tangent line.
and I find where it hits the x-axis.
I said ok well that's a good guess, that's not that far away So now I go to here.
And I draw the tangent line again.
Now I've got a really good guess.
And I go to here, and draw the tangent line again. Oh boy am I close.
So, with 3 or 4 iterations, take the answer plugging it back in,
33:32you can get very close to the answer, very quickly.
So how does that work out in reality?
What you do is follow.
This is our formula. Ok?
You make a guess, which we call x.
So Ok, we start with x sub 0 then x sub 1, x sub 2 and so on.
34:02Then, you get the next guess.
You're gonna plug it in this formula.
X sub n minus The function of x sub n divided by the derivative of x sub n.
F.
The derivative at x sub n.
That came out badly.
Let's do one in action.
34:33Ok, so say we have a curve f(x)=x^3-2x-5 And we wanna find an approximate root.
We're gonna find about where it's 0.
And we're gonna start our first guess is gonna be 2.
We know the answer's not 2 because we plug it in You get 8-4-5-9
35:01is -1. So 2 doesn't work.
But 2's close.
Ok where did I come up with 2 by the way?
If I plug in 1, I get 1-2-5 is -6.
If I plug in 2 I get 8-4-5 is -1.
When I plug in 3 I get 27-6-5 is 16.
So, at 2 I was close because I was just under the x-axis, -1 And at 3 I'm well over the x-axis, so somewhere between 2 and 3 closer to 2 is the right answer.
35:35That make sense? So again I know f(2) is -1 and f(3) was um 15.
Ok? So somewhere between f(2) and f(3) is the answer between 2 and 3 is the answer.
Alright. So let's take a guess.
Now I'm gonna need the derivative.
Because this is a calculus class.
36:06And now we find x sub 2.
So you get x sub 2, you take x sub 1 and subtract F(x sub 1)/F'(x sub 1) So that's 2-(f(2)/f'(2))
36:37What's f(2)?
Well, -1.
And what's f'(2)? 10.
So f comes out 2.1.
2 and 1 tenths.
Ok?
Newton says now to get x sub 3 you do x sub 2 - (f(x sub 2)/f'(x sub 2))
37:13Which is 2.1- (f(2.1)/f'(2.1)) I already know what you guys are gonna ask me.
Now you plug this in and you get 2.0946.
37:33We expect you to do that with your calculator.
Right?
No.
You say but if I can use my calculator why don't I just use the 0 part of it?
The answer is, it's Newton's method you gotta learn it.
Ok? But we have webassign problems on this.
Some of them will say find it to 8 decimal places.
Ok? So that means you gotta keep doing this until you get, until basically it stops changing.
38:03Which, takes about 4 iteration usually.
It's faster than you think.
Newton's method is very accurate with these kind of equations.
Ok?
Four we're gonna give it to you, we gave it to you without using a calculator.
We'll make you do it say twice.
Ok?
And the first number will be easy and the second number will be easy...ish.
Ok? But we might ask you to use 1/2.
38:30You have to be able to do things like (1/2)^2 and (1/2)^3, it's not that unreasonable, to your knowledge.
Ok?
But, we wouldn't ask you to do crazy numbers, it's not fair.
So let's try one, let's say
39:04So if I was doing something like this, let's start, too easy.
No.
I was right the first time.
Ok.
You have f(x)=(x^3)+x-3=0.
And I note that f(0) is -3, f(1) is -3, that tells me nothing.
39:35f(2) is 7.
So there's a root somewhere between 1 and 2.
You see why there's a root between 1 and 2?
It's negative on one side and it's positive on the other side.
Somewhere in the middle is 0.
That's the intermediate value theorem.
40:00So take a derivative.
You get 3x^2+1 And now let's do a little bit of Newton's method.
Our first guess is gonna be, we'll start with 1.
You know I would guess 1 1/2.
Ok? With a calculator if you start with 1.5 you'll get there very fast.
Ok, but we'll start with 1 because we don't have a calculator.
So to get x₂ I'm gonna take x₁ - f(x₁ )/f'(x₁ )
40:49That's equal to 1-f(1)/f'(1)
41:01Ok?
f(1) is -3, f'(1) is 3+1 is 4.
So you've got 1 and 3/4 or 7/4.
If you have to do it by hand, don't do 1.75.
Make it a fraction.
As much as you love fractions.
Cubing 1.75 would probably be harder for you than cubing 7/4.
41:30Ok.
So to get x₃ we're gonna take 7/4 and subtract f(7/4)/f'(7/4) Ok.
(7/4)^3 is 343/64.
Plus 7/4 which is 112/64.
42:04So that's 455/64.
Minus 192/64 is 263/64.
You guys can do that in your head right?
I could just be making that stuff up.
You wouldn't even know.
Alright, (7/4)^2 is (49/16) times 3.
Which is 147/16 +116, 163/16.
42:33And that's some mess.
Ok, it's actually not that bad it simplifies pretty well.
But, I won't bother.
Ok, then you get this answer and you do it one more time.
Ok, so if we give you one of these to do by hand It won't come out very difficult.
Ok, for more than 1 or 2 steps, we just need you to understand the principle, really.
So let's have you all try one.
43:03Why not?
Without a calculator or with a calculator, I don't care.
You can't use a calculator but you can use your cell phone the calculator app.
Or you could use your new apple watch.
How many of you have an apple watch so far? 0 that's what I thought.
44:02Ok? Try L'Hopital's rule twice.
Feel free to use your calculators.
48:21Later, ok later when we edit this you will point out that f(1) is -3 that's because I meant (x^3)-x-3 but whatever.
48:31We're past that problem now.
So move on to the new problem.
Alright, so let's do this. X₁ is 1.
So we're gonna need the derivative.
We get 3x^2-1.
This is the fun thing about doing arithmetic in your head. Every once in a while you mess up.
Even, even the gods.
Ok, so to get x₂ we're gonna take x₁, were gonna subtract f(x₁)/f'(x₁)
49:09x₁ is 1.
F at 1, ok we'll plug it in carefully.
And you get 1-1 is 0, minus 1 is -1.
Now you go to f'(1) and you get 3-1 is 2.
49:30So this comes out 3x.
Ok, so this is the type we could give you on a test.
Remember you'll have scrap paper.
Ok, so you get the next guess, you'll take 3/2-f(3/2)/f'(3/2) f(3/2) is uh, (27/8)-(15/8) is (12/8).
50:04It's 3/2.
Is that alright?
That can't be right.
(27/8)-(5/2) is (27/8), no minus (20/8) 7/8.
7/8, good.
f'(3/2) is 3 times (9/4) is 27/4.
50:31Minus 1 is 23/4.
And that's something I wouldn't be afraid to ask you to do because that becomes 3/2 Minus (7/8) times (4/23).
Some cancelling.
You get (3/2)-(7/46) Is 124/92 which is uh, 31/23.
51:08How did I do it?
Of course, 31/23, see then we're both wrong or both right, ok.
Alright, so that's Newton's method.
So here's the fun part: there's only one topic left before the final.
That's gonna be antiderivatives.
51:30Ok?
Well how do you know when you're done? That's a good question.
Well, you could keep going.
Until you get really close, as a fraction you start to get ridiculous fractions.
A big number over a big number.
Or, decimals you start, what happens is like, the first four decimal places don't change.
Like, only the fifth changes and then the next one and then maybe only to 7.
So very quickly you've got incredibly good precision.
So most of the time 2 or 3 decimal places is really all you care about.
52:01You know, if you want 8 decimal place accuracy that's nice but I don't know what you need it for.
Ok, maybe if you were designing like contact lenses but for most things, 3 is pretty good for contact lenses.
Ok? So, with Newton's method you stop when we tell you to stop basically.
But if you do it on a calculator you'll see, very quickly the answer won't change.
It'll just keep coming out the same which means it's like 20 decimal places out.
Alright so Wednesday, we're gonna do antiderivatives which is going backward.
52:30But now you can go study for your chem tests.
See you later.