(due: April 29 in class)

**Problem 1 **(40%):

Consider an initial value problem of the form

dy/dt = F(y)

y(t_{0}) = y_{0}

This is called an autonomous differential equation, because F(y) does not depend explicitly on t. Give an expression
for the leading term of the truncation error for the Runge-Kutta method

y* = y_{k} + h*F(y_{k})

y_{k+1} = y_{k} + h/2 * F(y_{k}) + h/2 * F(y*)

**Useful hints for doing this problem :**

i) Do a Taylor expansion for y_{k+1} about y_{k}

ii) dy/dt = F(y(t)) Þ d^{2}y/dt^{2} = (dF/dy)*(dy/dt) Þ
d^{2}y/dt^{2} = (dF/dy) * F

iii) F( y_{n} + dt F( y_{n})) = F( y_{n}) + (dt F( y_{n}))*(dF/dy) + 1/2*(dt F(
y_{n}))^{2}*(d^{2}F/dy^{2}) + O(dt^{3})

Fact (iii) comes from expanding F( y_{n} + s) about s = dt F( y_{n}).

**Problem 2 **(60%):

Consider the following initial value problem:

dy/dt = cos(2*t) + sin(3*t)

0 <= t <= 1

y(0) = 1

a) Solve this problem numerically using a standard fourth order Runge Kutta method. Use h=0.2 and h=0.1.

b) Estimate the total error at each time step you are making with h=0.1. Do this by using the method called step-doubling.
The total error is defined as the sum of the local truncation errors multiplied by the step size (because of the
definition of the local truncation error).

c) Compare the total estimated errors with the actual errors of the method. Do this at each time step. For this,
you need to compare your numerical solution to the exact solution, which is of the form

y(t) = 1/2 * sin(2*t) - 1/3 cos(3*t) +4/3

d) Repeat b) and c) using the Runge-Kutta-Fehlberg Method.

e) How do the two different ways to estimate the error compare?

**You should turn in the following: **

- the scripts you are using for the two different methods.

- One plot that shows the two different solutions (and the exact result) as a function of t (only for h=0.1).

- A plot that compares the error and the estimated total error at each timestep. This plot for each method, and
for each h.