Newton Iteration: Building a Better Estimate

Newton iteration improves an estimate of a solution to f(x)=0f(x)=0 by using the function's value and slope at that estimate. You encounter it when a scientific program needs a numerical answer rather than an exact expression. Computing a square root is a useful starting application: finding A\sqrt{A} means finding the positive solution of x2−A=0x^2-A=0.

From a curve to an update

Suppose your current estimate is xnx_n, where the subscript counts updates and x0x_0 is your starting estimate. The tangent line approximates the curve near this point. Its equation is


y=f(xn)+f′(xn)(x−xn),y=f(x_n)+f'(x_n)(x-x_n),


where f′(xn)f'(x_n) is the derivative, or slope, at the current estimate. Set y=0y=0 and solve for the line's horizontal-axis intercept. This gives the governing update:


xn+1=xn−f(xn)f′(xn).x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}.


The fraction is a correction measured in the same units as xx. You subtract it from the old estimate, then evaluate the function and derivative again at the new estimate.


A curve and its tangent show how the current estimate produces the next estimate.


The derivative in the denominator must be nonzero at every update. A very small derivative can also produce a large correction. The tangent is a local approximation, so its intercept need not improve a distant starting estimate.



Square roots as a special case

For A>0A>0, choose f(x)=x2−Af(x)=x^2-A, so f′(x)=2xf'(x)=2x. Substitution gives


xn+1=xn−xn2−A2xn=12(xn+Axn).x_{n+1}=x_n-\frac{x_n^2-A}{2x_n} =\frac{1}{2}\left(x_n+\frac{A}{x_n}\right).


You average the current estimate with AA divided by that estimate. If a positive estimate is too large, its partner A/xnA/x_n is too small; averaging brings the two closer.


Example: To estimate 5\sqrt{5} from x0=3x_0=3, the first update is x1=(3+5/3)/2=7/3≈2.333333x_1=(3+5/3)/2=7/3\approx2.333333. Use this new value, rather than the original 33, in the next update.


Starting estimate for A>0A>0

Behaviour in exact arithmetic

x0>0x_0>0

Updates remain positive and converge to A\sqrt{A}.

x0=0x_0=0

The first update divides by zero.

x0<0x_0<0

Updates remain negative and converge to −A-\sqrt{A}.


The special square-root formula has a useful error identity. With r=Ar=\sqrt{A} and en=xn−re_n=x_n-r,


en+1=(xn−r)22xn=en22xn.e_{n+1}=\frac{(x_n-r)^2}{2x_n}=\frac{e_n^2}{2x_n}.


For positive estimates close to rr, the squared error explains the rapid improvement. More generally, Newton Iteration converges rapidly near a root when the function is sufficiently smooth, the derivative at the root is nonzero, and the starting estimate is sufficiently close. An arbitrary starting value does not carry that guarantee.

Stopping a computation

The residual is the function value f(xn)f(x_n) at an estimate. Its magnitude measures how closely that estimate satisfies the equation. For square roots, it is xn2−Ax_n^2-A, which measures the mismatch in the squared quantity.


Two common checks are


∣f(xn)∣≤εf,∣xn+1−xn∣≤εx,|f(x_n)|\leq\varepsilon_f, \qquad |x_{n+1}-x_n|\leq\varepsilon_x,


where each positive tolerance specifies an acceptable size. These checks answer different questions: whether the equation is nearly satisfied and whether the estimate has changed little. Their tolerances can have different units.



Programs use finite-precision arithmetic. Keep extra digits during updates and round the reported answer at the end. Rounding can eventually make successive stored estimates identical, even though the residual is not zero.

What to remember

  • Form f(x)=0f(x)=0, evaluate its derivative, and update using the current estimate.
  • For a positive square root, use xn+1=(xn+A/xn)/2x_{n+1}=(x_n+A/x_n)/2 with x0>0x_0>0.
  • Successful stopping checks and a valid starting estimate are separate requirements.
  • Check the residual, preserve working precision, and limit the number of updates.

Example: Sizing a Square Cover with Newton Iteration

A square equipment cover must have an area of 10 m210\ \text{m}^2. A design program estimates its positive side length xx using Newton Iteration, starting from x0=3 mx_0=3\ \text{m}. Retain extra digits throughout. The program accepts an estimate when the magnitude of its area mismatch is at most 10−6 m210^{-6}\ \text{m}^2.


a) Write the function, its derivative, and the update for the side length.


A Newton update replaces the current estimate with the horizontal-axis intercept of its tangent-line approximation. First express the required area as an equation whose right side is zero:


f(x)=x2−10 m2,f′(x)=2x.f(x)=x^2-10\ \text{m}^2, \qquad f'(x)=2x.


