Find y(0.5) for `y'=-2x-y`, `x_0=0, y_0=-1`, with step length 0.1 using Improved Euler method (1st order derivative) Solution:Given `y'=-2x-y, y(0)=-1, h=0.1, y(0.5)=?`
Here, `x_0=0,y_0=-1,h=0.1,x_n=0.5`
`y'=-2x-y`
`:. f(x,y)=-2x-y`
Improved Euler method
`y_(m+1)=y_m+1/2 h[f(x_m,y_m) + f(x_m+h,y_m + hf(x_m,y_m))]`
`f(x_0,y_0)=f(0,-1)=1`
`f(x_0+h,y_0 + hf(x_0,y_0))=f(0.1,-0.9)=0.7`
`y_1=y_0+1/2 h[f(x_0,y_0) + f(x_0+h,y_0 + hf(x_0,y_0))]`
`y_1=-1+0.1/2 * [1+0.7]=-0.915`
Again taking `(x_1,y_1)` in place of `(x_0,y_0)` and repeat the process
`f(x_1,y_1)=f(0.1,-0.915)=0.715`
`f(x_1+h,y_1 + hf(x_1,y_1))=f(0.2,-0.8435)=0.4435`
`y_2=y_1+1/2 h[f(x_1,y_1) + f(x_1+h,y_1 + hf(x_1,y_1))]`
`y_2=-0.915+0.1/2 * [0.715+0.4435]=-0.8571`
Again taking `(x_2,y_2)` in place of `(x_1,y_1)` and repeat the process
`f(x_2,y_2)=f(0.2,-0.8571)=0.4571`
`f(x_2+h,y_2 + hf(x_2,y_2))=f(0.3,-0.8114)=0.2114`
`y_3=y_2+1/2 h[f(x_2,y_2) + f(x_2+h,y_2 + hf(x_2,y_2))]`
`y_3=-0.8571+0.1/2 * [0.4571+0.2114]=-0.8237`
Again taking `(x_3,y_3)` in place of `(x_2,y_2)` and repeat the process
`f(x_3,y_3)=f(0.3,-0.8237)=0.2237`
`f(x_3+h,y_3 + hf(x_3,y_3))=f(0.4,-0.8013)=0.0013`
`y_4=y_3+1/2 h[f(x_3,y_3) + f(x_3+h,y_3 + hf(x_3,y_3))]`
`y_4=-0.8237+0.1/2 * [0.2237+0.0013]=-0.8124`
Again taking `(x_4,y_4)` in place of `(x_3,y_3)` and repeat the process
`f(x_4,y_4)=f(0.4,-0.8124)=0.0124`
`f(x_4+h,y_4 + hf(x_4,y_4))=f(0.5,-0.8112)=-0.1888`
`y_5=y_4+1/2 h[f(x_4,y_4) + f(x_4+h,y_4 + hf(x_4,y_4))]`
`y_5=-0.8124+0.1/2 * [0.0124-0.1888]=-0.8212`
`:.y(0.5)=-0.8212`
| `n` | `x_n` | `y_n` | `x_(n+1)` | `y_(n+1)` |
| 0 | 0 | -1 | 0.1 | -0.915 |
| 1 | 0.1 | -0.915 | 0.2 | -0.8571 |
| 2 | 0.2 | -0.8571 | 0.3 | -0.8237 |
| 3 | 0.3 | -0.8237 | 0.4 | -0.8124 |
| 4 | 0.4 | -0.8124 | 0.5 | -0.8212 |
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then