# This SageMath code uses the classic 4th-order Runge-Kutta method # to approximate the solution of the IVP # dy/dx+y*(y-1)=x-2, y(1)=3. # # Use output="list" or output="plot" x=var("x") y=function("y")(x) de = diff(y,x)+y*(y-1)==x-2 desolve_rk4( de, y, ics=[1,3], step=0.05, end_points=2, output="list" )