2. Find y(0.5) for `y'=-2x-y`, y(0) = -1, with step length 0.1 using Euler method
Solution:
Given `y'=-2x-y, y(0)=-1, h=0.1, y(0.5)=?`
Euler method
`y_1=y_0+hf(x_0,y_0)=-1+(0.1)f(0,-1)=-1+(0.1)*(1)=-1+(0.1)=-0.9`
`y_2=y_1+hf(x_1,y_1)=-0.9+(0.1)f(0.1,-0.9)=-0.9+(0.1)*(0.7)=-0.9+(0.07)=-0.83`
`y_3=y_2+hf(x_2,y_2)=-0.83+(0.1)f(0.2,-0.83)=-0.83+(0.1)*(0.43)=-0.83+(0.043)=-0.787`
`y_4=y_3+hf(x_3,y_3)=-0.787+(0.1)f(0.3,-0.787)=-0.787+(0.1)*(0.187)=-0.787+(0.0187)=-0.7683`
`y_5=y_4+hf(x_4,y_4)=-0.7683+(0.1)f(0.4,-0.7683)=-0.7683+(0.1)*(-0.0317)=-0.7683+(-0.00317)=-0.77147`
`:.y(0.5)=-0.77147`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then