MATH 4/548, CPT S 4/530 ASSIGNMENT 13 SOLUTIONS
Problem 6.3.2b: easiest to just use Matlab
yp = @(t,y)[-1 -1;1 -1]*y;
N = 4; h = 1/N; y = [ 1; 0 ]; t = 0;
for i = 1 : N, f = yp(t,y);
y = y + h*( f + yp(t+h,y+h*f) )/2;
t = t + h; disp([t y])
end
disp([t y

MATH 4/548, CPT S 4/530 ASSIGNMENT 12 SOLUTIONS
Problem 6.1.4c:integrating factor is e2t , so equation becomes (e2t y ) = 4te2t , and
integration result is e2t y = 2te2t e2t + C , so y (t) = 2t 1 + Ce2t .
Initial value is y (0) = 0, so C = 1 and nal solu

MATH 4/548, CPT S 4/530 ASSIGNMENT 10 SOLUTIONS
Problem 5.1.2: from Matlab
f = @(x)exp(x);
for h=[.1 .01 .001],disp([h (f(h)-f(-h)/(2*h)]),end
h
Centered Difference
0.1
1.00166750019844
0.01
1.00001666674999
0.001
1.00000016666668
Problem 5.1.6: from Ma

MATH 4/548, CPT S 4/530 ASSIGNMENT 9 SOLUTIONS
Problem 4.1.2: a)
T
b) A A =
73
32
62
332
2
T
A A = 3 6 3 , x = 1/3 , RM SE = 1/ 12 .28868.
233
2
6
1
2 , x = 1 , RM SE = 0.
7
1
Problem 4.1.4: AT A = In identity, and AT b = [b1 , . . . , bn ]T so x = [b1

MATH 4/548, CPT S 4/530 ASSIGNMENT 8 SOLUTIONS
Problem 3.4.2: a) S1 (1) = 10 = S2 (1), S1 (1) = 20 = S2 (1), S1 (1) = 30 = S2 (1),
so continuity properties are satised.
b) S1 (0) = 6 = 0, so not natural; S1 and S2 are both cubics, so not parabolically te

MATH 4/548, CPT S 4/530 ASSIGNMENT 6 SOLUTIONS
Problem 2.6.4:
a) rst row of R is [1 0], but then r22 = 3 so factorization fails;
d) rst row of R is [1 0 0], but then r22 = 2 so factorization fails;
2 1
0
1 1 ,
Problem 2.6.8:b) Cholesky factor is R = 0
0

MATH 4/548, CPT S 4/530 ASSIGNMENT 4 SOLUTIONS
2 2 1 2
5
5
0
Problem 2.1.2a: after elimination the augmented matrix is 0
0
0 2 4
backsubstitution gives the solution x = [1 1 2] .
3 4 2
3
2
5 4
Problem 2.1.4a: after elimination the augmented matrix is 0

MATH 4/548, CPT S 4/530 ASSIGNMENT 3 SOLUTIONS
Problem 1.4.2:
a) with f = x3 + x2 1, f = 3x2 + 2x, x0 = 1, x1 = 1 1/5 = 4/5, x2 0.75682.
c) with f = 5x 10, f = 5, x0 = 1, x1 = 1 + 5/5 = 2, x2 = 2.
Problem 1.4.4: b) f (x) = 3x2 2x 5, f (x) = 6x 2;
at r =

MATH 4/548, CPT S 4/530 ASSIGNMENT 2 SOLUTIONS
Problem 1.1.2:
a) with f = x5 + x 1, f (0) = 1, f (1) = 1, so interval is [0, 1];
c) with f = ln(x) + x2 3, f (1) < 0, f (2) > 0, so interval is [1, 2].
Problem 1.1.4:
a) starting with [0, 1], f (.5) < 0, n

MATH 4/548, CPT S 4/530 ASSIGNMENT 1 SOLUTIONS
Problem 0.5.4:
2
a) f = ex , so f = 2xf, f = 2f + 4x2 f ; at x = 0, f = 1, f = 0, f = 2. P2 (x) = 1 + x2 .
1
1
2
b) f = (1+x) , so f = (1+x)2 , f = (1+x)3 ; at x = 0, f = 1, f = 1, f = 2; P2 (x) = 1 x + x2 .

MATH 448/548 CPT S 430/530 MIDTERM EXAM 2 SOLUTIONS
1. (12 pts.) Make a divided dierence table for the data below and use the Newton divided
dierence form of the degree 3 interpolating polynomial P3 (x) to calculate P3 (1/2).
x
-2
-1
0
1
f(x)
-15
-2
1
6
D

MATH 448/548 CPT S 430/530 MIDTERM SPRING 2012 EXAM 1 SOLUTIONS
1. (15 pts.)
(a) Let f (x) = x3 + x2 2x 1. Starting with x0 = 0 use two iterations of the Newton
method to determine an approximate solution to f (x) = 0. You are required to use
nested multi