a=0.0 b=1.0 n=200000 h=(b-a)/n t=a x=1.0 for k in range(n): xd=t-1/(1+x) #xdd=0.0 xdd=1+xd/(1+x)**2 x=x+h*xd+h**2*xdd/2.0 t=t+h print x