Newton’s method

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+2x^3+7x+2 . Newton’s method can be used in these situations.

Newton’s method. The Taylor expansion of f(x)f(x) around aa is f(x)=f(a)+f(1)(a)(xa)+12f(2)(xa)2+.\displaystyle f(x)=f(a)+f^{(1)}(a)(x-a)+\frac{1}{2}f^{(2)}(x-a)^2 +\cdots . Taking the linear approximation, we have f(x)f(a)+f(a)(xa).\displaystyle f(x)\approx f(a)+f'(a)(x-a). Set f(x)=0f(x)=0 (because we are finding the roots of f), and the approximation above becomes 0=f(a)+f(a)(xa)x=af(a)f(a).\displaystyle 0= f(a)+f'(a)(x-a)\implies x=a-\frac{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 x0x_0. So now we have a fair approximation x1=x0f(x0)f(x0).\displaystyle x_1=x_0-\frac{f(x_0)}{f'(x_0)}. To get a better approximation, we plug x1x_1 back into the equation in the place of x0x_0. In general, we can get an approximation xnx_n that is better than xn1x_{n-1} by xn=xn1f(xn1)f(xn1).\displaystyle x_n=x_{n-1}-\frac{f(x_{n-1})}{f'(x_{n-1})}.

Example 1. Approximate 3\sqrt{3}.

This is the same as solving the equation f(x)=x23=0.\displaystyle f(x)=x^2-3=0. Since f(x)=2x,\displaystyle f'(x)=2x, and we make our initial approximation x0=2x_0=2, we have x1=214=74=1.75,\displaystyle x_1=2-\frac{1}{4}=\frac{7}{4}=1.75, whereas 31.732\sqrt{3}\approx 1.732. That’s already an excellent estimate, but let’s keep on going until we are accurate to the thousandths place.

x2=741/167/2=97561.732.\displaystyle x_2=\frac{7}{4}-\frac{1/16}{7/2}=\frac{97}{56}\approx 1.732.

Incredible!

Example 2. Estimate the roots of x3+7x+2x^3+7x+2.

f(0)=2f(0)=2 is pretty close to 00, so we set x0=2x_0=2. Also, f(x)=3x2+7.\displaystyle f'(x)=3x^2+7. x1=0270.286.\displaystyle x_1=0-\frac{2}{7}\approx -0.286. x2=278/343355/49=70224850.28249.\displaystyle x_2=-\frac{2}{7}-\frac{-8/343}{355/49}=-\frac{702}{2485}\approx -0.28249. Indeed, one of the roots of x3+7x+2x^3+7x+2 is 0.28249.-0.28249. But after guessing more values for x0x_0 to find the other roots, you will be hard-pressed to find any that result in an f(x)f(x) value that is close to 00. This is because x3+7x+2x^3+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).

Leave a Reply

Your email address will not be published. Required fields are marked *