`y_0=1,y_1=1.1051,y_2=1.221,y_3=1.3477`
Given `y'=y-x^3, y(0)=1, h=0.1, y(0.3)=?`
Forth order R-K method
`k_1=hf(x_0,y_0)=(0.1)f(0,1)=(0.1)*(1)=0.1`
`k_2=hf(x_0+h/2,y_0+k_1/2)=(0.1)f(0.05,1.05)=(0.1)*(1.0499)=0.105`
`k_3=hf(x_0+h/2,y_0+k_2/2)=(0.1)f(0.05,1.0525)=(0.1)*(1.0524)=0.1052`
`k_4=hf(x_0+h,y_0+k_3)=(0.1)f(0.1,1.1052)=(0.1)*(1.1042)=0.1104`
`y_1=y_0+1/6(k_1+2k_2+2k_3+k_4)`
`y_1=1+1/6[0.1+2(0.105)+2(0.1052)+(0.1104)]`
`y_1=1.1051`
`:.y(0.1)=1.1051`
Again taking `(x_1,y_1)` in place of `(x_0,y_0)` and repeat the process
`k_1=hf(x_1,y_1)=(0.1)f(0.1,1.1051)=(0.1)*(1.1041)=0.1104`
`k_2=hf(x_1+h/2,y_1+k_1/2)=(0.1)f(0.15,1.1604)=(0.1)*(1.157)=0.1157`
`k_3=hf(x_1+h/2,y_1+k_2/2)=(0.1)f(0.15,1.163)=(0.1)*(1.1596)=0.116`
`k_4=hf(x_1+h,y_1+k_3)=(0.1)f(0.2,1.2211)=(0.1)*(1.2131)=0.1213`
`y_2=y_1+1/6(k_1+2k_2+2k_3+k_4)`
`y_2=1.1051+1/6[0.1104+2(0.1157)+2(0.116)+(0.1213)]`
`y_2=1.221`
`:.y(0.2)=1.221`
Again taking `(x_2,y_2)` in place of `(x_0,y_0)` and repeat the process
`k_1=hf(x_2,y_2)=(0.1)f(0.2,1.221)=(0.1)*(1.213)=0.1213`
`k_2=hf(x_2+h/2,y_2+k_1/2)=(0.1)f(0.25,1.2816)=(0.1)*(1.266)=0.1266`
`k_3=hf(x_2+h/2,y_2+k_2/2)=(0.1)f(0.25,1.2843)=(0.1)*(1.2687)=0.1269`
`k_4=hf(x_2+h,y_2+k_3)=(0.1)f(0.3,1.3479)=(0.1)*(1.3209)=0.1321`
`y_3=y_2+1/6(k_1+2k_2+2k_3+k_4)`
`y_3=1.221+1/6[0.1213+2(0.1266)+2(0.1269)+(0.1321)]`
`y_3=1.3477`
`:.y(0.3)=1.3477`
`:.y(0.3)=1.3477``y'=y-x^3`
`y'_0=y-x^3=1` (where `x=0,y=1`)
`y'_1=y-x^3=1.1041` (where `x=0.1,y=1.1051`)
`y'_2=y-x^3=1.213` (where `x=0.2,y=1.221`)
`y'_3=y-x^3=1.3207` (where `x=0.3,y=1.3477`)
Iteration-1 (for `x_(4)=0.4`)
`y_(4,p)=y_3 + h/24 (55y'_(3) - 59y'_2 + 37y'_1 - 9y'_0)`
`y_(4,p)=1.3477 + 0.1/24 * (55 * 1.3207 - 59 * 1.213 + 37 * 1.1041 - 9 * 1)`
`y_(4,p)=1.3477 + 0.1/24 * (72.6388 -71.5662 +40.8534 -9)`
`y_(4,p)=1.3477 + 0.1/24 * (32.926)`
`y_(4,p)=1.3477 +0.1372`
`y_(4,p)=1.4849`
So, the predicted value is `1.4849`
Now, we will correct it by corrector method to get the final value
`y'_4=y-x^3=1.4209` (where `x=0.4,y=1.4849`)
Adam's Bashforth Corrector formula is
`y_(n+1,c) = y_n + h/24 (9y'_(n+1) + 19y'_(n) - 5y'_(n-1) + y'_(n-2))`
putting `n=3`, we get
`y_(4,c) = y_3 + h/24 (9y'_4 + 19y'_3 - 5y'_2 + y'_1)`
`y_(4,c) = 1.3477 + 0.1/24 * (9 * 1.4209 + 19 * 1.3207 - 5 * 1.213 + 1.1041)`
`y_(4,c) = 1.3477 + 0.1/24 * (12.7881 +25.0934 -6.0649 +1.1041)`
`y_(4,c) = 1.3477 + 0.1/24 * (32.9207)`
`y_(4,c) = 1.3477 +0.1372`
`y_(4,c)=1.4849`
`:.y(0.4) = 1.4849`