let y = f(x) be the solution to the differential equation dy/dx = x - y - 1 with the initial condition f(1)=…

let y = f(x) be the solution to the differential equation dy/dx = x - y - 1 with the initial condition f(1)= -2. what is the approximation for f(1.4) if eulers method is used, starting at x = 1 with two steps of equal size? (a) -2 (b) -1.24 (c) -1.2 (d) -0.64 (e) 0.2
Answer
Answer:
B. -1.24
Explanation:
Step1: Calculate step - size
The interval is from $x = 1$ to $x=1.4$ with $n = 2$ steps. The step - size $h=\frac{1.4 - 1}{2}=0.2$.
Step2: First step of Euler's method
Euler's method is $y_{n + 1}=y_{n}+h\cdot f(x_{n},y_{n})$, where $f(x,y)=x - y-1$. Given $x_{0}=1$ and $y_{0}=-2$. Then $y_{1}=y_{0}+h\cdot f(x_{0},y_{0})$. Substitute $x_{0}=1$, $y_{0}=-2$ and $h = 0.2$ into the formula: $f(x_{0},y_{0})=1-(-2)-1=2$. $y_{1}=-2+0.2\times2=-2 + 0.4=-1.6$.
Step3: Second step of Euler's method
Now $x_{1}=x_{0}+h=1 + 0.2 = 1.2$ and $y_{1}=-1.6$. $f(x_{1},y_{1})=1.2-(-1.6)-1=1.8$. $y_{2}=y_{1}+h\cdot f(x_{1},y_{1})$. Substitute $y_{1}=-1.6$, $h = 0.2$ and $f(x_{1},y_{1})=1.8$ into the formula: $y_{2}=-1.6+0.2\times1.8=-1.6 + 0.36=-1.24$. Since $x_{2}=1.4$, the approximation for $f(1.4)$ is $-1.24$.