Solving Equations Numerically · applications

Applications: Solving Equations Numerically

10 question types · Pre-University · each worked step by step with a figure that follows the steps

01

A Spherical Buoy Floating in a Harbor: The Depth It Sinks To, from a Cubic Solved by Newton-Raphson

methodForm the Cubic from the Water the Buoy Pushes Aside, Locate the Root by a Change of Sign, Then Apply Newton-Raphson from a Start Inside That Interval

A buoy is a hollow sphere of radius 1 m, and its average density is 0.6 of the density of sea water. When it floats, the depth x m of its lowest point below the surface satisfies x2(3 − x) = 2.4: the part below the water is a cap of volume π x2(3 − x)3, and it must be 0.6 of the volume of the whole sphere, 4π3. (a) Write the equation as f(x) = 0, where f(x) = x3 − 3x2 + 2.4, and show that it has a root between x = 1 and x = 1.5. (b) Use the Newton-Raphson method with x0 = 1 to find the depth to 3 decimal places.

1 mxsea−1−0.500.50.811.21.41.6depth (m), xf(x)0.4−0.975f(x) = x3− 3x2+ 2.4 = 0f(1) = 0.4 and f(1.5) = −0.975
Expand the bracket: f(x) = x3 − 3x2 + 2.4. Then f(1) = 0.4 and f(1.5) = −0.975.
Expand the bracket: 3x2 − x3 = 2.4, so f(x) = x3 − 3x2 + 2.4 = 0. Then f(1) = 1 − 3 + 2.4 = 0.4 and f(1.5) = 3.375 − 6.75 + 2.4 = −0.975.
step 1 of 5

A cubic like this has no factor to find, so the depth is found numerically. A change of sign shows where the root is. The Newton-Raphson method then follows the tangent at the current estimate down to the x-axis, and the point where it lands is the next estimate: xn+1 = xn − f(xn)f'(xn).

  1. Expand the bracket: 3x2 − x3 = 2.4, so f(x) = x3 − 3x2 + 2.4 = 0. Then f(1) = 1 − 3 + 2.4 = 0.4 and f(1.5) = 3.375 − 6.75 + 2.4 = −0.975.
  2. (a) f(x) changes sign between x = 1 and x = 1.5, and f is continuous, so there is a root between them. The cubic has two other roots, one negative and one near 2.66, but a depth must lie between 0 and the diameter, 2 m.
  3. Differentiate: f'(x) = 3x2 − 6x. From x0 = 1: f(1) = 0.4 and f'(1) = −3, so x1 = 1 − 0.4−3 = 1.1333, to 4 decimal places.
  4. At x1 = 1.1333: f(x1) = 0.00237 and f'(x1) = −2.9467, so x2 = 1.1333 − 0.00237−2.9467 = 1.1341. The next step gives x3 = 1.1341 again.
  5. (b) The buoy floats with its lowest point 1.134 m below the surface, to 3 decimal places. Check: f(1.1335) = 0.0019 and f(1.1345) = −0.0011 have opposite signs, so the root lies between them. The depth is more than the radius, as it must be for a buoy that is denser than half of the water.

answer(a) f(1) = 0.4 > 0 and f(1.5) = −0.975 < 0, so there is a root between 1 and 1.5; (b) 1.134 m

techniqueThe Newton-Raphson Method

Common pitfalls

  • Starting at x0 = 0 or x0 = 2, where f'(x) = 3x2 − 6x = 0. The tangent there is horizontal and never meets the x-axis, so the formula would divide by zero.
  • Giving the root near 2.66. It solves the cubic, but a depth of more than 2 m would put the lowest point of a sphere of diameter 2 m further down than the sphere reaches, so it does not describe the buoy.
02

A Loan Repaid in Three Equal Yearly Payments: The Rate of Interest from an Iteration

methodFollow the Debt Year by Year to Form a Cubic in x = 1 + r, Rearrange It as x = g(x) with a Small Gradient, and Iterate Until Successive Values Agree

A student borrows $10 000 and repays it in three equal payments of $4000, one at the end of each year. Before each payment, interest at a rate r a year is added to what is owed. (a) Write x = 1 + r, and show that 5x3 − 2x2 − 2x − 2 = 0. (b) Use the iteration xn+1 = (2xn2 + 2xn + 25)1/3 with x0 = 1.1 to find x to 4 decimal places, and give the rate of interest as a percentage to 1 decimal place.

