Computing square roots of numbers with Newton's method(Implementation in python)
Newton's method In this short article I will introduce you to how you can write a small python script that calculates square root of any number you give provided that your initial guess converges. You will also gain bragging rights on knowing how those smart guys calculate square roots of numbers in your calculator. From calculus we know that we can approximate functions by linearisation with the gradient of the said function and an example of this is the Taylor expansion series. In this article we will talk about the Newton's method which is used for estimating a solution of an equation of the form . I will explain how this works in the subsequent paragraph. From the equaltion of the line we know that or maybe you're more familiar with the equation of a slope given by . In Newton's method, we set to zero and solve for to obtain . Where a is our initial guess. Subsequently we plug the obtained as a and do this repeatedly till our solution gets close enough t...