1. ## Euler's Method Approximation

Hey all,
I have the IVP $\frac{dy}{dt} = y + t^2, y(0) = -1$
Using Euler's method with a step size h = 1, I want to compute the solution to the
IVP at final time t = 3.

I have done the following:
first step:
$y_0 = -1, t_0 = 0, h = 1$
$f(t_0,y_0) = -1 * 0^2 = -1$
$y_1 = y_0 + h*f(t_0,y_0)$
$= -1 + 1 * -1 = -2$

second step:
$y_1 = -2, t_1 = 1, h = 1$
$f(t_1,y_1) = -2 * 1^2 = -1$
$y_2 = y_1 + h*f(t_1,y_1)$
$= -2 + 1 * -1 = -3$

third step:
$y_2 = -3, t_2 = 2, h = 1$
$f(t_2,y_2) = -1 * 2^2 = 1$
$y_3 = y_2 + h*f(t_2,y_2)$
$= -3 + 1 * 1 = -2$

I have solved the Linear DE and got $y = e^t-t^2-2t-2$
which when $t=3, y = e^{(3)}-(3)^2-2(3)-2 = 3.0855$. But Euler's method approximates the third step to be $-2$.
Have I done something wrong in my working ? or is it just that this model is not appropriate for this IVP. Thanks

2. Originally Posted by Oiler
Hey all,
I have the IVP $\frac{dy}{dt} = y + t^2, y(0) = -1$
Using Euler's method with a step size h = 1, I want to compute the solution to the
IVP at final time t = 3.

I have done the following:
first step:
$y_0 = -1, t_0 = 0, h = 1$
$f(t_0,y_0) = -1 * 0^2 = -1$ I assume this should be -1 + 0^2
$y_1 = y_0 + h*f(t_0,y_0)$
$= -1 + 1 * -1 = -2$

second step:
$y_1 = -2, t_1 = 1, h = 1$
$f(t_1,y_1) = -2 * 1^2 = -1$ I assume this should be -2 + 1^2
$y_2 = y_1 + h*f(t_1,y_1)$
$= -2 + 1 * -1 = -3$

third step:
$y_2 = -3, t_2 = 2, h = 1$
$f(t_2,y_2) = -1 * 2^2 = 1$ I assume this should be -1 + 2^2 = 3
$y_3 = y_2 + h*f(t_2,y_2)$
$= -3 + 1 * 1 = -2$

I have solved the Linear DE and got $y = e^t-t^2-2t-2$
which when $t=3, y = e^{(3)}-(3)^2-2(3)-2 = 3.0855$. But Euler's method approximates the third step to be $-2$.
Have I done something wrong in my working ? or is it just that this model is not appropriate for this IVP. Thanks
See the red alterations...

3. Oops had the correct work on paper.. Thanks Prove IT. Also It should be $f(t_2,y_2) = -3 + 2^2 = 1$ for the last part.