1.0951.0971.0991.0951.0971.099x = 1 + ryy = xy = g(x)after 2 years: 10 000x2− 4000x − 4000x = 1 + r
Each year the debt is multiplied by x = 1 + r and then falls by $4000: after two years it is 10 000x2 − 4000x − 4000.
After one year the debt is 10 000x, and the first payment leaves 10 000x − 4000. After the second year and payment it is (10 000x − 4000)x − 4000 = 10 000x2 − 4000x − 4000.
step 1 of 5

Adding interest at a rate r multiplies the debt by x = 1 + r. After three years and three payments the debt is zero, which gives a cubic in x. The iteration xn+1 = g(xn) closes in on a root when the gradient of g(x) near the root is less than 1 in size.

  1. After one year the debt is 10 000x, and the first payment leaves 10 000x − 4000. After the second year and payment it is (10 000x − 4000)x − 4000 = 10 000x2 − 4000x − 4000.
  2. After the third year and the last payment nothing is owed: 10 000x3 − 4000x2 − 4000x − 4000 = 0. (a) Divide by 2000: 5x3 − 2x2 − 2x − 2 = 0.
  3. Rearrange: 5x3 = 2x2 + 2x + 2, so x = (2x2 + 2x + 25)1/3. Start at x0 = 1.1, a guess of 10%: x1 = (2.42 + 2.2 + 25)1/3 = 1.3241/3 = 1.0981.
  4. Keep the full calculator value each time: x2 = 1.0974, x3 = 1.0971, x4 = 1.0971, x5 = 1.0970 and x6 = 1.0970. Each step is about a third of the one before, because the gradient of g(x) near the root is about 0.35, which is less than 1.
  5. (b) x = 1.0970, so r = 0.0970, and the rate of interest is 9.7% a year. Check with x = 1.097: the debt goes 10 970 − 4000 = 6970, then 7646.09 − 4000 = 3646.09, then 3999.76 − 4000 = −0.24, which is zero to the nearest dollar.

answer(a) 5x3 − 2x2 − 2x − 2 = 0; (b) x = 1.0970, a rate of 9.7% a year

techniqueSolving Equations by Iteration

examsGCSE Higher

Common pitfalls

  • Spreading the extra $2000 evenly: 200010 000 = 20% over three years, about 6.7% a year. The debt falls after every payment, so interest is charged on less and less, and the true rate is higher.
  • Rearranging as x = 5x3 − 2x2 − 22. Its gradient near the root is 15x2 − 4x2 ≈ 6.8, far more than 1, so the iterates run away from the root instead of closing in.
03

A Bakery with Two Break-Even Outputs, and Where to Start Newton-Raphson

methodApply Newton-Raphson to the Profit, and Choose the Start on the Correct Side of the Peak: a Tangent That Slopes Up Meets the Axis on the Left, One That Slopes Down Meets It on the Right

A bakery sells bread for $6 a loaf. When it bakes x hundred loaves a week, its income is 6x hundred dollars and its costs are 4 + e0.5x hundred dollars, so its profit is P(x) = 6x − 4 − e0.5x hundred dollars, with P'(x) = 6 − 0.5e0.5x. The profit is zero at two outputs. (a) Use the Newton-Raphson method with x0 = 1 to find the smaller break-even output to 3 decimal places. (b) The manager looks for the larger break-even output by starting at x0 = 3. Show where the method goes and explain why, then find the larger output to 2 decimal places from x0 = 8.

−10−50510150123456789hundreds of loaves a week, xprofit (hundred $), Px0= 1xn+1= xn− P(xn)/P'(xn)x1= 1 − 0.3513/5.1756 = 0.9321
From x0 = 1 the tangent lands at x1 = 1 − 0.35135.1756 = 0.9321.
Use xn+1 = xn − P(xn)P'(xn). From x0 = 1: P(1) = 0.3513 and P'(1) = 5.1756, so x1 = 1 − 0.35135.1756 = 0.9321.
step 1 of 6

