Solution:
The iterative formulas for Euler's method are xn+1=xn+h, yn+1=yn+h×f(xn,yn) , where y′=f(x,y) , y(x0)=y0
In this case f(x,y)=x2+y2 , x0=0, y0=3
I) Solution for h=0.1
x1=x0+h=0+0.1=0.1
y1=y0+h×f(x0,y0)=3+0.1×(02+32)=3.9
Analogically, searching for the next points of the solution - x2,y2,x3,y3,x4,y4,x5,y5, until reaching the desired value y(0.5)
x2=x1+h=0.1+0.1=0.2
y2=y1+h×f(x1,y1) =3.9+0.1×(0.12+3.92)=5.422
x3=x2+h=0.3
y3=y3+h×f(x3,y3) =5.422+0.1×(0.22+5.4222)=8.3658
x4=x3+h=0.4
y4=y4+h×f(x4,y4) =8.3658+0.1×(0.32+8.36582)=15.3735
x5=x4+h=0.5
y5=y4+h×f(x4,y4) =15.3735+0.1×(0.42+15.37352)=39.0239
So the answer for h=0.1 is y(0.5)=39.0239
II)Solution for h=0.05
x1=x0+h=0+0.05=0.05
y1=y0+h×f(x0,y0) =3+0.05×(02+32)=3.45
x2=x1+h=0.1
y2=y1+h×f(x1,y1) =3.45+0.05×(0.052+3.452)=4.0453
x3=x2+h=0.15
y3=y2+h×f(x2,y2) =4.0453+0.05×(0.12+4.04532)=4.8640
x4=x3+h=0.2
y4=y3+h×f(x3,y3) =4.8640+0.05×(0.152+4.86402)=6.0480
x5=x4+h=0.25
y5=y4+h×f(x4,y4) =6.0480+0.05×(0.22+6.04802)=7.8789
x6=x5+h=0.3
y6=y5+h×f(x5,y5) =7.8789+0.05×(0.252+7.87892)=10.9858
x7=x6+h=0.35
y7=y6+h×f(x6,y6) =10.9858+0.05×(0.32+10.98582)=17.0248
x8=x7+h=0.4
y8=y7+h×f(x7,y7) =17.0248+0.05×(0.352+17.02482)=31.5231
x9=x8+h=0.45
y9=y8+h×f(x8,y8) =31.5231+0.05×(0.42+31.52312)=81.2163
x10=x9+h=0.5
y10=y9+h×f(x9,y9) =81.2163+0.05×(0.452+81.21632)=411.0307
So the answer for h=0.05 is y(0.5)=411.0307
Answer: y(0.5)≈39.0239(h=0.1)
y(0.5)≈411.0307(h=0.05)
Results of all the calculations are summarized in a tabular form (screenshot attached)
Comments