36 Roots
Recall in calculus when you were asked to find the values of of a function for when . These are what are known as the roots. Most functions we looked at in calculus took on a linear form, but there are nonlinear functions that still require their roots to be calculated. This is where we introduce the Newton-Raphson and the Secant method.
30.1 The Newton-Raphson Method
We will cover the Secant method later on, for now the Newton-Raphson method is given by a formula for which to calculate progressive values that should converge to a root. The formula for calculating the progressive values is given as:
Where is the current known value. In the following example we will see how we can analyze the Newton-Raphson method to extrapolate the roots of a nonlinear equation.
Example:
Given the equation , perform four iterations of the Newton-Raphson method with . [15]
We begin by finding the derivative of to be . Thus we have the following formula for he Newton-Raphson method.
Now we can calculate the first four iterations starting with .
These values, as of right now, are just values. We need to find their approximate errors to be able to tell if we are converging or not. We use the approximate relative error given by the formula:
This gives us the percentage for the difference between our iterations. What should happen during these calculations is that we begin to see a trend of smaller and smaller errors which means the difference between subsequent calculations is less. This trend is how we can tell if we are converging to a root or not, using the Newton-Raphson method.
Example:
Using the values we found in the previous example compute the approximate relative error for each iteration.
Here we can see that although the first few iterations created increasing error as we progressed through the iterations we began to narrow down to a root. We can see this because between the third and fourth iterations there was a drastic decrease in approximate relative error and the values for and are quite similar. Now we move to cover the Secant method for finding roots which is used in place of the Newton-Raphson method when a derivative is overtly challenging.
30.2 Secant Method
We previously stated that the Secant method is used when taking the derivative of a function would be too time consuming. This does not mean that the secant method does not still utilize . In fact the secant method requires a formula in place of finding the actual derivative. The formula is given as follows.\index{Numerical Methods!Roots!Secant Method!Formula}
If we substitute this alternative into our original formula provided for the Newton-Raphson method we have the following.
Now that we have this formula we can compute an example to see how the Secant method is applied.
Example:
Given the equation, apply the Secant method for three iterations. Then, compute the approximate relative error for each iteration [15].
We begin with assembling our formula for the Secant method as it applies to the given function.
Now we were not given starting values for or . We need to compute them by first solving for in .
From this we can let and since . Now we can calculate the three iterations as follows.
Next we calculate the approximate relative error for each iteration.
Here we can see some incredibly small errors and they continue to shrink which tells us that the iterations we are computing are quickly converging to the roots for the function .
This concludes our exploration of approximating roots of nonlinear functions. In the next section we will cover solving differential equations using approximation methods.