Hello internet. Oscar Veliz here showing you how to find roots using Newton's Method.
And Newton's Method is a really neat algorithm that's a lot faster than Bisection and it's
pretty simple too.
So let's get started.
First off, what is Newton's Method?
Well, Newton's Method says to first pick an x that's close to the root of a function.
And then also take the derivative of the function to get f prime. Then plug it into this formula
of x n plus one is equal to x n minus the function at x n divided by f prime of x n.
And please make sure that f prime of x n is not zero so you don't get a divide by zero
error.
Afterwards you're going to repeat until converges where x n is about the same as x n plus one.
Here's a good example and graphical representation. So say you want to find the root of the function
sine of cosine of e to the x.
When you have your function you first pick an x so pick this x and call it x one. And
you're going to find the derivative at the point to get the slope.
What it's really giving is a tangent line of this function at x one. And then you're
going to use that line to find your next x, which we'll call x two.
And we'll repeat this process until we come up with a root. So now if we take the derivative
of the function at x two we're gonna get another tangent line.
And this time where that intersects is close to the root and we'll keep going until we
find something that's acceptable and the function converges.
Please note though that your point really should be close to the point you want to find.
However if the point that you get has a slope of zero then you'll never know where to calculate
your next x.
Now let's say we want to find a square-root using Newton's Method. Well first we're going
to use this function of x squared minus a, and find its derivative of two x.
This works because f of x is zero when x squared is equal to a and therefore x is equal to
square-root of a. So using Newton's Method we're finding square-root without using a
square-root function.
When we plug it into Newton's Method we're gonna get that x n plus one is equal to x
n minus the quantity of x n squared minus a divided by two at the x n.
Now we can stop here or simplify a little further and come up with this function but
really the first equation is all you need.
Now let's do another example. Let's say your function is x to the seventh minus a thousand.
So what this function is really asking us to do if we want to find the root of it is
to find the seventh-root of a thousand. Let's say that the... your TI-89's battery is dead
and you're left to use a four function calculator. What do you do?!
Use Newton's Method. So we'll plug this into our formula for Newton's Method and come up
with this equation. Let's pick x one to be three. Plug this into our equation to find
x two which turns out to be two point seven six seven something or other.
Then we'll take x two and replace it where we had x one. We do that and we'll come up
with x three, which is two point six nine double-oh eight, and so on and so forth.
Repeat the process we get x four which is two point six eight. Notice, that the numbers
don't seem to be changing a whole lot from the previous iteration. This means that its
coming close to converging. We repeat this process, x five turns out to be two point
six eight two and so forth. And then x six turns out to be two point six eight two and
so forth. Now notice that x five and x six match in about eight decimal places and you
can use this as your answer.
Now let's talk about the order of Newton's Method. As you might remember from my Bisection
video, the order, alpha, is equal to the natural log of some error division divided by the
natural log of another error division. And so all we need is three errors to figure out
what our order is. So if we are given three errors, we simply plug those in and we come
up with an alpha about two point zero zero three.
Now this is saying that the order of Newton's Method is quadratic, however it isn't always
going to converge quadratically for all functions; and Newton's Method isn't always guaranteed
to converge at all. But if you start close enough to your root your function should converge.
Thanks for watching, hope you learned something.