Math 128A Homework 5: Integration Techniques & Error Analysis, Assignments of Mathematical Methods for Numerical Analysis and Optimization

The solutions to problem 5.2.8 and 5.2.10 in the math 128a, spring 2007 course. It covers the application of the midpoint rule (m1) and simpson's rule (p4) for approximating definite integrals, as well as the error analysis for these methods. The document also includes the comparison of the approximated values with the exact integral value for the function 1/(1+x).

Typology: Assignments

Pre 2010

Uploaded on 10/01/2009

koofers-user-jrm
koofers-user-jrm 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 128A, Spring 2007
Homework 5 Solution
5.2.8 (a) I(f) = Rb
af(x)dx Rb
af((a+b)/2)dx = (ba)f((a+b)/2) = M1(f).
(b) If we subdivide [a, b] into nsubintervals a=x0< x1<· · · < xn=b
with xi+1 =xi+hand apply M1to each subinterval, we get
I(f) = Zb
a
f(x)dx
=Zx1
x0
f(x)dx +· · · +Zxn
xn1
f(x)dx
(x1x0)f((x0+x1)/2) + · · · + (xnxn1)f((xn1+xn)/2)
=hf(a+h/2) + · · · +hf (a+ (n1/2)h)
(c) M1(1/(1 + x)) = 2/3.6667 and M2(1/(1 + x)) = 2/5 + 2/7.6857,
while I= log 2 .6931.
5.2.10 (a) Following the derivation of Simpson’s rule,
I(f) = Zb
a
f(x)dx
Zb
a
P4(x)dx
=Zb
a
[f(x0)L0(x) + · · · +f(x4)L4(x)]dx
=C0f(x0) + · · · +C4f(x4)
where Ci=Rb
aLi(x)dx. These integrals are easily evaluated (but it is very
tedious!), and you get Boole’s rule.
(b) B4(1/(1+x)) = (2/45)(1/4)(7+324/5+132/3+324/7+71/2)
.7006. This is just a little worse than M2(1/(1 + x)) from problem 8.
1

Partial preview of the text

Download Math 128A Homework 5: Integration Techniques & Error Analysis and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Math 128A, Spring 2007

Homework 5 Solution

5.2.8 (a) I(f ) =

∫ (^) b a f^ (x)dx^ ≈^

∫ (^) b a f^ ((a^ +^ b)/2)dx^ = (b^ −^ a)f^ ((a^ +^ b)/2) =^ M^1 (f^ ). (b) If we subdivide [a, b] into n subintervals a = x 0 < x 1 < · · · < xn = b with xi+1 = xi + h and apply M 1 to each subinterval, we get

I(f ) =

∫ (^) b

a

f (x)dx

∫ (^) x 1

x 0

f (x)dx + · · · +

∫ (^) xn

xn− 1

f (x)dx

≈ (x 1 − x 0 )f ((x 0 + x 1 )/2) + · · · + (xn − xn− 1 )f ((xn− 1 + xn)/2) = hf (a + h/2) + · · · + hf (a + (n − 1 /2)h)

(c) M 1 (1/(1 + x)) = 2/ 3 ≈ .6667 and M 2 (1/(1 + x)) = 2/5 + 2/ 7 ≈ .6857, while I = log 2 ≈ .6931.

5.2.10 (a) Following the derivation of Simpson’s rule,

I(f ) =

∫ (^) b

a

f (x)dx

∫ (^) b

a

P 4 (x)dx

∫ (^) b

a

[f (x 0 )L 0 (x) + · · · + f (x 4 )L 4 (x)]dx

= C 0 f (x 0 ) + · · · + C 4 f (x 4 )

where Ci =

∫ (^) b a Li(x)dx. These integrals are easily evaluated (but it is very tedious!), and you get Boole’s rule. (b) B 4 (1/(1+x)) = (2/45)∗(1/4)∗(7+32∗ 4 /5+13∗ 2 /3+32∗ 4 /7+7∗ 1 /2) ≈ .7006. This is just a little worse than M 2 (1/(1 + x)) from problem 8.