The equation 6x − 4 = e0.5x mixes x with a power of e, so no rearrangement gives x exactly. The Newton-Raphson method finds the root that the tangent at the start points to, and that is not always the root that was wanted.

  1. Use xn+1 = xn − P(xn)P'(xn). From x0 = 1: P(1) = 0.3513 and P'(1) = 5.1756, so x1 = 1 − 0.35135.1756 = 0.9321.
  2. At x1 = 0.9321: P = −0.00094 and P' = 5.2031, so x2 = 0.9323, and x3 = 0.9323 again. (a) The smaller break-even output is 0.932 hundred loaves, about 93 loaves a week. Check: P(0.9315) < 0 < P(0.9325).
  3. From x0 = 3: P(3) = 9.5183 and P'(3) = 3.7592. The profit is still rising at x = 3, so the tangent slopes upward and meets the x-axis to the left: x1 = 3 − 9.51833.7592 = 0.4680.
  4. The next steps give x2 = 0.9254 and x3 = 0.9323: the method has closed in on the smaller output again. The profit is greatest where P'(x) = 0, at x = 2ln 12 ≈ 4.97. Every start to the left of it has a tangent that slopes upward.
  5. Start to the right of the peak, where the profit is falling. From x0 = 8: P(8) = −10.5982 and P'(8) = −21.2991, so x1 = 8 − −10.5982−21.2991 = 7.5024. Then x2 = 7.4005, x3 = 7.3967 and x4 = 7.3967.
  6. (b) From x0 = 3 the method returns to the smaller output, 0.932, because the tangent there slopes upward. From x0 = 8 the larger break-even output is 7.40 hundred loaves, about 740 loaves a week. Check: P(7.395) > 0 > P(7.405).

answer(a) 0.932 hundred loaves, about 93 loaves a week; (b) from x0 = 3 the method returns to 0.932, because the profit is rising there and the tangent meets the axis to the left; from x0 = 8 the larger output is 7.40 hundred loaves

techniqueThe Newton-Raphson Method · When Newton-Raphson Fails

Common pitfalls

  • Trusting the first root the method returns. Newton-Raphson finds the root that the tangent at the start points to, so check which of the two break-even outputs it has reached before using it.
  • Starting at the peak, x0 = 2ln 12 ≈ 4.97, where P'(x) = 0. The tangent there is horizontal and never meets the axis; a start just beside the peak sends x1 very far away.
04

A Cup of Coffee Cooling While a Tank of Water Warms Next Door: The Minute They Reach the Same Temperature

methodSet the Two Temperatures Equal, Take Logarithms to Write the Time as a Function of Itself, and Iterate; a Negative Gradient Less Than 1 in Size Makes the Iterates Close In from Either Side

A cup of coffee cools on a desk in an office kept at 18 °C, while next door a heater warms a tank of water that starts at 18 °C. After m minutes the coffee is at 18 + 72e−0.05m °C and the water is at 18 + 0.1m °C. (a) Show that the two temperatures are equal when m = 20ln(720m). (b) Use the iteration mn+1 = 20ln(720mn) with m0 = 50 to find m to 1 decimal place, and find the temperature of the coffee and the water at that moment.

50525449505152535455minutes, myy = my = g(m)18 + 72e−0.05m= 18 + 0.1me−0.05m= m/720
Set the temperatures equal: 72e−0.05m = 0.1m, so e−0.05m = m720.
Set the temperatures equal: 18 + 72e−0.05m = 18 + 0.1m, so 72e−0.05m = 0.1m, and e−0.05m = m720.
step 1 of 5

The unknown m appears both in a power of e and on its own, so the equation cannot be solved exactly. Taking logarithms writes it as m = g(m). Here g'(m) = −20m is negative and less than 1 in size, so the iterates fall on either side of the root in turn and close in on it.

  1. Set the temperatures equal: 18 + 72e−0.05m = 18 + 0.1m, so 72e−0.05m = 0.1m, and e−0.05m = m720.
  2. Take the natural logarithm of both sides: −0.05m = ln(m720). (a) Multiply both sides by −20: m = −20ln(m720) = 20ln(720m).
  3. Start at m0 = 50: m1 = 20ln(14.4) = 53.34. Then m2 = 20ln(72053.34) = 52.05, keeping the full calculator value each time.
  4. The next iterates are m3 = 52.54, m4 = 52.35, m5 = 52.42 and m6 = 52.40. They fall on either side of the root in turn, because g'(m) = −20m ≈ −0.38 near the root. From m4 on, every iterate rounds to 52.4.
  5. (b) m = 52.4 minutes, to 1 decimal place. The water is then at 18 + 0.1 × 52.4 = 23.24 °C, about 23.2 °C. Check: the coffee is at 18 + 72e−2.62 = 18 + 5.24 = 23.24 °C, the same.

