Docsity

Numerical Analysis I Problem Set, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
CAAM 453 ·NUMERICAL ANALYSIS I
Problem Set 5
Posted Sunday 4 November 2007. Due Wednesday, 14 November 2007.
General note: It is acceptable to use Mathematica, Maple, or MATLAB’s Symbolic Toolbox to evaluate the
occasionally tedious integrals on this problem set. If you do so, please include your output to demonstrate
how you calculated these integrals.
1. [20 points]
Consider approximations to √xfor x∈[0,1].
(a) Find the line that best approximates √xin the minimax (L∞) sense, and report the error.
Hint: Consider the oscillation theorem, and the derivative of the error at its extreme points.
[Kincaid & Cheney]
(b) Find the line that best approximates √xin the least-square (L2) sense, and report the error.
(c) For a general interval [a, b], prove that for all f∈C[a, b],
min
p∈Pnkf−pkL2≤√b−amin
p∈Pnkf−pkL∞.
Confirm that your solutions to (a) and (b) are consistent with this bound.
(d) Let [a, b] be any fixed interval. Given any ε > 0, show that there exists some f∈C[a, b] such that
kfkL2≤ε, while kfkL∞≥1/ε.
[S¨uli and Mayers, problem 8.1]
2. [10 points]
Show that Simpson’s rule is exact for all cubic polynomials.
(Hint: use linearity of the quadrature rule. It is not sufficient to simply invoke the error bound for
Simpson’s rule, as we relied on the fact that Simpson’s rule is exact for cubics to derive that bound!)
3. [20 points]
Let hf, gidenote a weighted inner product on L2(a, b), e.g., hf , gi=Rb
af(x)g(x)w(x) dxfor some
appropriate weight function w.
(a) Suppose {ψj}n
j=0 is a system of monic orthogonal polynomials, and let
ψn+1(x) = x ψn(x)−
n
X
j=0
cn,jψj(x)
denote the next polynomial in this system. For n≥1, show that we can write
ψn+1(x) = x ψn(x)−αnψn(x)−βnψn−1(x),
where αnand βnare constants that you should specify. (This was done in class, but the result is
sufficiently important that you should work through the details for yourself.)
pf3
pf4
pf5

Partial preview of the text

Download Numerical Analysis I Problem Set and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

CAAM 453 · NUMERICAL ANALYSIS I

Problem Set 5

Posted Sunday 4 November 2007. Due Wednesday, 14 November 2007.

General note: It is acceptable to use Mathematica, Maple, or MATLAB’s Symbolic Toolbox to evaluate the occasionally tedious integrals on this problem set. If you do so, please include your output to demonstrate how you calculated these integrals.

  1. [20 points] Consider approximations to

x for x ∈ [0, 1].

(a) Find the line that best approximates

x in the minimax (L∞) sense, and report the error. Hint: Consider the oscillation theorem, and the derivative of the error at its extreme points. [Kincaid & Cheney]

(b) Find the line that best approximates

x in the least-square (L^2 ) sense, and report the error.

(c) For a general interval [a, b], prove that for all f ∈ C[a, b],

min p∈Pn ‖f − p‖L 2 ≤

b − a min p∈Pn ‖f − p‖L∞^.

Confirm that your solutions to (a) and (b) are consistent with this bound.

(d) Let [a, b] be any fixed interval. Given any ε > 0, show that there exists some f ∈ C[a, b] such that ‖f ‖L 2 ≤ ε, while ‖f ‖L∞ ≥ 1 /ε. [S¨uli and Mayers, problem 8.1]

  1. [10 points] Show that Simpson’s rule is exact for all cubic polynomials. (Hint: use linearity of the quadrature rule. It is not sufficient to simply invoke the error bound for Simpson’s rule, as we relied on the fact that Simpson’s rule is exact for cubics to derive that bound!)
  2. [20 points] Let 〈f, g〉 denote a weighted inner product on L^2 (a, b), e.g., 〈f, g〉 =

∫ (^) b a f^ (x)g(x)w(x) dx^ for some appropriate weight function w.

(a) Suppose {ψj }nj=0 is a system of monic orthogonal polynomials, and let

ψn+1(x) = x ψn(x) −

∑^ n

j=

cn,j ψj (x)

denote the next polynomial in this system. For n ≥ 1, show that we can write

