Here is a graph of the function f(x) = x4+5x3-7x+2
The graph shows the equation 0 = x4+5x3-7x+2 has 3 roots clearly distinguished. However, when I try to find the solutions by using the change of sign method it only display one change of sign and the second change of sign is over looked.
Newton Raphson Method
Newton Raphson Method is an iterative process. It is used for finding approximations to the roots of a real valued equation.
Here is the procedure to perform the Newton Raphson Method:
- Find an approximation of the route is taken at a line equal to x
- A tangent is drawn down to the x-axis and past the edge point of the curve
- This new position on the x-axis would be drawn 90 degrees back to the point of the equation line and another tangent is drawn and taken back down to the x –axis
- Repeat procedure 3 until a sufficient value for the root is found
Newton Raphson formula:
Xn+1 = Xn - f(Xn)/f’(Xn)
Xn: An estimated value of the root
f(Xn): The value of the Xn substituted into the equation
f’(Xn): The value of the Xn substituted the differential of the equation
This is the equation I would use to demonstrate the method 0 = 2x3+5x2-2x-7
Below is a graph of the function f(x) = 2x3+5x2-2x-7
This equation has 3 roots. They each lie between intervals [-2, -3], [-1, -2] and [1, 2].
Take an estimated value from each intervals, Root 1:-2, Root 2:-1 and Root 3: 1. I would now use the Newton-Raphson formula Xn+1 = Xn - f(Xn)/f’(Xn) to find the 3 roots.
f(Xn) = 2x3+5x2-2x-7
f’(Xn)= 6x2+10x-2
Root 1
x = -2.25528 (5 d.p.)
Root 2
x = -1.37411 (5 d.p.)
Root 3
x = 1.12939 (5 d.p.)
Limitation of Newton-Raphson Method
Although Newton-Raphson is a great method of finding roots to an equation, but when the value is taken close to or at a minimum or maximum point, the method would fail to find the point to a root. I will use the equation 0 = x3-3x+1 to demonstrate how Newton-Raphson method fails to coverage.
Here is a graph of the function f(x) = x3-3x+1
I have chosen 0.9 as a starting point to find the root between 0 and 1.
Newton Raphson Formula
Xn/x=1
f(Xn)= x3-3x+1
f’(Xn)=3x2-3
Result
As we can see from the results above, the answer is showing the root between interval [1,2] rather than the root between [0,1]. Here is a graph used to demonstrate how the method fails.
Rearranging f(x) = 0 in the form of x=g(x)
Rearranging method is also an iterative process. It is similar to the Newton Raphson method as it uses the last answer to get closer to the value of the root. However, this method requires a particular rearrangement of the equation f(x) = 0 into a form of x=g(x). It will allow us to convergence to a root of the equation. The formula for this method is Xn+1 = g(Xn).
The equation that will be looked at for this method is 0 =2x3+x-4, the graph of which is illustrated below.
I am going to rearrange my formula into the form of x=g(x)
2x3+x-4=0
x=4-2x3
The two rearranged equations would be plotted against the line y=x, shown by the graph on the next page.
To find the root to the equation 2x3+x-4=0, I would integrate an estimated value for x into one of the equation. By using the iterative process on the rearranged equation, I will be able to find the root to the equation up to 5d.p.
I am going to use the rearranged equation x=((4-x)/2)1/3 and starting with the estimated x value x0 = -1, the results for successive iterations are as following:
The root of the equation 2x3+x-4=0 has a root1.12817 +/-0.000005
I will now carry out the differential of g(x) then integrate the root value to the differential equation to see if the root value has carried out correctly. If the gradient of x=g is 1≤x≤1 then it is proven to be correct.
Differentiate g(x)=((4-x)/2)1/3 by using the chain rule and the quotient rule to give g’(x).
((4-x)/2)1/3
w=(4-x)/2
y=3√w=w1/3
=1/3((4-x)/2)-2/3
Formula for Quotient rule: dy/dx=[v(du/dx)-u(dv/dx)]/v2
w=(4-x)/2
u=4-x v=2
du/dx=-1 dv/dx=0
[2(-1)-0(4-x)]/22
=(-2-0) /22
=-2/4
=-1/2
dy/dx=1/3(-1/2)((4-x)/2)-2/3
=-1/6((4-x)/2)-2/3
The root 1.12817 to 5d.p. is integrated back into the differential equation.
-1/6((4-1.12817)/2)-2/3
=-1/6(1.435915)-2/3
=-0.1309472135
Error Bounds
The error bound for the equation 2x3+x-4=0 has a root is 1.12817 +/-0.000005 to the 5d.p.
Limitation of Rearranging Method
Using the other rearranged equation x=4-2x3 from the same equation, I will show how this method fails to coverage.
The result shows that the rearrangement, x= the 4-2x3 has failed to find the root during the iterative process. The number sequence has been diverted and consequently increasing the number without limit. To be sure that this rearrangement has failed, I will differentiate the g(x), x=4-2x3 and insert the root that I have found from the previous rearrangement. If the gradient of this rearrangement is greater or smaller than 1≤x≤1, then it is proven to be failed.
4-2x3
dy/dx=-6x2
Integrate the root value, 1.12817.
-6(1.12817)2
=-7.636605293
The answer appears too small and therefore this rearrangement has failed.
Comparison of Methods
Using the Change of Sign method and Newton Raphson method to the equation 2x3+x-4
The equation 2x3+x-4 =0 was originally used in the demonstration of the rearranging method. By using the other two methods to find a root of the same equation, I can make a comparison with regards to the speed of convergence between the tree methods and the ease of use with available hardware and software.
The graphs below show the function f(x)=2x3+x-4
From the graph above, we can see the equation 0=2x3+x-4 has 1 root. It lies in the interval [1, 2].
Change of Sign Method
Taking increments in x of 0.1 within the interval [1, 2]
Continue with the increments of 0.01 within the interval [1.1, 1.2]
Continue this process until the third decimal value of the root has found
x=1.1285+/-0.0005(3d.p.)
Newton Raphson Method
Formula: Xn+1=Xn-f(Xn)/f’(Xn)
f(Xn)= 2x3+x-4
f’(Xn)=6x2+1
Integrate the x value and the result is shown below:
x=1.12817+/-0.000005(5d.p.)
The three techniques demonstrated in this coursework all have their own advantages and disadvantages. In comparison with the speed of the methods, ‘the change of sign’ method is the fastest due to its simplicity and direct approach to the root of an equation. However, this method would have been done slowly without using Microsoft Excel software.
Although the change of sign method has the fastest technique to calculate the roots of an equation, the accuracy of the answer compare to the other two methods is far from beyond. Both the Newton-Raphson method and the Rearranging method had given a much accurate results by giving the answer up to nine or more decimal places.
In terms of accuracy via speed, the Newton-Raphson method reaches a high degree of accuracy in a relatively short amount of time compare to the “Rearranging” method. The Newton-Raphson method requires a differential of the equation first before the process can begin, but once is set up highly accurate results can be achieved in a short amount of time. In the “Rearranging” method, the equation has to be rearranged in the form of x=g(x) and once the equation is rearranged, it has to be checked each time by the differential of x=g(x). The steps required from the “Rearranging” method are more than the Newton-Raphson method and therefore the Newton-Raphson method is quicker than the “Rearranging” method.
The use of software Omnigraph, Coypu and Microsoft Excel has benefited for all three methods. The graphs were easily plotted by using Omnigraph and Coypu, so the approximate interval values can be easily spotted. Microsoft Excel has helped me to calculate and display all of my calculations. However, the required differentiation from the ‘Newton Raphson’ and ‘Rearranging’ cannot be done by any program/software, therefore it had to be done by hand.