# Math 151B Homework 2

\$30.00

## 1 Part I (50%)

(1) Show that the Modified Euler method is of order two.
(2) Use Theorem 5.20 to show that the Runge-Kutta method of order four is consistent.
(3) Exercise 5.10.4 a,b,c,d
(4) Exercise 5.4.30.
(5) Exercise 5.4.32.

## 2 Part II (50%)

Consider the following well-posed IVP:

y
0
(t) = 1 + y
t
, 1 ≤ t ≤ 2;
y(1) = 2,
(1)
with the exact solution y(t) = tln t + 2t. Choose the step sizes h = 0.2, 0.1, 0.05, respectively.

(a) Use Taylor’s method of order two to approximate the solution. Discuss the behavior of the approximated
solution as a function of h, and compare it with the exact solution in plots of t versus y. Estimate the
order of the method from the error. Which value of h do you need to choose (approximately) to achieve
an accuracy of 10−4
for y(2)?

(b) Use Midpoint method (p.286) to redo Part (a).

(c) Compare the results and running times1 of Part (a) and (b). What does the comparison of error and
running time tell us about the efficiency of the two methods?

### Requirements

• Submit the code file to CCLE : A MATLAB (or other software) function taylor2.m that implements
Taylor’s method of order two, a MATLAB function (or other software) midpt.m that implements Midpoint method, and a MATLAB (or other software) script main.m that solves the IVP (1) and plots the
approximated solutions versus the exact one.

• Print a PDF report to your TA.
1tic and toc can be used to record the running time. See http://www.mathworks.com/help/matlab/ref/tic.html and http:
//www.mathworks.com/help/matlab/ref/tic.html for more details.
1