Find using Euler approximation to the solution of Initial Value Problem:

$\displaystyle y' = x - y - 2$

$\displaystyle y(0) = 2$

[0,1], with step h = 0.1

My solution

I find:

$\displaystyle y_1 = 1.6$; $\displaystyle x_1 = 0.1$

$\displaystyle y_2 = 1.25$; $\displaystyle x_2 = 0.2$

Analytical Solution:

$\displaystyle y(x) = \frac{x^2}{2} - 2x$

$\displaystyle y(x_2) = -0.38$

Global error: $\displaystyle -0.38 - 1.25 = -1.63$

It's correct ???