Book
Advanced Engineering Mathematics
Author
Erwin Kreyszig
Edition
8th Edition
newton(1,2,2)
newton(1,3,2)
newton(1,4,2)
newton(1,5,2)
def newton(x0,k,N):
"function to calculate the root of a given number,"
"x0=initial approximation, k= power or desired root,N=given number"
h(x)=((k-1)*(x)+N/x**(k-1))/k #Iteration Scheme by the newton raphson method
h(x0)
for i in range (10):
xn=h(x0)
x0=xn
o=float(h(x0))
print o
Solution by:
- Praveen Kumar,Student,IIT Roorkee
