solving nonlinear algebraic equations the slope equals to the tangent touches the xcurve at soif we write the tangent function as fq xd ax bwe must require fq and fq /resulting in fq xd the key step in newton' method is to find where the tangent crosses the axiswhich means solving fq xd fq xd this is our new candidate pointwhich we call with we get which is in accordance with the graph in fig repeating the processwe get the general scheme of newton' method may be written as xnc xn xn xn ( the computation in ( is repeated until xn is close enough to zero more preciselywe test if jf xn / with being small number we moved from to in two iterationsso it is exciting to see how fast we can approach the solution computer program can automate the calculations our first try at implementing newton' method is in function naive_newtondef naive_newton(fdfdxxeps)while abs( ( )epsx float( ( ))/dfdx(xreturn the argument is the starting valuecalled in our previous mathematical description we use float( ( )to ensure that an integer division does not happen by accident if (xand dfdx(xboth are integers for some to solve the problem we also need to implement def ( )return ** def dfdx( )return * print naive_newton(fdfdx