Answer
The actual result $3.271$
The approximation: $3.574$
Difference: $3.574-3.271=0.303$
Work Step by Step
We are given $\frac{dy}{dx}=ye^{x}$
Using Euler's method $g(x,y)=ye^{x}$
Since $x=0, y=2$
$g(x_{0},y_{0})=2$ and $y_{1}=y_{0}+g(x_{0},y_{0})h=2+2\times0.1=2.2$
Now $x_{1}=0.1, y_{1}=2.2$
and $g(x_{1},y_{1})=2.431$
Then $y_{2}=2.2+(2.431)\times0.1=2.4431$
$y_{3}=2.4431+(2.98)\times0.1=2.741$
$y_{4}=2.741+(3.7)\times0.1=3.11$
$y_{5}=3.11+(4.641)\times0.1=3.574$
$y(0.4)=3.574$
$\frac{dy}{dx}=ye^{x}$
$\int\frac{1}{y}dy=\int e^{x}dx$
$\ln|y|=e^{x} + C$
With $x=0, y=2$
$C=-0.307$
$\ln|y|=e^{x} - 0.307$
$y(0.4) \rightarrow \ln|y|=e^{0.4} -0.307=1.185$
$\rightarrow y=e^{1.185}=3.271$
Difference between the result and approximation: $3.574-3.271=0.303$