At the starting estimate, the function value is ________ and the derivative value is ________. These follow from f(3 m)=9 m2−10 m2f(3\ \text{m})=9\ \text{m}^2-10\ \text{m}^2 and f′(3 m)=2(3 m)f'(3\ \text{m})=2(3\ \text{m}).


Substitute the function and derivative into the general formula, then simplify:


xn+1=xn−xn2−10 m22xn=12(xn+10 m2xn).x_{n+1}=x_n-\frac{x_n^2-10\ \text{m}^2}{2x_n} =\frac{1}{2}\left(x_n+\frac{10\ \text{m}^2}{x_n}\right).


Both terms in the average have units of metres, so the update returns a side length.


b) Calculate x1x_1 and x2x_2. Report x2x_2 to six decimal places in metres.


Insert the initial estimate into the square-root update:


x1=12(3 m+10 m23 m)=196 m.x_1=\frac{1}{2}\left(3\ \text{m}+\frac{10\ \text{m}^2}{3\ \text{m}}\right) =\frac{19}{6}\ \text{m}.


The first estimate is approximately 3.166666667 m3.166666667\ \text{m}. Keep the fraction or extra calculator digits for the next update.


At this estimate, the function value and derivative are


f(x1)=36136 m2−10 m2=136 m2,f′(x1)=193 m.f(x_1)=\frac{361}{36}\ \text{m}^2-10\ \text{m}^2 =\frac{1}{36}\ \text{m}^2, \qquad f'(x_1)=\frac{19}{3}\ \text{m}.


Their ratio gives a correction of approximately ________. Subtract that correction:


x2=196 m−1228 m=721228 m=3.162280701754… m.x_2=\frac{19}{6}\ \text{m}-\frac{1}{228}\ \text{m} =\frac{721}{228}\ \text{m} =3.162280701754\ldots\ \text{m}.


The second estimate, reported to six decimal places, is x2=3.162281 mx_2=3.162281\ \text{m}.


c) Does the unrounded x2x_2 meet the area-mismatch tolerance? If necessary, perform one more update and test it. Report the accepted side length to six decimal places.


The residual is the function value at an estimate. Here it measures the signed area mismatch. Test the unrounded estimate before rounding the reported length.


f(x2)=(721228 m)2−10 m2=151984 m2.f(x_2)=\left(\frac{721}{228}\ \text{m}\right)^2-10\ \text{m}^2 =\frac{1}{51984}\ \text{m}^2.


Its magnitude is approximately ________, which exceeds 0.000001 m20.000001\ \text{m}^2. Therefore x2x_2 does not yet pass.


Apply another update using the unrounded second estimate:


x3=12(721228+2280721)m=1039681328776 m=3.162277660169842… m.x_3=\frac{1}{2}\left(\frac{721}{228}+\frac{2280}{721}\right)\text{m} =\frac{1039681}{328776}\ \text{m} =3.162277660169842\ldots\ \text{m}.


Now test this estimate in the original area equation:


∣f(x3)∣=1108093658176 m2≈9.25124×10−12 m2<10−6 m2.|f(x_3)| =\frac{1}{108093658176}\ \text{m}^2 \approx9.25124\times10^{-12}\ \text{m}^2 <10^{-6}\ \text{m}^2.


The third estimate passes. The accepted side length, rounded to six decimal places, is 3.162278 m3.162278\ \text{m}. The tolerance was checked on the internal estimate; rounding the displayed length is a separate reporting step.

A program estimates the positive square root of a dimensionless number A>0A>0 using Newton Iteration on f(x)=x2−Af(x)=x^2-A. For a current estimate xn>0x_n>0, which expression correctly computes the next estimate?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

For a positive number aa, the principal square root is the positive number whose square equals aa. A program attempts to calculate this value for a=20a=20 using Newton's square root algorithm:


xn+1=12(xn+20xn).x_{n+1}=\frac{1}{2}\left(x_n+\frac{20}{x_n}\right).


It starts with x0=−6x_0=-6. Work in exact arithmetic and complete the sign argument using the words positive or negative.


Whenever xn<0x_n<0, the quotient 20/xn20/x_n is . Averaging this quotient with xnx_n makes xn+1x_{n+1} . To target the principal square root using this update, the program should instead start with a estimate.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A numerical routine estimates 29\sqrt{29} using xn+1=(xn+29/xn)/2x_{n+1}=(x_n+29/x_n)/2 and the initial estimate x0=5x_0=5. Calculate the estimate x2x_2 after exactly two updates. Keep extra digits during the calculation and enter your dimensionless answer to four decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice