Newton's Method for Finding Roots of an Equation
You will find that the problem of finding the roots of an equation occurs frequently in technical work. One technique for finding roots is called Newton's Method. That method is the focus of this page.
Assume you have an equation, y = f(x)
- You want the root(s) of the equation so you need find the solution(s) to the equation f(x) = 0
- A root of the equation will occur when an x-coordinate makes the value of the function equal to zero.
- This is also the point where the graph crosses the x axis.
Newton's Mehtod uses your first guess at x to calculate the value of the function f(x) and the value of the derivate f'(x).
- If we write a formula for the slope of the curve at the selected point it would look like: f(x)' = [f(x) - 0]/[x2 - x1].
- We know f(x), f'(x) and x1 so we want to solve the equaiton for x2.
- Solving for x2 we get: x2 = x1 - [f(x)/f'(x)].
- x2 is our new guess at the root of the equation.
- We will now repeat the process using x2 as our starting value of x and finding f(x2) and f'(x2).
- It is probably easiest to understand the process by working your way through it.
To make it easy we will find a root of the quadratic f(x) = 4x2 - 9.
To start the process you will need a first approximation to the desired root (perhaps a guess). You can then use that approximation (guess) as input to the process to develop an improved guess. Through a process of iteration you can get as close to the true root as you desire. This is an iterative process that leads to an approximate solution. If the equation has multiple roots you will have to repeat the process for each root.
An easy way to get a first guess is to graph the function or calculate a set of points in the interval of interest. This page has a tool that will calculate values of the function. You are looking for the place where the function's value changes sign, + to - or - to +. The sign change means that the function has crossed the x axis. Since a root is located at an x axis crossing this is a point we want.
To start the process assume that we want values of the function for x between -1.25 and +3 and the equation of the function is f(x) = 4x2 -9.
- Go to the tool and enter 4, 0, -9, -1.25 and 3 in the spaces provided.
- Now click on the button that says it will give you values of f(x).
- You should get ten values of f(x) in the window just below where you clicked.
- The data indicate that when x goes from 1.31 to 1.74 the value of f(x) goes from -2.14 to +3.11.
- This change in sign of f(x) is exactly what we want to know.
- Let's use 1.74 as our starting value of x since it must be just past the root we want
- In the window that says "Enter the initial value of x" enter the value 1.74 and then click on the button just below that window.
- The answer that comes back is x = 1.5166.
- Now take the 1.5166 value and type it into the window where you entered 1.74 before. <.li>
- You are replacing your old estimate (1.74) with a new one (1.5166) and click the compute button again.
- This time the answer you get is a 1.5001. This is very close to the real root (1.5) so we can quit here.
- If you wanted you could enter 1.5001 as your new value of x, hit compute and see what you get (it should be 1.5 which is the exact root).
This program will calculate the roots of a quadratic equation of the formf(x) = ax2 + bx + c one step at a time. You enter the values of the coefficients a, b and c and when looking for the root you must take each x result and feed it into the program as your new value of x.