ψn+1(x) = x ψn(x) − αnψn(x) − βnψn− 1 (x),

where αn and βn are constants that you should specify. (This was done in class, but the result is sufficiently important that you should work through the details for yourself.)

(b) Consider the matrix and vector

J =

α 0

β 1 √ β 1 α 1

β 2 √ β 2

. (^) αn− 1

βn √ βn αn

, v(x) =

ψ 0 (x) ψ 1 (x)/

β 1 ψ 2 (x)/

β 1 β 2 .. . ψn(x)/

β 1 · · · βn

(For n ≥ 1, αn and βn are as in part (a); α 0 is defined by ψ 1 (x) = xψ 0 (x) − α 0 ψ 0 (x).)

Verify that (λ, v(λ)) is an eigenpair of J if and only if λ is a root of ψn+1.

N.B. This observation provides a way to compute Gaussian quadrature nodes.

  1. [20 points]

The gamma function is defined as Γ(x) =

0

tx−^1 e−t^ dt.

(a) Use the composite Simpson’s rule to evaluate Γ(5), Γ(10), and Γ(.5) to five digits of accuracy. You may use MATLAB’s built-in gamma function to verify your answer. Please report the number of integrand evaluations required. In particular, show how to reliably compute Γ(.5) using fewer than 1000 function evaluations.

Now, repeat your computations using the 8-point Gauss–Laguerre quadrature rule. (This Gaussian quadrature rule has nodes at the roots of the degree-8 Laguerre polynomial, an orthogonal polynomial over [0, ∞) with respect to the weight function w(x) = e−x.)

(b) Find the necessary quadrature nodes and weights in a mathematical table, or by searching on the web, or by computing them yourself via either the method in the previous problem or symbolic packages such as Mathematica or Maple. Please cite your source for this data.

(c) Compute Γ(5), Γ(10), and Γ(.5) using this 8-point Gauss–Laguerre rule. Each of these integrals will only require eight f (t) evaluations.

(d) How does the accuracy of Gauss–Laguerre quadrature compare to that obtained by the composite Simpson’s rule? Give pros and cons of each method.

S1. Compute

lim ε→ 0

ε

x−^1 cos(x−^1 log x) dx

to as many digits as possible. [Trefethen]

S2. The three-eighths rule is a 4-point interpolatory quadrature method that exactly integrates cubic polynomials. It is defined by the formula

I(f ) =

3 h 8

(f (a) + 3f (a + h) + 3f (a + 2h) + f (b)),

where h = (b − a)/3. Apply the Peano Kernel Theorem to show that there exists ξ ∈ [a, b] such that

E(f ) ≡

∫ (^) b

a

f (x) dx − I(f ) = −

h^5 f (4)(ξ).

S3. You may use the following facts without proof: For positive integers N and n,

∑^ N

k=

sin

( (^2) πnk N

and ∑N

k=

cos

( (^2) πnk N

N if n/N is an integer; 0 otherwise.

(a) Write down the composite trapezoid rule for approximating ∫ (^) b

a

f (x) dx

with function evaluations at xk = a + kh for h = (b − a)/N and k = 0,... , N.

(b) Suppose we wish to approximate ∫ (^2) π

0

f (x) dx,

where f is a 2π-periodic function (that is, f (x) = f (x + 2π) for all x ∈ R). Show that in this case the composite trapezoid rule reduces to

2 π N

∑^ N

k=

f

( (^2) πk N

For the rest of the problem, suppose f is a 2π-periodic function with Fourier series

f (x) = c 0 √ 2 π

∑^ ∞

n=

c−n

π

cos(nx) +

∑^ ∞

n=

cn

π

sin(nx)

for constants c 0 , c− 1 , c 1 ,....

(c) Integrate each term of this Fourier series to obtain a simple formula for

∫ (^2) π 0 f^ (x) dx.

(d) Write down a descriptive bound for the difference between the true integral found in part (c) and the approximation obtained from the composite trapezoid rule applied to the function f with the above Fourier series.

(e) If f and its first p derivatives are continuous and 2π-periodic, then there exists a constant γ such that |c|n|| ≤ γ/|n|p^ for all integers n. Compare the performance of the composite trapezoid rule applied to such an f with the usual composite trapezoid error bound that holds for functions that are in C^2 , but not necessarily 2π-periodic.