Professional Documents
Culture Documents
2.1 Locating Roots: Chapter Two Non Linear Equations
2.1 Locating Roots: Chapter Two Non Linear Equations
2.1 Locating Roots: Chapter Two Non Linear Equations
Example
If f (x) = ax2+bx +c is a quadratic polynomial, the roots are given by the well-known formula
f(x) is a function that is real valued and that x is a real variable. Suppose that
Then f(x) changes sign on [a, b], and f(x) = 0 has at least one root on the interval.
The bisection method is based on the intermediate value theorem for continuous functions.
i.e., an interval [a, b] must contain a zero of a continuous function f if the product f (a) f (b) 0.
Geometrically, this means that if f (a) f (b) 0, then the curve f has to cross the x-axis at some
point in between a and b.
Compute
where x'r is the new value of xr . The computations can be terminated when r becomes less than
a prescribed tolerance, say p. In addition, the maximum number of iterations may also be
specified in advance.
Solution:
A). Interpolation
Very roughly speaking, interpolation is what you use when you have a few data points and want
to use them to estimate the values between those data points.
Assume we need to find a root of the equation f (x) = 0, called a. Consider the graph of the function
f (x) and two initial estimates of the root, x0 and x1. The two points (x0, f (x0)) and (x1, f (x1)) on
the graph of f (x) determine a straight line, called a secant line which can be viewed as an
approximation to the graph. The point x2 where this secant line crosses the x axis is then an
approximation for the root a.
This is the same idea as in Newton’s method, where the tangent line has been approximated by a
secant line.
and so on.
Note : The secant method is slower than Newton’s method but faster than the bisection method.
Example:
Find a root of the equation x6−x −1 = 0 (Recall that the true root is a = 1.134724138.)
Disadvantages
Example
Use the method of iteration to find a positive root, between 0 and 1, of the equation xe-x = 1.
Writing the equation in the form x = e-x
then the fixed point iteration scheme based on the function g will converge to a. Alternatively, if
|g′(a)| > 1 then the iteration will not converge to a. (Note that when |g′(a)| = 1 no conclusion can
be reached.)
We already know that this equation has a root between 1 and 2 so we take x0 = 1.5 as our first
approximation. For each iteration we calculate the value xn - xn - 1 which, as we shall see
later, is a good approximation to the absolute error - xn - 1.
The iterations for Newton’s algorithm are shown in the table below
Example.
Let us approximate the only solution to the equation x = cos x. In fact, looking at the graphs we
can see that this equation has one solution.
We have
Advantages
• Unfortunately, for bad choices of x0 (the initial guess) the method can fail to converge! Therefore the
choice of x0 is VERY IMPORTANT!
• Each iteration of Newton’s method requires two function evaluations, while the bisection method
requires only one.
• no practical & rigorous error bound
Note:
A good strategy for avoiding failure to converge would be to use the bisection method for a few
steps (to give an initial estimate and make sure the sequence of guesses is going in the right
direction) folowed by Newton’s method, which should converge very fast at this point.
2
3
4