from sympy import * var('x y') f=lambda x,y:x+y**2 x0=0 y=1 x=0.2 h=0.1 n=int((x-x0)/h) for i in range(1,n+1): k1=h*f(x0,y) k2=h*f(x0+0.5*h,y+0.5*k1) k3=h*f(x0+0.5*h,y+0.5*k2) k4=h*f(x0+h,y+k3) y=y+(1/6)*(k1+2*k2+2*k3+k4) x0=x0+h print('the value of t at x',(y))