Real Analysis Problem Solution
Real Analysis Problem Solution
1 Integration/Differentiation
1.1 Gaussian Quadrature
1. Consider the formula:
Z 1 2
X
f (x)dx = Ai f (xi )
−1 i=0
(a) Find the Gaussian nodes and weights. Use the method of undetermined coeffi-
cients along with the fact that the nodes and weights are symmetric about the
center of the interval when the weight function w(x) is symmetric.
(b) Give the correct formula when it is rescaled for integration limits [-2,3].
2. Consider approximating the following integral with a three point quadrature rule
(Gauss-Hermite quadrature):
Z ∞
2
f (x)e−x dx = A0 f (x0 ) + A1 f (x1 ) + A2 f (x2 )
−∞
(a) Obtain equations that can be used to solve for the nodes and weights but do not
solve the equations and do not evaluate the integrals appearing in these equations.
(b) Use a change of variables to obtain an integrand with finite limits.
3. The Chebyshev polynomials are orthogonal on [-1,1] with respect to the weight function
(1 − x2 )−1/2 and the third Chebyshev polynomial is given by T3 (x) = 4x3 − 3x.
(a) Give the locations of the nodes.
(b) Give integrals that could be evaluated to obtain the estimates for the weights. Do
not evaluate the integrals.
(c) Assuming that A0 = 1, A1 = 4, A2 = 1, x0 = −1/2, x1 = 0, and x2 = 1/2 give a
R 1 sin(x)
formula that estimates the value of −1 (1−x 2 )3/4 .
4. Show that if a degree n polynomial is orthogonal to all second degree polynomials with
respect to a weight function w(x) on an interval [a,b] then quadrature using the zeros
of that polynomial will be exact for all polynomials of degree n + 2.
1
(a) Find a formula that can be used to obtain the first Richardson extrapolant when
we proceed by using nodal spacing h, h/5, h/25, ....
(b) Find a formula that can be used to obtain the second Richardson extrapolant
with the same nodal spacing strategy as before.
(c) Use this to fill in the table and obtain a more accurate estimate of the second
derivative. Do not simplify your answers
h Q(i, 0) Q(i, 1) Q(i, 2)
5 1 Nothing in this cell Nothing in this cell
1/5 26
2. Consider approximating a quantity Q using q(h) where the error has the form:
f 00 (a) − q(h) = a3 h3 + a4 h4 + a5 h5 + · · ·
(a) Give pseudocode in order to clearly outline an algorithm that can be used to
obtain successive Richardson extrapolants.
(b) If your algorithm works well, what is the expected order of accuracy for the k th
extrapolant?
(c) How do you expect your maximum obtainable accuracy to change when Q corre-
sponds to an integral, a value, a first derivative, and a second derivative?
3. Discussion
Its error, when used as a composite rule, takes on the following form:
ẽ = I − I˜ = a2 h2 + a4 h4 + · · ·
2
(a) Obtain an estimate for the error when using three equally spaced subintervals,
ẽ3 in terms of the integral estimate when using 1 interval, I˜1 , and the integral
estimate when using 3 equally spaced subintervals, I˜3 .
˜ What do expect the order of
(b) Use your answer to obtain a better estimate for I.
accuracy for this estimate to be?
2. Consider the two finite difference formulas:
f (a + h) − f (a − h) −5f (a + h) + 8f (a + 2h) − 3f (a + 3h)
q1 (h) = ≈ f 0 (a) ≈ = q2 (h)
2h 2h
They have the corresponding error estimates:
ẽ1 = f 0 (a) − q1 (h) = a2 h2 + a4 h4 + · · ·
ẽ2 = f 0 (a) − q2 (h) = 5a2 h2 + a3 h3 + · · ·
(a) Obtain an estimate for ẽ1 in terms of q1 (h) and q2 (h).
(b) Use this to obtain a better estimate for f 0 (a). What do you expect the order
of accuracy for this estimate to be? Be careful, what is the order of accuracy
associated with the error?
(c) Give pseudocode in order to clearly outline an algorithm that can be used to
perform “adaptive differentiation”. This code should use recursion.
(d) For your code, give a measure that you can take in order to avoid an infinite loop.
3. Consider using the midpoint rule. The formula for the error when using 1 and 2 (equal
sized) intervals can be derived to be equal to ẽ2 = (I˜2 − I˜1 )/3 (see problem 1 here).
Use
R 8 the following table to perform adaptive integration and obtain an estimate for
−8
f (x)dx that is accurate to within = your choice (choose so that you have to
refine some subintervals but not all of them). Do this as we did for the homework.
Ignore the relative error.
x f(x)
-7 0.02
-6 0.027
-5 0.038
-4 0.058
-3 0.1
-2 0.2
-1 0.5
0 1
1 0.5
2 0.2
3 0.1
4 0.058
5 0.038
6 0.027
7 0.02
3
4. Error/composite rules:
(a) Show that if the error for a quadrature rule (i.e. applied using only one interval)
is given by the formula
Z b
f (x)dx ≈ (b − a)k f (k−1) (ξ)
a
then the error when applying the in composite/as a composite quadrature rule is
given by:
Z b
f (x)dx ≈ (b − a)hk−1 f (k−1) (ξ)
a
ẽ = I − I˜ = a3 (b − a)3 + a5 (b − a)5 + · · ·
4
(a) A is the input and ~x is the output
(b) ~b is the input and ~x is the output
(c) ~x is the input and ~b is the output
3. Show that the matrix condition number is an upper bound for the condition number
for matrix multiplication using A on an input ~x to obtain an output ~b.
4. Discussion
(a) Discuss why Gaussian elimination with pivoting is preferred over Gaussian elim-
ination without pivoting.
(b) Give the definition of the matrix growth factor and explain its relationship to the
expected errors when solving A~x = ~b for ~x using Gaussian elimination.
(c) Explain why even though Gaussian elimination is backwards stable there are still
concerns over its performance in practice. If there are such concerns, why do
people still use it?
2.2 QR factorization
1. For the two matrices
2 0 3 6 0
A1 = 3 1 1 A2 = 2 2
6 3 2 9 2
(a) Find the QR factorization. For the latter find both the reduced and the full
factorization.
(b) Use that to find the solutions to A~x = ~b with ~b1 = [−3, −3, −1] and ~b2 =
[−8, −9, 11].
(c) Like Gauss elimination, classical gram-schmidt QR factorization can be viewed
as multiplication of A by a series of simple triangular matrices: Q = AR1 R2 · · · .
Give the three Rk matrices for the QR for A1 above.
(a) Give pseudocode in order to clearly outline an algorithm that can be used to
generate the QR factorization of an m × n matrix with linearly independent
columns.
(b) The operation count for square matrices when m is large is ≈ km3 . What is the
value of k?
(c) Is this algorithm stable? What is the name of the algorithm Matlab uses?
3. Assuming that A has linearly independent columns (and thus has an easily obtainable
QR factorization), show that solving the normal equations (matrix version) A∗ A~x =
A~b is equivalent to solving R~x = Q∗~b.
5
2.3 Norms/SVD
1. (Trefethen and Bau) Find the SVD for the following matrices (without finding any
eigenvalues or eigenvectors).
0 2
3 0 2 0 0 0 1 1 1 1
0 −2 0 3 0 0 1 1
0 0
2. (UA midterm) Given an orthonormal basis {~x1 , ~x2 , ~x3 } of C3 and an orthonormal basis
{~y1 , ~y2 , ~y3 , ~y4 } of C4 , write out a formula for the matrix A such that A~x1 = 2~y2 ,
A~x2 = −2~y3 , and A~x3 = 2~y4 .
√ √ √ √
3. Consider ~v1 = [1/ 2, −1/ 2]∗ and ~v1 = [1/ 2, −1/ 2]∗ . We find that A~v1 = [1, 2]∗
while A~v2 = [−4, 2]∗ . Find A by first finding the SVD. Draw a picture of the relation-
ship between vectors before and after application of A to a unit circle. Label the left
and right singular vectors and what the singular values correspond to.