WEBVTT mathematics/ap-calculus-ab/hovasapian
00:00:00.000 --> 00:00:03.900
Hello, and welcome back to www.educator.com, welcome back to AP Calculus.
00:00:03.900 --> 00:00:07.200
Today, we are going to be talking about something called Newton's method.
00:00:07.200 --> 00:00:18.300
It is a way of finding the roots of any function, the 0’s if you will, places where it touches the x axis.
00:00:18.300 --> 00:00:23.400
Interestingly enough, for all the powerful methods that we have developed over the years,
00:00:23.400 --> 00:00:29.900
the numerical methods for finding roots, Newton's method still actually ends up being the one that most calculators
00:00:29.900 --> 00:00:35.000
and computers used to do so because it finds them very quickly.
00:00:35.000 --> 00:00:39.200
We use the term converge, it converges to the root very quickly.
00:00:39.200 --> 00:00:42.300
Let us jump on in and see if we can make some sense of this.
00:00:42.300 --> 00:00:48.000
It is actually very simple.
00:00:48.000 --> 00:01:07.500
Let us start off with, there is a way of using the derivative, since we are still talking about applications of derivatives,
00:01:07.500 --> 00:01:24.900
there is a way of using the derivative to find the root also called the 0’s of a function.
00:01:24.900 --> 00:01:26.400
Here is the geometry of it.
00:01:26.400 --> 00:01:36.300
I’m going to go ahead and draw a little like this and I will go like that.
00:01:36.300 --> 00:01:42.600
It involves making it so we see that the root is like right here.
00:01:42.600 --> 00:01:49.500
We want to find what that root is and this is just some f(x).
00:01:49.500 --> 00:01:58.400
Let us start by making a guess, either by looking at the graph or maybe you know something about the function, just making a first guess.
00:01:58.400 --> 00:02:01.400
Let us guess like right over here.
00:02:01.400 --> 00:02:04.700
We will call that our x1, our first guess.
00:02:04.700 --> 00:02:16.100
If we go up to where it meets the graph, this is going to be the point x.
00:02:16.100 --> 00:02:22.700
This is going to be the point x1 f(x1).
00:02:22.700 --> 00:02:28.100
I will go ahead and put brackets around that since I got parentheses around there.
00:02:28.100 --> 00:02:30.500
That is that one.
00:02:30.500 --> 00:02:36.800
At this point, I take the derivative of that point and find the tangent line.
00:02:36.800 --> 00:02:54.000
If I follow that tangent line to where it touches the x axis, not the best tangent line but you get the point, that is going to be our x2.
00:02:54.000 --> 00:03:04.200
This x2, the point is x2, let me write it over here.
00:03:04.200 --> 00:03:10.300
The coordinate of that point is x₂,0.
00:03:10.300 --> 00:03:13.000
Starting with x1, I go up to the graph.
00:03:13.000 --> 00:03:20.200
I follow that tangent line, the derivative, the f’, down to where it hits here.
00:03:20.200 --> 00:03:25.000
Let us find the equation for this line.
00:03:25.000 --> 00:03:28.600
Let me actually write down the process.
00:03:28.600 --> 00:03:36.500
Make a first guess, this is our x1.
00:03:36.500 --> 00:03:59.300
Follow f’(x), the slope, follow f’(x) down to where it touches the x axis.
00:03:59.300 --> 00:04:03.000
This is going to be our x2,0.
00:04:03.000 --> 00:04:21.300
The equation of the line, the equation of this line is just y - y1 = m × x - x1.
00:04:21.300 --> 00:04:26.100
We know that already.
00:04:26.100 --> 00:04:36.400
This is our x1 y1 x2 y2, we can go ahead and write,
00:04:36.400 --> 00:05:11.800
I will take this, I will write y, f(x1) - 0 = f’(x) × x -, I will do x1 – x2.
00:05:11.800 --> 00:05:34.700
x1 – x2, when I rearrange this, I get x2 is equal to x1 – f(x1) divided by f’(x1).
00:05:34.700 --> 00:05:43.100
Having picked a first guess, x1, this formula gives me a method of finding x2.
00:05:43.100 --> 00:05:46.800
If I just keep going, x1 follow down to here.
00:05:46.800 --> 00:05:49.800
Notice x2 is actually closer to my root.
00:05:49.800 --> 00:05:52.500
From x2, I go up and I do the process again.
00:05:52.500 --> 00:05:56.700
Now the tangent line is going to put me here at x3.
00:05:56.700 --> 00:06:03.600
If I go up again, it is going to put me at x4, x5, x6.
00:06:03.600 --> 00:06:08.600
Within about 4 or 5, you are actually going to hit the root to a very high degree of accuracy.
00:06:08.600 --> 00:06:16.100
That is all we are doing, this formula, once I pick my x1, it gives me way of finding my x2.
00:06:16.100 --> 00:06:17.700
Then, my x2 becomes my x1.
00:06:17.700 --> 00:06:22.200
And I do it again, I find my x3, so on and so forth.
00:06:22.200 --> 00:06:29.100
I just keep following the derivative until I actually touch my root or get really close to it.
00:06:29.100 --> 00:06:39.300
That is the whole idea behind Newton's method.
00:06:39.300 --> 00:06:40.800
Let me write all of this down here.
00:06:40.800 --> 00:07:15.400
Having chosen an x1, we have a method for finding x2 which is closer to the root, and then, we just repeat.
00:07:15.400 --> 00:07:29.800
In other words, x3 = x2 – f(x2)/ f’(x2), and so on.
00:07:29.800 --> 00:07:36.400
And so on until x sub n + 1 is equal to x sub n.
00:07:36.400 --> 00:07:40.900
When you take, and let us say an x5, and then you end up doing an x6,
00:07:40.900 --> 00:07:48.700
if x6 = x5 to the number of decimal degrees of accuracy that you like, that you are happy with, you can stop.
00:07:48.700 --> 00:07:50.900
That is your root, that is all we are doing.
00:07:50.900 --> 00:08:13.400
The general formula for Newton's method is x ⁺n + 1 = x ⁺n - f(x) ⁺n divided by f’ (x) ⁺n.
00:08:13.400 --> 00:08:27.400
If the sequence x₁, x₂, x₃, and so on, if the sequence actually converges,
00:08:27.400 --> 00:08:48.100
actually gets close to a number, that number is a root of f(x).
00:08:48.100 --> 00:08:51.100
Very powerful, actually.
00:08:51.100 --> 00:08:57.500
The only thing you have to be careful of is this method does not always work.
00:08:57.500 --> 00:09:05.000
We will show you how this method does not always work but there are ways around it.
00:09:05.000 --> 00:09:09.800
The way around it is to actually either make a better guess, something closer,
00:09:09.800 --> 00:09:15.300
and that comes from knowing the function, graph the function.
00:09:15.300 --> 00:09:21.300
This method does not always work, we just have to watch out for that.
00:09:21.300 --> 00:09:27.600
Let us show you the circumstances under which this might actually fail.
00:09:27.600 --> 00:09:35.100
Let me go to the next page and do this actually.
00:09:35.100 --> 00:09:43.600
I have some function like that so let us say I take my x1 over here.
00:09:43.600 --> 00:09:46.000
I’m looking for, this is my root right there.
00:09:46.000 --> 00:09:48.400
Let us say I take my x1 over here.
00:09:48.400 --> 00:09:56.200
I go up to where it touches the graph and I follow.
00:09:56.200 --> 00:10:01.900
Notice it puts me like, let us say it is over here.
00:10:01.900 --> 00:10:15.100
This is my x2, now I take from my x2, I go down and I follow the tangent line.
00:10:15.100 --> 00:10:17.200
It puts me at x3.
00:10:17.200 --> 00:10:22.300
Depending on where you take your x1, where you get your first slope,
00:10:22.300 --> 00:10:25.900
it might actually end up shooting you farther out, when you come around.
00:10:25.900 --> 00:10:34.900
x2 might be farther out, then x3 might be farther up, and your x1 and x2, and so on, and it will just end up diverging.
00:10:34.900 --> 00:10:38.500
It will not actually get close to a number, those just blow up.
00:10:38.500 --> 00:10:43.600
The solution to that is just basically choose a better x.
00:10:43.600 --> 00:10:49.000
You do that by basically graphing the function, looking at a function and making a better guess.
00:10:49.000 --> 00:10:55.700
As long as you stay reasonably close, you will actually converge to the root.
00:10:55.700 --> 00:11:12.200
Here, the sequence starts to diverge.
00:11:12.200 --> 00:11:22.700
We really have to choose wisely.
00:11:22.700 --> 00:11:35.700
Again, this is just one more tool in your toolbox.
00:11:35.700 --> 00:11:55.800
That is all, that is all this is, knowing what the graph looks like goes a long way.
00:11:55.800 --> 00:11:57.400
Again, that is what we have been doing for so long.
00:11:57.400 --> 00:12:02.200
We have been graphing functions, we have been taking derivatives, finding critical points, maximums, minimums.
00:12:02.200 --> 00:12:06.200
We have used all of this information to graph the function.
00:12:06.200 --> 00:12:13.400
We want to use the graph of the function to help us make a good guess, as to where the root might be.
00:12:13.400 --> 00:12:15.500
Last of all, before we start the examples.
00:12:15.500 --> 00:12:27.500
This technique, clearly, because you have the x ⁺n + 1 = x ⁺n – f(x) ⁺n/ f’ x ⁺n.
00:12:27.500 --> 00:12:30.000
It lends itself very well in the computation.
00:12:30.000 --> 00:12:35.400
In fact, this is the algorithm that your calculator is using to find roots of the equations.
00:12:35.400 --> 00:12:44.700
This technique lends itself.
00:12:44.700 --> 00:12:57.900
To programmable and computational devices because it is algorithmic.
00:12:57.900 --> 00:13:09.900
It follows a series of steps, algorithmic, a series of reputable steps.
00:13:09.900 --> 00:13:17.400
That is really all an algorithm is.
00:13:17.400 --> 00:13:22.200
Let us do some examples.
00:13:22.200 --> 00:13:31.200
The following function and initial guess x1, find x2 and x3.
00:13:31.200 --> 00:13:33.500
I do not even have a function here.
00:13:33.500 --> 00:13:34.700
I will tell you what the function is.
00:13:34.700 --> 00:13:49.400
F(x) is x⁵ - 15x + 10 and our x1 is going to be 1.
00:13:49.400 --> 00:14:06.300
Very simple, our x1 is 1, we know our x2, it is just x1 – f(x1)/ f’(x1).
00:14:06.300 --> 00:14:18.900
Our f’ is nothing more than 5x⁴ – 15.
00:14:18.900 --> 00:14:45.600
This is going to equal 1 – f(1)/ f’(1), that equals 1 - f(1) is going to b -4/-10.
00:14:45.600 --> 00:14:51.500
That is going to be 0.6.
00:14:51.500 --> 00:14:53.900
Therefore, this is our x2.
00:14:53.900 --> 00:15:08.400
Therefore, our x3 is our x2 which is 0.6 - f(0.6)/ f’(0.6).
00:15:08.400 --> 00:15:15.600
When you do that calculation, you get 0.675, that is x3.
00:15:15.600 --> 00:15:17.800
If you want to see what x4 looks like, just keep going.
00:15:17.800 --> 00:15:29.800
X4 is equal to x3 which is 0.675 – f(0.675)/ f’(0.675).
00:15:29.800 --> 00:15:37.600
When you do this, you end up with 0.6761.
00:15:37.600 --> 00:15:43.900
Clearly, it converged very quickly, 0.6761, 0.675.
00:15:43.900 --> 00:15:50.500
Very good, this is a fantastic algorithm.
00:15:50.500 --> 00:15:56.800
Use Newton’s method to approximate the 6√27 to 8 decimal places.
00:15:56.800 --> 00:16:05.500
When you are given a number to approximate, treat it like this.
00:16:05.500 --> 00:16:22.000
x = 6√27, that is equal to 27¹/6.
00:16:22.000 --> 00:16:30.700
That is the same as x⁶ = 27, x⁶ - 27 = 0.
00:16:30.700 --> 00:16:36.700
Newton's method works because we are looking for roots, we are looking for 0’s,
00:16:36.700 --> 00:16:41.800
where it hits the x axis, which means we have to have some function set equal to 0.
00:16:41.800 --> 00:16:45.200
That is the whole idea behind Newton’s method.
00:16:45.200 --> 00:16:52.700
Now choose x1, choose an x₁.
00:16:52.700 --> 00:16:54.500
How do we choose? Let us try some things.
00:16:54.500 --> 00:17:01.200
If I take x₁ is equal to 1, 1⁶ is equal to 1.
00:17:01.200 --> 00:17:04.500
Let us try something else, let us try 1.5.
00:17:04.500 --> 00:17:10.500
If I take 1.5⁶, that is going to be 11.4.
00:17:10.500 --> 00:17:13.800
Let us go a little higher, let us try 1.7.
00:17:13.800 --> 00:17:19.200
We are trying to choose an x₁, a first guess.
00:17:19.200 --> 00:17:23.800
When I take 1.7 and I raise it to the 6th power, I get 24.
00:17:23.800 --> 00:17:30.100
24 is close to 27, let us go ahead and start with that.
00:17:30.100 --> 00:17:35.500
Let x₁ equal 1.7.
00:17:35.500 --> 00:17:48.100
x₂ is equal to 1.7 - f(1.7) divided by f’(1.7).
00:17:48.100 --> 00:18:03.200
This is f, f’ is just 6x⁵, that is it, that is all you are doing.
00:18:03.200 --> 00:18:05.300
F is on top, f’ is on the bottom.
00:18:05.300 --> 00:18:09.800
This is 1.7, by the way.
00:18:09.800 --> 00:18:17.900
When I solve that, I get 1.7336, now I find x3.
00:18:17.900 --> 00:18:33.200
x3 is equal to this, 1.7336 – f(1.7336) divided by f’(1.7336 ).
00:18:33.200 --> 00:18:36.700
I put 1.7336 into f, I get a number.
00:18:36.700 --> 00:18:40.900
I take the 1.7336 into f’, I get a number.
00:18:40.900 --> 00:18:50.700
I divide the f(1.7336) divided by the f’(1.7336) and I subtract it from 1.7336.
00:18:50.700 --> 00:18:59.700
When I do that, I get 1.732054.
00:18:59.700 --> 00:19:22.800
I do the same thing, x₄ = now this, 1.732054 – f 1.732054 divided by f’ 1.732054.
00:19:22.800 --> 00:19:36.400
I end up with 1.7320508.
00:19:36.400 --> 00:19:38.600
That is fine, does not really matter.
00:19:38.600 --> 00:19:43.100
Clearly, you just keep going until you get, in this case, a decimal place that match.
00:19:43.100 --> 00:19:48.500
If you end up doing x5, x6, or x7, and you end up getting the same answer as you did before,
00:19:48.500 --> 00:19:51.500
to 8 decimal places that is where you can stop.
00:19:51.500 --> 00:19:58.400
Very simple, nice and straight algorithmic process.
00:19:58.400 --> 00:20:03.200
Find the root of the following equation to 6 decimal places.
00:20:03.200 --> 00:20:22.200
This is our f(x), our f(x) is equal to sin x + cos x – x³, because we want an f(x) to set equal to 0.
00:20:22.200 --> 00:20:27.900
Just bring this over to that side so that you have 0 on the right side.
00:20:27.900 --> 00:20:32.400
This is our f(x) right here.
00:20:32.400 --> 00:20:47.100
Now f’(x) = cos x – sin x - 3x².
00:20:47.100 --> 00:20:54.300
When we look at the graph of this function to decide where our x1 is going to be,
00:20:54.300 --> 00:21:33.600
when we look at a graph of that function to see what we might choose for x₁, we choose x = 1.1.
00:21:33.600 --> 00:21:39.300
I look at a graph of this function, I just graph it using my graphing utility, whatever one I like.
00:21:39.300 --> 00:21:48.300
I just see where it crosses the x axis and I just estimate, something simple, 1.1.
00:21:48.300 --> 00:21:51.600
We go through our process.
00:21:51.600 --> 00:22:03.000
x₂ = 1.1 - f(1.1) divided by f’(1.1).
00:22:03.000 --> 00:22:10.600
When I do that, I get 1.103394.
00:22:10.600 --> 00:22:31.900
x3 is equal to 1.103394 – f(1.103394) divided by f’(1.103394).
00:22:31.900 --> 00:22:38.300
I get 1.103382.
00:22:38.300 --> 00:22:46.100
When I do x4, I end up getting 1.103382.
00:22:46.100 --> 00:22:51.200
This and this match to 6 decimal places, I can stop, that is my root.
00:22:51.200 --> 00:22:54.200
That is extraordinary, 6 decimal places is extraordinary.
00:22:54.200 --> 00:22:56.000
2 decimal places is extraordinary.
00:22:56.000 --> 00:22:59.300
Anything more than that is a bonus.
00:22:59.300 --> 00:23:07.100
I only went through four iterations, three iterations, 1, 2, 3, absolutely fantastic algorithm.
00:23:07.100 --> 00:23:11.900
Let us see what is next here.
00:23:11.900 --> 00:23:16.500
Use Newton's method to find the coordinates of the inflection point for the following function.
00:23:16.500 --> 00:23:23.800
F(x) = cos e ⁺x of the interval from 0 to π/3.
00:23:23.800 --> 00:23:35.800
Here, f(x) = cos(e ⁺x).
00:23:35.800 --> 00:23:47.800
F’(x) = -sin e ⁺x × e ⁺x.
00:23:47.800 --> 00:24:10.600
F” is equal to –sin e ⁺x × e ⁺x, this is product rule, + e ⁺x × cos(e ⁺x ) × e ⁺x.
00:24:10.600 --> 00:24:16.000
A point of inflection is where the second derivative f’ is equal to 0.
00:24:16.000 --> 00:24:33.700
F”(x) = 0, gives a point of inflection.
00:24:33.700 --> 00:24:46.900
We want the root of f”(x) not f(x).
00:24:46.900 --> 00:24:52.100
Be very clear, they are asking for us to find the coordinates of inflection point.
00:24:52.100 --> 00:24:55.100
We get an inflection point from the second derivative.
00:24:55.100 --> 00:24:58.700
We want the roots of f’(x).
00:24:58.700 --> 00:25:10.100
In other words, this is our f(x).
00:25:10.100 --> 00:25:14.400
Our f(x) is f”(x), we want to roots of that.
00:25:14.400 --> 00:25:21.900
That is going to give us an inflection point.
00:25:21.900 --> 00:25:26.900
Because of Newton's method, the function that we are looking for, we also need its derivative.
00:25:26.900 --> 00:25:44.600
We need F’(x) which is actually f’’’.
00:25:44.600 --> 00:25:49.100
One more derivative, let us go ahead and do,
00:25:49.100 --> 00:26:08.900
We said that f(x) is equal to -sin e ⁺x × e ⁺x + e ⁺2x × cos(e ⁺x).
00:26:08.900 --> 00:26:28.400
F’(x) is going to equal –sin(e ⁺x) e ⁺x + e ⁺x cos e ⁺x e ⁺x
00:26:28.400 --> 00:26:46.100
+ e ⁺2x × -sin e ⁺x × e ⁺x + cos(e ⁺x) × e ⁺x.
00:26:46.100 --> 00:27:02.300
I have my f and I have my f’.
00:27:02.300 --> 00:27:17.900
We form our x ⁺n + 1 = x ⁺n – f(x) ⁺n divided by f’(x) ⁺n.
00:27:17.900 --> 00:27:23.600
I’m hoping that you are doing this by using your calculator tool, that gives you a table of data and things like that.
00:27:23.600 --> 00:27:29.900
Looking at a graph, we have to choose our x₁.
00:27:29.900 --> 00:27:50.700
Looking at a graph of f(x), the original function which was the cos(e ⁺x) between 0 and π/3.
00:27:50.700 --> 00:28:08.100
When I look at the graph, an inflection point appears to be around x = 0.8.
00:28:08.100 --> 00:28:13.500
I’m going to take 0.8 as my x₁.
00:28:13.500 --> 00:28:20.400
x₁ = 0.8, x₂, I use this formula.
00:28:20.400 --> 00:28:28.300
I end up with 0.721951.
00:28:28.300 --> 00:28:39.000
x₃, I use this formula, I get 0.707864.
00:28:39.000 --> 00:28:47.200
x₄ = 0.707424.
00:28:47.200 --> 00:28:52.800
x₅ = 0.707424.
00:28:52.800 --> 00:28:55.500
It ends up being the same as the thing before, to 6 decimal places.
00:28:55.500 --> 00:28:57.600
I go ahead and I stop there.
00:28:57.600 --> 00:29:02.400
They wanted the coordinates, in other words they wanted both x and y.
00:29:02.400 --> 00:29:12.900
What I found was just the x, let us go ahead and find y.
00:29:12.900 --> 00:29:28.200
F(0.707424), the original function was -0.442121.
00:29:28.200 --> 00:29:53.700
Therefore, our coordinate equals 0.707424 - 0.442121.
00:29:53.700 --> 00:29:58.500
Let us see if what a graph of this looks like.
00:29:58.500 --> 00:30:03.000
Here is the graph, 0 π/6 roughly here.
00:30:03.000 --> 00:30:05.100
An inflection point, concave down.
00:30:05.100 --> 00:30:18.200
And it looks like here, concave up, there is your point 0.707 - 0.4, whatever.
00:30:18.200 --> 00:30:21.200
There you go, thank you so much for joining us here at www.educator.com.
00:30:21.200 --> 00:30:22.000
We will see you next time, bye.