Use Euler’s method to approximate y(0.2), where y(x) is the solution of the initial-value problem y”-(2x + 1)y =1, y(0)=3, y'(0) ?=1. First use one step with h =0.2 and then repeat the calculations using two steps with h =0.1.

we shall rewrite this equation as folllows:

\f[y''=1+(2x+1)y\f]

we then let

\f[u=y'\f]

thus

\f[u'=1+(2x+1)y\f]

the recursive euler’s method is

\f[y_{n+1}=y_{n}+hu_{n}\f]

\f[u_{n+1}=u_{n}+hf(x_{n},y_{n},u_{n})\f]

starting with h=0.2;

\f[u_{0}=1\f]

thus

\f[y_{1}=y_{0}+hu_{0}\f]

\f[y_{1}=y(0.2)=3+0.2(1)=3.2\f]

then h=0.1;

\f[y_{1}=y_{0}+hu_{0}\f]

\f[y_{1}=3+(0.1*1)=3.1\f]

also

\f[u_{1}=u_{0}+hf(x_{0},y_{0},u_{0})\f]

\f[u_{1}=1+0.1[1+(2*0+1)3]=1.4\f]

then

\f[y_{2}=y_{1}+hu_{1}\f]

\f[y_{2}=y(0.2)=3.1+(0.1*1.4)=3.24\f]

 

​​