`y_0=1,y_1=0.8512,y_2=0.7798,y_3=0.7621`
Given `y'=x-y^2, y(0)=1, h=0.2, y(0.6)=?`
Forth order R-K method
`k_1=hf(x_0,y_0)=(0.2)f(0,1)=(0.2)*(-1)=-0.2`
`k_2=hf(x_0+h/2,y_0+k_1/2)=(0.2)f(0.1,0.9)=(0.2)*(-0.71)=-0.142`
`k_3=hf(x_0+h/2,y_0+k_2/2)=(0.2)f(0.1,0.929)=(0.2)*(-0.763)=-0.1526`
`k_4=hf(x_0+h,y_0+k_3)=(0.2)f(0.2,0.8474)=(0.2)*(-0.5181)=-0.1036`
`y_1=y_0+1/6(k_1+2k_2+2k_3+k_4)`
`y_1=1+1/6[-0.2+2(-0.142)+2(-0.1526)+(-0.1036)]`
`y_1=0.8512`
`:.y(0.2)=0.8512`
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.2)f(0.2,0.8512)=(0.2)*(-0.5245)=-0.1049`
`k_2=hf(x_1+h/2,y_1+k_1/2)=(0.2)f(0.3,0.7987)=(0.2)*(-0.338)=-0.0676`
`k_3=hf(x_1+h/2,y_1+k_2/2)=(0.2)f(0.3,0.8174)=(0.2)*(-0.3681)=-0.0736`
`k_4=hf(x_1+h,y_1+k_3)=(0.2)f(0.4,0.7776)=(0.2)*(-0.2046)=-0.0409`
`y_2=y_1+1/6(k_1+2k_2+2k_3+k_4)`
`y_2=0.8512+1/6[-0.1049+2(-0.0676)+2(-0.0736)+(-0.0409)]`
`y_2=0.7798`
`:.y(0.4)=0.7798`
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.2)f(0.4,0.7798)=(0.2)*(-0.2081)=-0.0416`
`k_2=hf(x_2+h/2,y_2+k_1/2)=(0.2)f(0.5,0.759)=(0.2)*(-0.0761)=-0.0152`
`k_3=hf(x_2+h/2,y_2+k_2/2)=(0.2)f(0.5,0.7722)=(0.2)*(-0.0963)=-0.0193`
`k_4=hf(x_2+h,y_2+k_3)=(0.2)f(0.6,0.7606)=(0.2)*(0.0216)=0.0043`
`y_3=y_2+1/6(k_1+2k_2+2k_3+k_4)`
`y_3=0.7798+1/6[-0.0416+2(-0.0152)+2(-0.0193)+(0.0043)]`
`y_3=0.7621`
`:.y(0.6)=0.7621`
`:.y(0.6)=0.7621``y'=x-y^2`
`y'_0=x-y^2=-1` (where `x=0,y=1`)
`y'_1=x-y^2=-0.5245` (where `x=0.2,y=0.8512`)
`y'_2=x-y^2=-0.2081` (where `x=0.4,y=0.7798`)
`y'_3=x-y^2=0.0192` (where `x=0.6,y=0.7621`)
Iteration-1 (for `x_(4)=0.8`)
`y_(4,p)=y_3 + h/24 (55y'_(3) - 59y'_2 + 37y'_1 - 9y'_0)`
`y_(4,p)=0.7621 + 0.2/24 * (55 * 0.0192 - 59 * (-0.2081) + 37 * (-0.5245) - 9 * (-1))`
`y_(4,p)=0.7621 + 0.2/24 * (1.0559 +12.2786 -19.4077 +9)`
`y_(4,p)=0.7621 + 0.2/24 * (2.9267)`
`y_(4,p)=0.7621 +0.0244`
`y_(4,p)=0.7865`
So, the predicted value is `0.7865`
Now, we will correct it by corrector method to get the final value
`y'_4=x-y^2=0.1814` (where `x=0.8,y=0.7865`)
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) = 0.7621 + 0.2/24 * (9 * 0.1814 + 19 * 0.0192 - 5 * (-0.2081) + (-0.5245))`
`y_(4,c) = 0.7621 + 0.2/24 * (1.6329 +0.3648 +1.0406 -0.5245)`
`y_(4,c) = 0.7621 + 0.2/24 * (2.5136)`
`y_(4,c) = 0.7621 +0.0209`
`y_(4,c)=0.7831`
`y'_4=x-y^2=0.1868` (where `x=0.8,y=0.7831`)
`y_(4,c) = y_3 + h/24 (9y'_4 + 19y'_3 - 5y'_2 + y'_1)`
`y_(4,c) = 0.7621 + 0.2/24 * (9 * 0.1868 + 19 * 0.0192 - 5 * (-0.2081) + (-0.5245))`
`y_(4,c) = 0.7621 + 0.2/24 * (1.6815 +0.3648 +1.0406 -0.5245)`
`y_(4,c) = 0.7621 + 0.2/24 * (2.5623)`
`y_(4,c) = 0.7621 +0.0214`
`y_(4,c)=0.7835`
Iteration-2 (for `x_(5)=1`)
`y_(5,p)=y_4 + h/24 (55y'_(4) - 59y'_3 + 37y'_2 - 9y'_1)`
`y_(5,p)=0.7835 + 0.2/24 * (55 * 0.1868 - 59 * 0.0192 + 37 * (-0.2081) - 9 * (-0.5245))`
`y_(5,p)=0.7835 + 0.2/24 * (10.2757 -1.1327 -7.7001 +4.7208)`
`y_(5,p)=0.7835 + 0.2/24 * (6.1637)`
`y_(5,p)=0.7835 +0.0514`
`y_(5,p)=0.8348`
So, the predicted value is `0.8348`
Now, we will correct it by corrector method to get the final value
`y'_5=x-y^2=0.3031` (where `x=1,y=0.8348`)
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=4`, we get
`y_(5,c) = y_4 + h/24 (9y'_5 + 19y'_4 - 5y'_3 + y'_2)`
`y_(5,c) = 0.7835 + 0.2/24 * (9 * 0.3031 + 19 * 0.1868 - 5 * 0.0192 + (-0.2081))`
`y_(5,c) = 0.7835 + 0.2/24 * (2.7277 +3.5498 -0.096 -0.2081)`
`y_(5,c) = 0.7835 + 0.2/24 * (5.9734)`
`y_(5,c) = 0.7835 +0.0498`
`y_(5,c)=0.8332`
`y'_5=x-y^2=0.3057` (where `x=1,y=0.8332`)
`y_(5,c) = y_4 + h/24 (9y'_5 + 19y'_4 - 5y'_3 + y'_2)`
`y_(5,c) = 0.7835 + 0.2/24 * (9 * 0.3057 + 19 * 0.1868 - 5 * 0.0192 + (-0.2081))`
`y_(5,c) = 0.7835 + 0.2/24 * (2.7515 +3.5498 -0.096 -0.2081)`
`y_(5,c) = 0.7835 + 0.2/24 * (5.9972)`
`y_(5,c) = 0.7835 +0.05`
`y_(5,c)=0.8334`
`:.y(1) = 0.8334`