initial value problem

• Nov 9th 2008, 06:43 PM
PvtBillPilgrim
initial value problem
I'm in a numerical analysis class and I'm trying to approximate an initial value problem. I get the approximation using Forward Euler and other methods, but I'm not sure what the true answer is. I haven't done ODE's in a while.

Does anyone know how to solve the problem?
y'(t) = y - t^2 + 1, t in [0,2]
y(0) = 2

Thanks for any help in advance.
• Nov 9th 2008, 07:13 PM
Chris L T521
Quote:

Originally Posted by PvtBillPilgrim
I'm in a numerical analysis class and I'm trying to approximate an initial value problem. I get the approximation using Forward Euler and other methods, but I'm not sure what the true answer is. I haven't done ODE's in a while.

Does anyone know how to solve the problem?
y'(t) = y - t^2 + 1, t in [0,2]
y(0) = 2

Thanks for any help in advance.

This is the same thing as $\displaystyle \frac{\,dy}{\,dt}-y=1-t^2$

Now apply the method of the integrating factor, since this equation is linear.

Thus, our integrating factor is $\displaystyle \varrho=e^{-\int\,dt}=e^{-t}$

Thus, we now have $\displaystyle \frac{d}{\,dt}\left[e^{-t}y\right]=e^{-t}-t^{2}e^{-t}$

Now, integrate both sides:

$\displaystyle e^{-t}y=-e^{-t}-\int e^{-t}t^2\,dt$

[I leave you to evaluate the integral on the right side of the equation. You will need to apply integration by parts twice.]

Thus, $\displaystyle y=-e^t\cdot\left[\int e^{-t}t^2\,dt\right]+C$

Then apply the initial condition $\displaystyle y(0)=2$ to find $\displaystyle C$.

Can you take it from here?

--Chris