answer(a) 72e−0.05m = 0.1m gives m = 20ln(720m); (b) m = 52.4 minutes, when both are at about 23.2 °C

techniqueSolving Equations by Iteration

examsGCSE Higher

Common pitfalls

  • Iterating the other rearrangement, m = 720e−0.05m. Its gradient near the root is −0.05 × 52.4 ≈ −2.6, more than 1 in size, so each iterate lands further from the root than the one before.
  • Stopping as soon as one iterate rounds to 52.4. The accuracy is settled only when successive iterates agree: m3 = 52.54 rounds to 52.5, and it takes m4, m5 and m6 to show that the answer is 52.4.
05

An Oil Tank Lying on Its Side: The Depth on the Dipstick When the Tank Is a Quarter Full

methodWrite the Area of the Segment of Oil in Terms of the Angle at the Center, Solve θ − sin θ = π/2 by Newton-Raphson in Radians, Then Turn the Angle into a Depth

A cylindrical oil tank of radius 1 m lies on its side. The surface of the oil is a chord of the circular cross-section, and it subtends an angle θ radians at the center, so the oil fills a segment of area 12(θ − sinθ) m2. (a) The tank is a quarter full. Show that θ − sinθ = π2. (b) Use the Newton-Raphson method with θ0 = 2 to find θ to 3 decimal places. The depth of the oil is 1 − cosθ2 meters: find it to the nearest centimeter.

θradius 1 moil−1−0.500.511.622.42.8angle at the center (radians), θf(θ)(θ − sin θ)/2 = pi/4θ − sin θ = pi/2
(a) The oil fills a quarter of the circle of area π: 12(θ − sinθ) = π4, so θ − sinθ = π2.
The cross-section is a circle of area π × 12 = π m2, and the oil fills a quarter of it: 12(θ − sinθ) = π4. (a) Multiply both sides by 2: θ − sinθ = π2.
step 1 of 4

The angle appears both on its own and inside sinθ, so no rearrangement gives it exactly. Newton-Raphson needs f'(θ) = 1 − cosθ, which holds only when θ is in radians.

  1. The cross-section is a circle of area π × 12 = π m2, and the oil fills a quarter of it: 12(θ − sinθ) = π4. (a) Multiply both sides by 2: θ − sinθ = π2.
  2. Write f(θ) = θ − sinθ − π2, with f'(θ) = 1 − cosθ. From θ0 = 2: f(2) = −0.4801 and f'(2) = 1.4161, so θ1 = 2 − −0.48011.4161 = 2.3390.
  3. At θ1 = 2.3390: f = 0.0491 and f' = 1.6949, so θ2 = 2.3101. The next step gives θ3 = 2.3099, and θ4 = 2.3099 again.
  4. (b) θ = 2.310 radians, to 3 decimal places. The chord is cosθ2 = cos 1.155 = 0.404 m below the center, so the oil is 1 − 0.404 = 0.596 m deep: 60 cm on the dipstick. Check: 12(2.3099 − 0.7391) = 0.7854, which is π4. The depth is 30% of the diameter, more than a quarter, because the tank is narrow at the bottom.

answer(a) 12(θ − sinθ) = π4 gives θ − sinθ = π2; (b) θ = 2.310 radians, and the oil is 0.596 m deep, 60 cm to the nearest centimeter

techniqueThe Newton-Raphson Method

Common pitfalls

  • Marking the dipstick at a quarter of the diameter, 50 cm. The tank is narrow at the bottom and wide in the middle, so a quarter of the oil stands higher than a quarter of the height.
  • Working in degrees. The area 12(θ − sinθ) and the derivative of sinθ being cosθ both hold only in radians, so the calculator must be in radian mode.
06

An Ornamental Arch 12 m Long Over a 10 m Gateway: The Radius of Its Arc and How High It Rises

