Say you’re in a competition and you need to calculate the square root of two to several decimal places. Or perhaps you need to approximate the roots to an unwieldy polynomial like x3+7x+2. Newton’s method can be used in these situations.
Newton’s method. The Taylor expansion of f(x)around a is f(x)=f(a)+f(1)(a)(x−a)+21f(2)(x−a)2+⋯. Taking the linear approximation, we have f(x)≈f(a)+f′(a)(x−a). Set f(x)=0 (because we are finding the roots of f), and the approximation above becomes 0=f(a)+f′(a)(x−a)⟹x=a−f′(a)f(a).
Next we plug in an initial estimate for the root (this number we just make up and hope it is close to the root) for a and call it x0. So now we have a fair approximation x1=x0−f′(x0)f(x0). To get a better approximation, we plug x1 back into the equation in the place of x0. In general, we can get an approximation xn that is better than xn−1 by xn=xn−1−f′(xn−1)f(xn−1).
Example 1. Approximate 3.
This is the same as solving the equation f(x)=x2−3=0. Since f′(x)=2x, and we make our initial approximation x0=2, we have x1=2−41=47=1.75, whereas 3≈1.732. That’s already an excellent estimate, but let’s keep on going until we are accurate to the thousandths place.
x2=47−7/21/16=5697≈1.732.
Incredible!
Example 2.Estimate the roots ofx3+7x+2.
f(0)=2 is pretty close to 0, so we set x0=2. Also, f′(x)=3x2+7.x1=0−72≈−0.286.x2=−72−355/49−8/343=−2485702≈−0.28249. Indeed, one of the roots of x3+7x+2 is −0.28249. But after guessing more values for x0 to find the other roots, you will be hard-pressed to find any that result in an f(x) value that is close to 0. This is because x3+7x+2 only has one real root. In a later post, I will explain how to determine the number of real solutions to a polynomial.
By the way, Newton was born on Christmas (sort of).