The table showing the change of sign to 4 decimal places shows that the change of sign occurs between 0.7448 and 0.7449. .
It is positive when 0.7448 is inserted in to the equation. f(0.7448) = 0.001453
It is negative when 0.7449 is inserted in to the equation. f(0.7449) = -0.0000077
So, the root is 0.74485 plus or minus 0.00005. This is true to 4 decimal places. I therefore need to show this graphically. I have demonstrated this in the graph below. It clearly shows that the line cuts throught the x-axis in between 0.7448 and 0.7449.
Where this method fails: Although this was successful, this cannot be said for some other examples, one of which I will demonstrate. I will use a parabola as an example. If I take the equation y=(x-3)², it is obvious that this is a parabola as a minimum. This means that it only touches the x-axis at one point. It is a repeated root. If the change of sign method is used at any point, the sign will never change as the entire parabola is positive – never crossing the x-axis.
Newton-Raphson Method
When using this method, I will gind all of the roots of a second equation and I will illustrate one of these graphically. I will be using this equation…, where f(x) = 0
f(x) = x³-13x+14
This is the unaltered graph.
Using the Newton-Raphson method, I will choose a starting point (x1) of positive 3 and will draw a tangent to the line at this point on the x-axis – where x = 3. Where the tangent cuts the x-axis, I will have as my x2, my second point. I will draw a new tangent here and continue the process. I will illustrate this root graphically, but the other two purely numerically. I need to differentiate this equation, in order to use this method as the Newton-Raphson formula is as follows.
xn+1 = xn – f(xn)
f’(xn)
This equation differentiated is f’(x) = 3x²-13.
So, using the formula and these two equations I will demonstrate my substitution skills.
x2= 3 – 3³- (13*3)+14
(3*3²)-13
x2= 3 - 2
14
x2= 2.85714
By using this same method, but shortened significantly by using the ANS button on my graphical calculator, I will find x3,, x4 etc…
x3 = 2.84423
x4 = 2.84181
x5 = 2.84134
x6 = 2.84125
x7 = 2.84123
x8 = 2.84122
x9 = 2.84122
Here is the process shown graphically.
So, when it gets to this point, we know that the root is 2.84122 to 6 significant figures (plus or minus 0.000005) as there has been repetition to this level of significance. To check this is the root to this error bound, I will check the sign of the y-co-ordinate on each side of the root. This should be different on each side if the line crosses the x-axis.
It is positive when 2.841225 is inserted in to the equation. f(2.841225) = 0.00000329
It is negative when 2.841215 is inserted in to the equation. f(2.841215) = -0.00000793
There is a change of sign so there is a root there to this significance.
Now I will find the other roots without showing it graphically, using firstly x1 = 0.
x1 = 1.07692
x2 = 1.20810
x3 = 1.21482
x4 = 1.21484
x5 = 1.21484
So, this root is 1.21484 to 6 significant figures (plus or minus 0.000005), but I will again employ the changing sign method to make sure.
It is negative when 1.214845 is inserted in to the equation. f(1.214845) = -0.00000580
It is positive when 1.214835 is inserted in to the equation. f(1.214835) = 0.00000277
So, for the last root I will try x1 as –3.
x1 = -3
x2 = -4.85714
x3 = -4.20901
x4 = -4.06333
x5 = -4.05608
x6 = -4.05606
x7 = -4.05606
This is also correct to 6 significant figures…
It is negative when –4.056065 is inserted in to the equation. f(-4.056065) = -0.0000171
It is positive when –4.056055 is inserted in to the equation. f(-4.056055) = 0.0000193
There is therefore a change of sign, so –4.05606 is correct to 6 significant figures, plus or minus 0.000005.
Where this method fails: If the starting point (x1), is where the gradient = 0, ie where there is a stationary point, then the danger is that the calculator will show that an error has been made, because you cannot divide by 0. (f’(x) is the gradient by definition of the line f(x).) This is illustrated where the starting point is 0 on the equation y = -x²+3. When this is entered, the tangent that is drawn does not cut the x-axis at all as it is parallel to it.
x2 = 0 – -0²+3
(2*-0)
x2 = 0 – 3
0
x2 = ERR – when typed into the calculator.
On Autograph when you bring up the Newton-Raphson iteration object box and you type in 0.0, it says divergent in the results box, which is the opposite to convergent, when the numbers get more accurate and closer to the root. Divergence in this case is when the tangent never reaches the x-axis.
Rearranging f(x)=0 in the form x=g(x)
I will be using the equation y=x³-5x+1. This is equal to 0.
After looking at the graph I can see that it cuts through between –3 and –2, 0 and 1, 2 and 3.
If I rearranged this equation so that x was the subject – in the form x=g(x), this is what I would come up with.
5x=x³+1
x=x³+1
5
I will use this and a starting value to converge on a root. By drawing the line of the g(x) formula and the y=x line, I can see where they cross on autograph. It is this point where the unarranged formula crosses the x-axis. I have chosen the root between 0 and 1. My starting value will therefore be 0. As you can see on the graph below, the starting value follows the green line towards 0.2.
In closer detail you can see that this converges on a point near 0.2016.
To make this more accurate – to more significant figures, I must carry out this test manually – with a graphics calculator.
Where this method fails: This method fails whenever the line diverges. In this example of the rearrangement of the line x²-x-3=0. The rearrangement is x=x²-3. I’ll show the first few steps (there are infinite steps as the line never reaches a point. It is simply going towards infinity.
xn+1=x1²-3
x2 = -3
x3 = 6
x4 = 33
x5 = 1086
x6 = 1179393
As you can see, the iterations just keep getting further and further from the point. It’s because the formula involves squaring the last number, so will never stay low for long.
Comparison of Methods
I will now compare how the three methods manage to find the same root, the speed of convergence to find that root and how easy each method is to implicate with the software and hardware present. Earlier, I found that a root of y=x³-4x²-11x+10, is 0.74485 plus or minus 0.00005. I will now find the same root using the Newton-Raphson method (using 0 as the starting point).
x2 = x1 - x1³-4x1²-11x1+10
3x1²-8x1-11
x2 = 0.90909
x3 = 0.74735
x4 = 0.74490
x5 = 0.74489
x6 = 0.74489
So, there has been repetition to four significant figures and these four figures are the same as that of the earlier method (0.7448). This has been successful. I will now employ the rearrangement method, using the same starting point (0).
Making x the subject of y=x³-4x²-11x+10
xn+1=x1³-4x1²+10
11
x2 = 0.90909
x3 = 0.67687
x4 = 0.77068
x5 = 0.73472
x6 = 0.74885
x7 = 0.74335
x8 = 0.74550
x9 = 0.74466
x10 = 0.74499
x11 = 0.74486
x12 = 0.74491
x13 = 0.74489
x14 = 0.74490
x15 = 0.74489
x16 = 0.74490
x17 = 0.74489
x18 = 0.74490
x19 = 0.74489
x20 = 0.74489
So, it took 20 iterations for this oscillating method to get the root it was converging upon to 4 significant figures repeating twice to show it was finally there. This method, therefore is very slow in finding the root, it takes 20 steps to converge, although there is no need to do the change of sign to check for error bounds as it continually oscillates anyway. (That is an added bonus!)
This has created a cobweb diagram.