methodWrite the Arc Length and the Span in Terms of the Radius and the Half-Angle, Divide to Remove the Radius, Solve 5θ = 6 sin θ by Newton-Raphson, and Reject the Root θ = 0

An ornamental arch over a gateway is an arc of a circle of radius R m. The arc is 12 m long, and its two ends are 10 m apart at the same level. The arc subtends an angle 2θ radians at the center of the circle. (a) Show that 5θ = 6sinθ. (b) Use the Newton-Raphson method with θ0 = 1 to find θ to 3 decimal places. Hence find the radius of the arc and the height of the middle of the arch above its ends, each to 2 decimal places.

12 m10 m−0.2−0.100.10.20.911.1half-angle (radians), θf(θ)2Rθ = 12 and R sin θ = 5sin θ / θ = 5/6, so 5θ = 6 sin θ
(a) The arc gives Rθ = 6 and half the span gives Rsinθ = 5. Divide: sinθθ = 56, so 5θ = 6sinθ.
The arc gives 2Rθ = 12, so Rθ = 6. Half of the span gives Rsinθ = 5. Divide the second by the first: sinθθ = 56, so (a) 5θ = 6sinθ.
step 1 of 5

The arc length is R × 2θ and half of the span is Rsinθ. Dividing one by the other removes R and leaves an equation in θ alone, with θ both on its own and inside sinθ.

  1. The arc gives 2Rθ = 12, so Rθ = 6. Half of the span gives Rsinθ = 5. Divide the second by the first: sinθθ = 56, so (a) 5θ = 6sinθ.
  2. θ = 0 also solves it, but that is a straight arch, and an arch 12 m long across a 10 m gap cannot be straight. Write f(θ) = 5θ − 6sinθ, with f'(θ) = 5 − 6cosθ.
  3. From θ0 = 1: f(1) = −0.0488 and f'(1) = 1.7582, so θ1 = 1 − −0.04881.7582 = 1.0278. At θ1: f = 0.00196 and f' = 1.8996, so θ2 = 1.0267, and θ3 = 1.0267 again.
  4. θ = 1.027 radians, to 3 decimal places. Using the unrounded value, the radius is R = 6θ = 61.02674 = 5.84 m.
  5. The ends are Rcosθ above the center, and the middle of the arc is R above it. (b) The radius is 5.84 m, and the middle rises R(1 − cosθ) = 5.84 × (1 − 0.5176) = 2.82 m above the ends. Check: the span is 2Rsinθ = 2 × 5.8437 × 0.8556 = 10.00 m.

answer(a) 2Rθ = 12 and Rsinθ = 5 give 5θ = 6sinθ; (b) θ = 1.027 radians, a radius of 5.84 m, and the middle rises 2.82 m above the ends

techniqueThe Newton-Raphson Method

Common pitfalls

  • Accepting θ = 0 because it satisfies 5θ = 6sinθ. It is a root of the equation but not of the problem: it describes a straight arch, whose length would equal its span.
  • Starting at θ0 = 0.5. There f'(0.5) = 5 − 6cos 0.5 = −0.27 is negative, so the tangent slopes the other way, and the iterates settle on θ = −1.027 instead: the same arc measured the other way round, found only by a longer route.
07

An Open Steel Tank with a Square Base: One Rearrangement That Closes In on a Root and One That Runs Away

methodForm the Cubic from the Volume and the Steel Used, Iterate x = g(x), and Use the Gradient Test |g'(x)| < 1 Near Each Root to Choose a Rearrangement That Converges There

An open tank has a square base of side x m and a height of h m. It must hold 4 m3 and be made from exactly 13 m2 of steel sheet. (a) Show that x3 − 13x + 16 = 0, and use the iteration xn+1 = xn3 + 1613 with x0 = 1.5 to find one possible side to 2 decimal places. (b) The equation has a second positive root near 2.6. Show that the same iteration started at x0 = 2.7 moves away from it, and explain why using g'(x). Then use xn+1 = √13 − 16xn with x0 = 2.6 to find it to 2 decimal places. Give the height of each tank.

