steps = 10 x=1.0 t=0.0 print 't=' , t, ', x=' , x h=2.0/steps for k in range(steps): x = x + h*(t**2+x**3-x) + ((h**2)/2)*(2.0*t+(3.0*x**2-1)*(t**2+x**3-x)) t=t+h print 't=' , t, ', x=' , x