When decimal search method works:
I will try solving: F(x) = 0.2x5–x4+ x3+10
I made this function up, the reason why I choose this equation is because this equation has just 1 root. We know if this method does not find all the roots then it will fail so therefore to show it does not fail I choose an equation which just has 1 root. Also there is no formula to solve this kind of equation.
Figure 1 shows the graph of F(x) = 0.2x5–x4+ x3+10.
Figure 1
As there is only 1 change in sign we can state that there is only 1 root for this function. So the root are in [-2,-1] interval. Now I will calculate the values between -2 and -1 so that I can get a value to 1 decimal place.
Now we know the root lies between -1.6 and -1.5, but as I said I will try to find the root to 4 decimal place so I need to continue my calculation. The table below shows x values for 2 decimal places.
From this we know that the root lie between -1.51 and -1.50, so now we will zoom between -1.51 and -1.50 to see where the root lies. The table below shows calculation for 3 decimal place.
Now we can state that the root lies between -1.502 and -1.501, the calculation now would be from
-1.502 to -1.501. The table below shows value for x to 4 decimal place.
From the table above we can state that the root lie between {-1.5018 <x< -1.5017}, now we can do more calculation and get even more precise answer but we don’t know what is the precise accurate answer, the answer may be to 5 or even 10 decimal places. So it can take along time to find an accurate answer.
Root lies {-1.5018,-1.5017}
We can express this information as:
-
The root can be taken as -1.50175 with a maximum error of +/- 0.00005
- The root can be -1.50 to (2 decimal place)
Error bounds:
This method has the advantage that it automatically provides bounds within which a root lies, so the error is known. I found that the solution to be between -1.5018 and -1.5017, and these are its error bounds, which allowed me to quote the answer as -1.50175 +/- 0.00005, 0.00005 being half the interval between the error bounds.
F (-1.5018) = -0.0019
F (-1.5017) = -0.00065
WHEN THE DECIMAL SEARCH METHOD DOESN’T WORK:
I will try solving: F(x) =
The reason why I choose this equation is because; I need to prove that with some equation this method does not work. I know that this function has 2 roots, 1 of the root just touches the x-axis and it does not cross the x-axis.
Figure 2 shows the graph of the equation; you can see that this graph has 2 roots. Figure 3 shows zoom in of the graph showing that the function touches the x-axis but doesn't cross it.
Figure 2
Figure 3
From this table above you can see that there is only 1 change is sign, which tell us that there is only 1 root for this function. When we look at the graph we can see 2 roots, we stated in our objective that “if any method fails to find all the roots then the method has failed”.
The reason why this method failed is because the function just touches the x-axis but doesn't cross it, so there is no change of sign exists; hence we can’t use this method to calculate an estimate of the root. It is really import to draw a graph before doing this method, because mistakes would have been recognised or avoided if we draw graph before attempting the technique.
Method 2: Newton-Raphson method:
Description:
This is a fixed-point estimation method. The estimate starts at x1, for a root of f(x) = 0. A tangent is then draw to the curve y = f(x) at the point (x1, f(x1)). The point at which the tangent cuts the x-axis then gives the next approximation for the root, and the process is repeated.
When decimal search method works:
I will try solving: F(x) =
The reason why I choose this equation is because I need to prove that this method work and not only it has only few roots but it is very easy to differentiate this function. Figure 4 shows the graph of the function above. Figure 5 shows zoom in version of the graph.
Figure 4
Figure 5
As you can see there are three roots in this graph, they are in the interval, [-3,-2],
[-1, 0], [2, 3]
The gradient for the tangent to the curve at (x1, f(x1)) is f’(x1) (meaning dy/dx for x). The equation of the tangent is: y-y1 = m(x-x1). Therefore y-f(x1) = f’(x1) [x-x1]. This tangent passes through the point (x2, 0). Carrying on with this process, this will get closer and closer to the tangent. But there is a general formula for this process:
xn+1 = xn – {f(Xn)/f ’(Xn)}
Differentiating the function:
dy/dx = f’(x) = [1/7]*7 x7-1- [5*3]x3-1 + [5*2]x2-1- 5*0
= x6-15x2+10x
So now, using the Newton-Raphson iteration equation we can find the roots
Root A= interval [-1, 0]
Root B= interval [-3, -2]
Root C= interval [2, 3]
Root A
Figure 6
Figure 6 shows the curve with a tangent, so xn=-1
figure 7 shows zoom-in version of figure 6.