Given the differential:
$y'' + y' - y = x$ , $y(0) = 2$ , $y'(0)=1$
I am asked to calculate $y'(2)$ for (a) $h=2$ and (b) $h=1$
I have used Euler's method for a second order differential so I am unsure if how I answered the question is correct and would appreciate if someone could tell if it is.
My attempt
$$ \begin{matrix} x & y & y'& y'' \\ 0 & 2 & 1 & \color{red}{1} \\ 2 & \color{blue}{4} & \color{green}{3} \\ \end{matrix} $$
$y''(0) = y(0) + x(0) - y'(0) = \color{red}{1}$
$y(2) = y_0 + h * f'(x_o,y_0,y''_0) = 2+2*(2+0-1) = \color{blue}{4}$
$y'(2) = y'_0 + h * f'(x_o,y_0,y''_0) = 1 + 2 *(2+0-1) = \color{green}{3}$
So answer for (a) is $y'(2) = 3$
Is that how to apply Euler's method for a second order differential?
Thank you!