In this segment we'll take a nonlinear equation
and solve it by the numerical method called Newton-Raphson method.
So, in this example we are given x cube equal to 20 is the nonlinear equation,
with the initial guess of x naught equal to 3 I’m going to solve by Newton-Raphson
method. We're asked to conduct two iterations to estimate the root of the equation, but we're
also asked to calculate the absolute relative approximate error at the end of each iteration,
and also the number of significant digits which are at least correct at the end of each iteration.
So, let's go and get started here. So, we have x cubed equal to 20 is the equation, and
we know that in Newton-Raphson method we have to rewrite our equation in the form of x equal to 0,
because that's what the algorithm works for. So, we will write down x cubed minus 20 equal to 0,
so that becomes our f(x) equal to that quantity. Now if we recall our
formula for Newton-Raphson method it looks like this.
So, what that implies is that we need to calculate the derivative of the function as well.
So, let's go ahead and do that: in that case f prime of x will be the derivative of
x cubed minus 20 and we get 3 x squared. So now we have everything which is
needed in order to be able to solve the problem. So, let's recall again: we have x sub i equal to
x sub i minus f of x i divided by f prime of x sub i. That's our Newton-Raphson method formula.
And for the example, which is given here, it'll be x I cubed minus 20 divided by 3 x i squared.
So now we are supposed to conduct two iterations; let's do iteration number one.
So, in this case now what's going to happen is that we'll have we'll choose i = 0. So,
if we choose i=0, with x one is equal to x naught minus x naught cubed minus twenty divided by three
x naught squared. So, we our initial guess is given as three. So, we substitute that,
and this gives us a number of 2.74074.
So, if that is the case now what we're going to do is we are going to
see that what kind of relative approximate error we get from here. For iteration 2 and see what
happens. So, for iteration 2 I’ll choose I equal to 1 so I’ll get x 2 is equal to x minus 3 minus
x 1 cubed minus 20 divided by 3 x 1 squared. So now it just becomes the idea about
doing the correct substitutions. So, because we just found out x one is this quantity right here,
2.74074. So, we are just substituting that. And the number which I get here is 2.71467.
Let's go and find out the absolute relative approximate errors. It will be the current
approximation minus the previous approximation divided by the current approximation times 100,
if we calculate in terms of percentages. So, we get this is our current approximation,
our previous approximation is this one, then we divided by the current approximation,
and in this case, we will get we're getting 0.960%. And now since we're
getting this number right here, we can very well say that, hey, we had in the previous
slide we had that hey when m is equal to 1, epsilon a has to be less than equal to 5% right?
So, which it is. When m is equal to 2, epsilon a has to be less than equal to 0.5%. So
that is not the case. So, what we will find out is that based on this number right here,
we are finding out that this implies that m is equal to 1, that we can be sure that at
least one significant digit is correct in our solution. And that's the end of this segment.