1.481.491.51.481.491.5side (m), xyy = x2.62.833.22.62.833.2side (m), xyy = xx2h = 4 and x2+ 4xh = 13x2+ 16/x = 13, so x3− 13x + 16 = 0
(a) The volume gives h = 4x2, and the steel gives x2 + 4xh = 13. Together, x3 − 13x + 16 = 0.
The volume gives x2h = 4, so h = 4x2. The steel is the base and four sides: x2 + 4xh = 13. Substitute: x2 + 16x = 13, and multiply by x: x3 − 13x + 16 = 0.
step 1 of 6

An iteration xn+1 = g(xn) converges to a root when |g'(x)| < 1 near that root, and moves away from it when |g'(x)| > 1. One equation can be rearranged in several ways, and each rearrangement may suit a different root.

  1. The volume gives x2h = 4, so h = 4x2. The steel is the base and four sides: x2 + 4xh = 13. Substitute: x2 + 16x = 13, and multiply by x: x3 − 13x + 16 = 0.
  2. Iterate xn+1 = xn3 + 1613 from x0 = 1.5: x1 = 3.375 + 1613 = 1.4904, then x2 = 1.4854, x3 = 1.4829 and x4 = 1.4816. The last two both round to 1.48.
  3. (a) x = 1.48 m. Check: f(1.475) = 0.034 and f(1.485) = −0.030 have opposite signs. The height of this tank is 41.482 = 1.83 m.
  4. From x0 = 2.7 the same iteration gives 2.7448, 2.8216, 2.9587 and 3.2230: each step is larger than the one before. Here g'(x) = 3x213, which is about 1.6 near 2.63, more than 1, so each error is multiplied by about 1.6. Near 1.48 it is about 0.51, which is why the first run closed in.
  5. Rearrange x2 = 13 − 16x as x = √13 − 16x instead. Its gradient near 2.63 is about 0.44. From x0 = 2.6: x1 = √13 − 6.1538 = 2.6165, then x2 = 2.6239, x3 = 2.6272 and x4 = 2.6287. The last two both round to 2.63.
  6. (b) x = 2.63 m, and the height is 42.632 = 0.58 m. Check: f(2.625) = −0.037 and f(2.635) = 0.040. Both tanks use 13 m2 of steel: one is 1.48 m square and 1.83 m high, the other 2.63 m square and 0.58 m high.

answer(a) x3 − 13x + 16 = 0, and x = 1.48 m, a tank 1.83 m high; (b) from 2.7 the iterates grow, because g'(x) = 3x213 ≈ 1.6 > 1 near that root; the second iteration gives x = 2.63 m, a tank 0.58 m high

techniqueSolving Equations by Iteration

examsGCSE Higher

Common pitfalls

  • Deciding from the run away from 2.7 that there is no second root. An iteration that moves away from a root does not show that the root is absent; the change of sign f(2.6) = −0.224 < 0 < f(2.7) = 0.583 shows that it is there.
  • Stopping at x2 = 1.4854 because x1 and x2 both round to 1.49. With a gradient of about 0.5 the iterates are still falling; f(1.485) < 0 shows that the root is below 1.485.
08

A Steel Cube of Exactly 2 Cubic Centimeters: Its Edge to Six Decimal Places in Four Steps

methodApply Newton-Raphson to f(x) = x³ − 2, Simplify the Formula, and Watch the Number of Correct Decimal Places Double at Each Step

A laboratory needs the edge of a cube of volume exactly 2 cm3, worked out to six decimal places. Its edge x cm satisfies x3 = 2. (a) Show that the Newton-Raphson method for f(x) = x3 − 2 gives xn+1 = 2xn3 + 23xn2. (b) Starting at x0 = 1, find x1, x2, x3 and x4 to 6 decimal places, give the edge to 6 decimal places, and say, for each of x2, x3 and x4, how many decimal places it gives correctly once rounded.

−1−0.500.50.911.11.21.31.4edge (cm), xf(x)f'(x) = 3x2xn+1= (2xn3+ 2)/(3xn2)
(a) With f'(x) = 3x2, xn+1 = xn − xn3 − 23xn2 = 2xn3 + 23xn2.
f(x) = x3 − 2 has f'(x) = 3x2, so xn+1 = xn − xn3 − 23xn2 = 3xn3 − xn3 + 23xn2. (a) This simplifies to xn+1 = 2xn3 + 23xn2.
step 1 of 4

