Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Physics LibreTexts

1.4: The Solution of f(x) = 0

( \newcommand{\kernel}{\mathrm{null}\,}\)

The title of this section is intended to be eye-catching. Some Equations are easy to solve; others seem to be more difficult. In this section, we are going to try to solve any Equation at all of the form f(x)=0 (which covers just about everything!) and we shall in most cases succeed with ease.

Figure I.3 shows a graph of the Equation y=f(x). We have to find the value (or perhaps values) of x such that f(x)=0.

We guess that the answer might be xg, for example. We calculate f(xg). It won't be zero, because our guess is wrong. The figure shows our guess xg, the correct value x, and f(xg). The tangent of the angle θ is the derivative f(x), but we cannot calculate the derivative there because we do not yet know x. However, we can calculate f(xg), which is close. In any case tanθ, or f(xg), is approximately equal to f(xg)/(xgx), so that

xxgf(xg)f(xg)

will be much closer to the true value than our original guess was. We use the new value as our next guess, and keep on iterating until

|xgxxg|

is less than whatever precision we desire. The method is usually extraordinarily fast, even for a wildly inaccurate first guess. The method is known as Newton-Raphson iteration. There are some cases where the method will not converge, and stress is often placed on these exceptional cases in mathematical courses, giving the impression that the Newton-Raphson process is of limited applicability. These exceptional cases are, however, often artificially concocted in order to illustrate the exceptions (we do indeed cite some below), and in practice Newton-Raphson is usually the method of choice.

alt
FIGURE I.3

I shall often drop the clumsy subscript g, and shall write the Newton-Raphson scheme as

x=xf(x)/f(x),

meaning "start with some value of x, calculate the right hand side, and use the result as a new value of x". It may be objected that this is a misuse of the = symbol, and that the above is not really an "Equation", since x cannot equal x minus something. However, when the correct solution for x has been found, it will satisfy f(x)=0, and the above is indeed a perfectly good Equation and a valid use of the = symbol.

Example 1.4.1

Solve the Equation 1/x=lnx

We have f=1/xlnx=0

And f=(1+x)/x2,

from which xf/f becomes, after some simplification,

x[2+x(1lnx)]1+x,

so that the Newton-Raphson iteration is

x=x[2+x(1lnx)]1+x.

There remains the question as to what should be the first guess. We know (or should know!) that ln1=0 and ln2=0.6931, so the answer must be somewhere between 1 and 2. If we try x=1.5, successive iterations are

1.735 081 4031.762 915 3911.763 222 7981.763 222 8341.763 222 835

This converged quickly from a fairly good first guess of 1.5. Very often the Newton-Raphson iteration will converge, even rapidly, from a very stupid first guess, but in this particular example there are limits to stupidity, and the reader might like to prove that, in order to achieve convergence, the first guess must be in the range

0<x<4.319 136 566

Example 1.4.2

Solve the unlikely Equation sinx=lnx

We have f=sinxlnx and f=cosx1/x,

and after some simplification the Newton-Raphson iteration becomes

x=x[1+lnxsinxxcosx1].

Graphs of sinx and lnx will provide a first guess, but in lieu of that and without having much idea of what the answer might be, we could try a fairly stupid x=1. Subsequent iterations produce

2.830 487 7222.267 902 2112.219 744 4522.219 107 2632.219 107 1492.219 107 149

Example 1.4.3

Solve the Equation x2=a (A new way of finding square roots!)

f=x2a,f=2x.

After a little simplification, the Newton-Raphson process becomes

x=x2+a2x.

For example, what is the square root of 10? Guess 3. Subsequent iterations are

3.166 666 6673.162 280 7023.162 277 6613.162 277 661

Example 1.4.4

Solve the Equation ax2+bx+c=0 (A new way of solving quadratic Equations!)

f=ax2+bx+c=0,

f=2ax+b.

Newton-Raphson:

x=xax2+bx+c2ax+b,

which becomes, after simplification,

x=ax2c2ax+b.

This is just the iteration given in the previous section, on the solution of quadratic Equations, and it shows why the previous method converged so rapidly and also how I really arrived at the Equation (which was via the Newton-Raphson process, and not by arbitrarily adding ax2 to both sides!)


This page titled 1.4: The Solution of f(x) = 0 is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Jeremy Tatum via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?