P2 Maths Coursework
Numerical Solutions of Equations
HANNAN SHAH
Introduction
In this coursework I intend to use numerical methods to find the solutions of equations that cannot be solved algebraically. Many simple equations can be solved using methods such as factorising or the quadratic formula but such methods cannot be applied to more complicated equations. My intention is to use three methods of numerical analysis to solve some of these more complex equations, show problems associated with these methods and then to compare their relative merits. The methods I will be using are decimal search, fixed point iteration using Newton-Raphson and fixed point iteration after rearranging f(x) = 0 into the form x = g(x).
Decimal Search
Assuming that you are looking for the roots of the equation f(x) = 0 you want to find the values of x for which the graph of y = f(x) crosses the x-axis. As y = f(x) crosses the x-axis, f(x) changes sign (from + to -), provided that f(x) is continuous.
Using decimal search I will attempt to find one root of the equation y = x5+4x²-1. The graph for this function is shown below.
The graph clearly shows that there are three roots in the intervals [-2, -1]. [-1,0] and [0,1]. I am going to attempt to find the value of the root in the interval [0,1]. I will start at one decimal place by taking values of x between 0 and 1 in increments of 0.1.
The table on the left shows that there is a change of sign between x = 0.4 and x = 0.5. Therefore, the root is in the interval [0.4,0.5]. I can now go down an extra decimal place and use increments of 0.01 for the values of x between x = 0.4 and x = 0.5.
The values for y have narrowed the search for the root to the interval [0.49,0.50]. Currently the root is x = 0.5 to one decimal place or x = 0.495 ?0.005.
I will now use values of x between 0.49 and 0.50.
From the table the root is in the interval [0.492,0.493]. The root is x = 0.49 to two decimal places or x = 0.4925 ?0.0005.
This step has now shown that the root is in the interval [0.4926,0.4927]. The root is x = 0.493 to three decimal places or x = 0.49265 ?0.00005.
I have now solved the root to an accuracy of four decimal places. It lies in the interval [0.49268,0.49269] and is x = 0.492685 ?0.000005. The table on the left shows this.
When x = (0.492685 + 0.000005) = 0.49269, y is +0.000005.
When x = (0.492685 - 0.000005) = 0.49268, y is -0.000037.
This change of sign means the root lies between this two values for x.
Problems with decimal search
Although decimal search was successful in finding this particular root there are problems with the method in certain situations that result in no root being detected.
Here is an example below for the graph of y = x2-1.62x+0.6561.
The graph shows that the root clearly lies in the interval [0,1]. However, using decimal search there is no change of sign. This happens because there is a repeated root. This means the curve only touches the x-axis but never crosses it, so y is never negative.
Numerical Solutions of Equations
HANNAN SHAH
Introduction
In this coursework I intend to use numerical methods to find the solutions of equations that cannot be solved algebraically. Many simple equations can be solved using methods such as factorising or the quadratic formula but such methods cannot be applied to more complicated equations. My intention is to use three methods of numerical analysis to solve some of these more complex equations, show problems associated with these methods and then to compare their relative merits. The methods I will be using are decimal search, fixed point iteration using Newton-Raphson and fixed point iteration after rearranging f(x) = 0 into the form x = g(x).
Decimal Search
Assuming that you are looking for the roots of the equation f(x) = 0 you want to find the values of x for which the graph of y = f(x) crosses the x-axis. As y = f(x) crosses the x-axis, f(x) changes sign (from + to -), provided that f(x) is continuous.
Using decimal search I will attempt to find one root of the equation y = x5+4x²-1. The graph for this function is shown below.
The graph clearly shows that there are three roots in the intervals [-2, -1]. [-1,0] and [0,1]. I am going to attempt to find the value of the root in the interval [0,1]. I will start at one decimal place by taking values of x between 0 and 1 in increments of 0.1.
The table on the left shows that there is a change of sign between x = 0.4 and x = 0.5. Therefore, the root is in the interval [0.4,0.5]. I can now go down an extra decimal place and use increments of 0.01 for the values of x between x = 0.4 and x = 0.5.
The values for y have narrowed the search for the root to the interval [0.49,0.50]. Currently the root is x = 0.5 to one decimal place or x = 0.495 ?0.005.
I will now use values of x between 0.49 and 0.50.
From the table the root is in the interval [0.492,0.493]. The root is x = 0.49 to two decimal places or x = 0.4925 ?0.0005.
This step has now shown that the root is in the interval [0.4926,0.4927]. The root is x = 0.493 to three decimal places or x = 0.49265 ?0.00005.
I have now solved the root to an accuracy of four decimal places. It lies in the interval [0.49268,0.49269] and is x = 0.492685 ?0.000005. The table on the left shows this.
When x = (0.492685 + 0.000005) = 0.49269, y is +0.000005.
When x = (0.492685 - 0.000005) = 0.49268, y is -0.000037.
This change of sign means the root lies between this two values for x.
Problems with decimal search
Although decimal search was successful in finding this particular root there are problems with the method in certain situations that result in no root being detected.
Here is an example below for the graph of y = x2-1.62x+0.6561.
The graph shows that the root clearly lies in the interval [0,1]. However, using decimal search there is no change of sign. This happens because there is a repeated root. This means the curve only touches the x-axis but never crosses it, so y is never negative.