A root of a number is the root of an equation, so Newton-Raphson can find it with only multiplication and division. Close to the root the error is roughly squared at every step, so the number of correct decimal places roughly doubles.

  1. f(x) = x3 − 2 has f'(x) = 3x2, so xn+1 = xn − xn3 − 23xn2 = 3xn3 − xn3 + 23xn2. (a) This simplifies to xn+1 = 2xn3 + 23xn2.
  2. From x0 = 1: x1 = 2 + 23 = 1.333333. Then x2 = 2 × 2.370370 + 23 × 1.777778 = 6.7407415.333333 = 1.263889.
  3. The next two steps give x3 = 1.259933 and x4 = 1.259921, and x5 = 1.259921 again. (b) The edge is 1.259921 cm, to 6 decimal places.
  4. Compare each iterate with the edge. x2 = 1.263889 is correct to 2 decimal places, x3 = 1.259933 to 4, and x4 to more than 6. Check: 1.25992053 = 1.9999974 and 1.25992153 = 2.0000021, so the edge rounds to 1.259921.

answer(a) xn+1 = 2xn3 + 23xn2; (b) 1.333333, 1.263889, 1.259933, 1.259921: the edge is 1.259921 cm, and x2, x3 and x4 are correct to 2, 4 and more than 6 decimal places

techniqueThe Newton-Raphson Method

Common pitfalls

  • Writing f(x) = x3 and f'(x) = 3x2, which leaves out the −2. The method then finds the root of x3 = 0, which is 0, not the edge of the cube.
  • Expecting one step for each decimal place, and so six steps for six places. Near the root the error is roughly squared at each step, so the correct places go from 2 to 4 to more than 6.
09

A Hill Path Down to a Lake: Why a Start at the Summit Gives Newton-Raphson Nowhere to Go

methodFind Where the Derivative Is Zero Before Choosing a Start: a Horizontal Tangent Never Meets the Axis, and a Nearly Horizontal One Throws the Next Estimate Far Away

A path climbs over a hill and down to a lake. At a distance x km along the path, measured horizontally, its height above the lake is y = 8 + 12x − x3 tens of meters, for x ≥ 0. (a) A walker wants to know where the path reaches the lake, and starts the Newton-Raphson method at the summit, x0 = 2. Explain why the method fails there. Then find x1 from x0 = 2.1, and say whether that start is any better. (b) Use the method from x0 = 4 to find where the path reaches the lake, to 3 decimal places.

−100102001234km along the path, xheight (tens of m), ysummitf(x) = 8 + 12x − x3, f'(x) = 12 − 3x2f'(2) = 0 at the summit, 240 m up
The path meets the lake where f(x) = 8 + 12x − x3 = 0. The derivative f'(x) = 12 − 3x2 is zero at the summit, x = 2.
The path reaches the lake where y = 0: f(x) = 8 + 12x − x3 = 0. Differentiate: f'(x) = 12 − 3x2, which is zero at x = 2, the summit, where f(2) = 24, a height of 240 m.
step 1 of 5

Each step of Newton-Raphson divides by f'(xn), the gradient of the tangent. Where the gradient is zero the tangent is horizontal and never meets the x-axis, so there is no next estimate. Where it is close to zero, the tangent meets the axis very far away.

  1. The path reaches the lake where y = 0: f(x) = 8 + 12x − x3 = 0. Differentiate: f'(x) = 12 − 3x2, which is zero at x = 2, the summit, where f(2) = 24, a height of 240 m.
  2. At x0 = 2 the formula needs f(2)f'(2) = 240, which has no value. The tangent at the summit is the horizontal line y = 24, which never meets the x-axis, so there is no x1.
  3. (a) The method fails at the summit because f'(2) = 0. From x0 = 2.1 the tangent is nearly horizontal: f(2.1) = 23.939 and f'(2.1) = −1.23, so x1 = 2.1 − 23.939−1.23 = 21.56, far beyond the lake.
  4. From x0 = 4: f(4) = −8 and f'(4) = −36, so x1 = 4 − −8−36 = 3.7778. Then f = −0.5816 and f' = −30.8148, so x2 = 3.7589, and x3 = 3.7588.
  5. (b) The path reaches the lake at x = 3.759 km, to 3 decimal places. Check: f(3.7585) = 0.008 and f(3.7595) = −0.022 have opposite signs.

