Answer
Difference between the result and approximation: $-0.9-(-0.52)=-0.38$
Work Step by Step
We are given $\frac{dy}{dx}=-4+x$
Using Euler's method $g(x,y)=-4+x$
Since $x=0, y=1$
$g(x_{0},y_{0})=-4$ and
$y_{1}=y_{0}+g(x_{0},y_{0})h=1+(-4)\times0.1=0.6$
Now $x_{1}=0.1, y_{1}=0.6$ and
$g(x_{1},y_{1})=-3.9$
Then $y_{2}=0.6+(-3.9)\times0.1=0.21$
$y_{3}=0.21+(-3.8)\times0.1=-0.17$
$y_{4}=-0.17+(-3.7)\times0.1=-0.54$
$y_{5}=-0.54+(-3.6)\times0.1=-0.9$
$y(0.4)=-0.9$
$\frac{dy}{dx}=-4+x$
$\int dy=\int (-4+x)dx$
$y=-4x+\frac{x^{2}}{2}+C$
With $x=0, y=1$
$C=1+4(0)-\frac{(0)^{2}}{2}=1$
$y=-4x+\frac{x^{2}}{2}+1$
$y(0.4)=-4(0.4)+\frac{(0.4)^{2}}{2}+1=-0.52$
Difference between the result and approximation: $-0.9-(-0.52)=-0.38$