The Newton-Raphson Method

So there you are, waiting for the bus to arrive, and you randomly decide to read the blog "All Over 2a". You've already read all the posts on Cambridge and the countless poems, and you've been waiting for something new. Luckily, there it is - a post, titled "The Newton-Raphson Method". It looks vaguely interesting, even if it's no South London park writeup or album review. Without second thought, you click on the post and start reading:

Here's a fun question:

What's the value of x for x2 - x - 1 = 0?

It's φ, or 1.618033... (and their negative equivalents), to be exact. You could have worked that out by using the quadratic formula, or perhaps you already knew that. Yet both of those methods are no fun.

It's not the most thrilling opening, you think to yourself. You could have written that, in fact anyone could. Then again, maybe it gets better in the fifth sentence.

A more interesting approach would be to take the equation and turn it into a function. As you plug in different values for x, you could get closer to 0 by narrowing down the possible range. So let the equation be the function f(x):

At f(1), the output is -1, so x must be greater than 1 for f(x)=0. At f(2), you get 1, so x must also be smaller than 2. Continue this infinitely, narrowing down the range ever further, and you'll land on φ.

Sure, you think. That's obvious - you did that back in school; you may not have enjoyed it, but you did it anyways. Still, it's not as captivating as you'd have hoped. Better read on:

But maybe there's a better approach - and indeed, there is. One which involves differentiation.

There's the twist that you've come to expect of this blog. One moment you're going over something a child could understand, the next they're going to have to explain calculus. 

You check your phone for the bus times. It will be here in five minutes. You might as well wait a bit longer, maybe the post is getting somewhere.

It's called the Newton-Raphson method, after the acclaimed physicist Isaac Newton, and the largely forgotten Joseph Raphson. That's despite him coming up with the concept of pantheism and writing about the method in a nicer way than Newton did - he doesn't even have an image on Wikipedia of him, and when you search up his name, you get an image of Newton.

You'd like the writer to get on with it.

Simply put, the Newton-Raphson method also narrows down the range, provided you start with a suitable opening number - otherwise, the function will diverge, not converge, to the root. You also want the function to not differentiate to zero - because then the method will not work.

Here's what it looks like:

The Newton-Raphson Method

Where x0 is the input, and x1 is the output.

Finally, some actual important information. 

So as in the example, let's select x0 to be 1. Note that the function differentiated is 2x - 1.

So, the first result is:

Not too ideal. But the next output might be better; this time, x0 will be 2:

                                                                

Not too ideal. But the next output might be better; this time, x0 will be 5/3:

                                                                  

Not too ideal. But the next output might be -

You notice the bus is about to arrive, saving you from the rest of the blogpost. Otherwise, you'd have to endure that loop. Otherwise, you'd have to endure that loop.

Comments