answer(a) f'(2) = 0, so the tangent at the summit is horizontal and never meets the axis; from x0 = 2.1 the nearly horizontal tangent sends x1 to 21.56; (b) x = 3.759 km

techniqueWhen Newton-Raphson Fails · The Newton-Raphson Method

Common pitfalls

  • Starting at the highest point because it is easy to find. The top of a hill is exactly where the tangent is horizontal, so it is the one start Newton-Raphson cannot use; start where the path is steep, close to the lake.
  • Giving a root of the cubic that is not on the path. 8 + 12x − x3 = 0 also has the roots x ≈ −0.69 and x ≈ −3.06, but the path is described only for x ≥ 0.
10

A Drone Coming In to Land: A Start That Sends Newton-Raphson Back and Forth Forever

methodRun the First Two Steps and Compare Them: When the Tangent at Each Estimate Meets the Axis at the Other, the Iterates Repeat and Never Reach a Root, So Start Somewhere Else

A drone is launched from a roof and flies a programmed path. After x minutes its height is h(x) = −x3 + 6x2 − 10x + 6 meters, so h'(x) = −3x2 + 12x − 10. (a) After 1 minute the drone is only 1 m up, so an engineer starts the Newton-Raphson method at x0 = 1 to find when it lands. Show that the iterates go back and forth between two values forever. (b) Use the method from x0 = 4 to find the time at which the drone lands, to 3 decimal places.

−20241234minutes after launch, xheight (m), hx0= 1h(1) = 1, h'(1) = −1x1= 1 − 1/(−1) = 2
The tangent at x0 = 1, where h = 1 and h'(1) = −1, meets the axis at x1 = 2.
The drone lands when h(x) = 0. From x0 = 1: h(1) = −1 + 6 − 10 + 6 = 1 and h'(1) = −3 + 12 − 10 = −1, so x1 = 1 − 1−1 = 2.
step 1 of 5

The Newton-Raphson method can fail without ever dividing by zero. If the tangent at one estimate meets the axis at a second estimate, and the tangent there meets the axis back at the first, the iterates repeat forever.

  1. The drone lands when h(x) = 0. From x0 = 1: h(1) = −1 + 6 − 10 + 6 = 1 and h'(1) = −3 + 12 − 10 = −1, so x1 = 1 − 1−1 = 2.
  2. From x1 = 2: h(2) = −8 + 24 − 20 + 6 = 2 and h'(2) = −12 + 24 − 10 = 2, so x2 = 2 − 22 = 1, which is x0 again.
  3. (a) Each step repeats an earlier one, so the iterates run 1, 2, 1, 2, … forever and never approach a root. The tangent at x = 1 meets the axis at 2, and the tangent at x = 2 meets it back at 1. Between them the drone dips to about 0.91 m and climbs again, so neither tangent reaches the landing point.
  4. From x0 = 4: h(4) = −64 + 96 − 40 + 6 = −2, a negative height, which means the formula has already passed the landing. With h'(4) = −48 + 48 − 10 = −10, x1 = 4 − −2−10 = 3.8. Then h(3.8) = −0.232 and h'(3.8) = −7.72, so x2 = 3.8 − −0.232−7.72 = 3.7699.
  5. The next step gives x3 = 3.7693, and x4 = 3.7693 again. (b) The drone lands 3.769 minutes after launch, about 3 minutes 46 seconds. Check: h(3.7685) = 0.006 and h(3.7695) = −0.002 have opposite signs.

answer(a) x1 = 2, x2 = 1, x3 = 2, …: the tangent at each estimate meets the axis at the other, forever; (b) 3.769 minutes

techniqueWhen Newton-Raphson Fails · The Newton-Raphson Method

Common pitfalls

  • Taking a small value of h as a sign that a root is close. At x = 1 the drone is only 1 m up, but the curve turns back up before it reaches the axis, and the tangent there points the method to x = 2.
  • Running a fixed number of steps and reporting the last one. The iterates 1, 2, 1, 2 never settle, so a root may be stated only when successive iterates agree to the accuracy asked for.
Mr. Chalk Read the guide