Homework 4

Instructor: Emre Mengi
Math 304 (Spring 2012)
Study Guide for Weeks 7-10
This homework concerns the following topics.
• Fixed-Point Iteration for Systems of Nonlinear Equations (Burden&Faires-10.1)
• Newton’s Method for Systems of Nonlinear Equations (Burden&Faires-10.2, Mengi-Lect 14)
• Polynomial Interpolation (Burden&Faires-3.1, Mengi-Lect 17)
• Newton-Cotes for Numerical Integration (Burden&Faires-4.3, Mengi-Lect 18)
Homework 4 (due on April 30th, Monday by 5pm)
Please turn in the answers to the questions marked with (*) only. Questions 2, 5 and 7
require Matlab. Attach your Matlab outputs and routines for these questions.
1.(*) Find the linear approximations for the following functions about given points.
(a)

(x3 − 1)2 cos x1 + 2x1 − π
.
2x2
F (x1 , x2 , x3 ) = 
2(x3 − 1) sin x1

about (π/2, 1, 2)T
1/2
P
n
2
about x = [1 1 . . . 1]T (vector of ones).
(b) f (x) = kxk2 =
j=1 xj
(c)
F (x) =
x21 + (x2 − 2)2 − 1
(x1 + 1)2 + (x2 − 1)2 − 1
.
about x0 = (0, 1)
2.(*) (Burden&Faires 10.1.5) The nonlinear system
x21 − 10x1 + x22 + 8 = 0, x1 x22 + x1 − 10x2 + 8 = 0
can be transformed into the fixed-point problem
x1 = g1 (x1 , x2 ) =
x21 + x22 + 8
x1 x22 + x1 + 8
, x2 = g2 (x1 , x2 ) =
.
10
10
(a) Show that G(x) = (g1 (x), g2 (x)) has a unique fixed-point in
D = {(x1 , x2 ) | 0 ≤ x1 , x2 ≤ 1.5}
(b) Apply fixed-point iteration to approximate the solution.
3. (Burden&Faires 10.1.6) The nonlinear system
5x21 − x22 = 0, x2 − 0.25(sin x1 + cos x2 ) = 0
has a solution near (1/4, 1/4).
(a) Find a function G and a set D in R2 such that G has a unique fixed-point in D that
corresponds to the solution of the nonlinear system near (1/4, 1/4).
(b) Apply fixed-point iteration to the function G in part (a) to locate the solution near
(1/4, 1/4).
4. (*) Carry out one iteration of Newton’s method applied to F : R2 → R2
x1 + x2
F (x) =
(2x1 − 1)2 + (2x2 − 1)2 − 32
starting with the initial guess x0 = (1, −1).
5. (*) An eigenpair (v, λ) of a matrix A ∈ Rn×n satisfies (A − λI)v = 0 where v 6= 0.
Therefore an eigenvalue problem can be posed as a zero-finding problem.
Define an iteration of Newton’s method for a zero (which is a pair of eigenvalue and an
associated unit eigenvector) of the n + 1 equations
(A − λI)v = 0,
v T v = 1,
in the n + 1 unknowns (v, λ). Use the m-file Newton.m provided on the course webpage to
find an eigenvector and eigenvalue for the matrix




1/5
4 2 1
 −1/5 


A = 2 3 0  , starting at x0 = 
 4/5  .
1 0 1
1
6. Let F denote a Lipschitz continuously differentiable function F : Rn → Rn , that is there
exists a positive constant γ such that
kF 0 (x) − F 0 (y)k ≤ γkx − yk, for all x and y in Rn .
Let xk be a point in Rn . Show that for all x ∈ Rn the inequality
kF (x) − L(x)k ≤
γ
kx − xk k2 ,
2
holds where L(x) is the linear approximation of F (x) about xk .
7. (*) Modify the routine Newton.m so that it backtracks and halves the step-length unless
the current step causes a sufficient decrease in the function value. Use the sufficient decrease
condition
kF (xk )k − kF (xk + αk pk )k ≥ µ (kL(xk )k − kL(xk + αk pk )k)
discussed in class, where F is the function whose zero is sought, xk is the current estimate
for the root, pk is the Newton direction and L(x) is the linear approximation for F (x) about
xk .
Use your m-file to find a zero of the function
arctan(x1 ) − x2
.
F (x) = 1 2
x + e−x2 (x2 + 2) − 2
4 1
starting at x0 = (1, 0). Explain what happens when you apply Newton.m to the same
problem with the same starting point.
8. (Burden&Faires 10.2.14) An interesting biological experiment concerns the determination
of the maximum water temperature, XM , at which various species of hydra can survive
without shortened life expectancy. One approach to the solution of this problem uses a
weighted least squares fit of the form f (x) = y = a/(x − b)c to a collection of experimental
data. The x-values of the data refer to water temperature. The constant b is the asymptote
of the graph of f and as such is an approximation to XM .
It can be shown that choosing a, b and c to minimize
2
n X
a
wi yi −
(xi − b)c
i=1
reduces to solving the nonlinear system
a=
n
X
i=1
n
X
wi yi
1
/
,
(xi − b)c i=1 (xi − b)2c
n
n
n
n
X
X
X
X
wi yi
1
wi yi
1 2c
0=
·
−
·
,
c
2c+1
c+1
x
−
b)
(x
−
b)
(x
−
b)
x
−
b
i
i
i
i
i=1
i=1
i=1
i=1
0=
n
X
i=1
n
n
n
X
wi yi
ln(xi − b) X wi yi ln(xi − b) X
1
·
−
·
.
c
2c
c
(xi − b) i=1 (xi − b)
(xi − b)
(xi − b)2c
i=1
i=1
Solve the nonlinear system for the species with the data given below and by means of the
Newton’s method with backtracking from Question 7. Use the weights wi = ln yi .
i
xi
yi
1
2
3
4
31.8 31.5 31.2 30.2
2.40 3.80 4.75 21.60
9. On April 16th the ant population in the classroom SOS B21 at Koç University is measured
at various times (at various hours of the day) as listed below.
(0, 100), (5, 80), (10, 70), (20, 40)
Find the Lagrange polynomial of degree three interpolating these points. Use it to estimate
the ant population at 15:30.
10. (*) Consider the function f (x) = sin(x). Write down the Lagrange polynomial of degree
two interpolating f at nodes x0 = 0, x1 = π/6, x2 = π/4. Use your Lagrange polynomial to
estimate sin(0.5). Find an upper bound for the interpolation error.
11. Runge gave the function
f (x) =
1
,
1 + x2
x ∈ [−5, 5]
as an example for which the nth degree polynomial interpolating f at n + 1 equally-distant
nodes do not converge to f (x) as n → ∞.
In Matlab plot the graphs of f (x) and its Lagrange polynomials of degree 4, 8 and 12 on the
interval [−5, 5]. To plot these functions discretize the interval [−5, 5] such that the distance
between two consecutive points is fixed and equal to h = 0.05. In each case compute also
the largest interpolation error at these discrete points. Write down your observations.
12. (*) Estimate the integrals below using the trapezoidal rule and Simpson’s rule.
Z 1
Z e+1
1
3
dx
(ii)
e−x dx
(i)
x ln x
−1
e
Provide also the bounds for errors using the formulas derived or discussed in class. For (i)
you can exactly calculate the integral, how accurate are the error bounds for (i)?
13. (*) Consider the definite integrals
Z 1
Z
2
x + 2x + 7 dx and
−1
1
5x5 + 2x3 − x2 + x + 1 dx.
−1
Which of the quadrature formulas
(i) Trapezoidal rule
(ii) Simpson’s rule
(iii) Simpson’s three-eights rule (Newton-Cotes with n = 3)
would yield the exact value for each of these definite integrals? Answer the question without
evaluating definite integrals and quadrature formulas.
14. (*) Derive the Simpson’s three-eights rule (Newton-Cotes with n = 3), that is derive
Z
b
b−a
(f (x0 ) + 3f (x1 ) + 3f (x2 ) + f (x3 ))
8
f (x) dx ≈
a
where xk = a + k · (b − a)/3 for k = 0, 1, 2, 3.
15. (*) Consider the integral and the Simpson’s three-eights rule
Z
b
Z
f (x) dx
b
and
a
p3 (x) dx =
a
1
(f (x0 ) + 3f (x1 ) + 3f (x2 ) + f (x3 )) ,
8
respectively, where p3 (x) is the polynomial of degree three interpolating f (x) at the points
(xk , f (xk )) for k = 0, 1, 2, 3 and xk = a + k · (b − a)/3.
Show that the equality
Z b
Z
f (x)dx −
a
a
b
f (4) (µ) · 3((b − a)/3)5
p3 (x)dx = −
80
concerning the error of the Simpson’s three-eights rule holds for some µ ∈ (a, b).
16. Consider the ellipse
x2
y2
+
= 1.
β 2 α2
The surface area of the resulting ellipsoid obtained when the ellipse above is rotated about
the x-axis is given by the integral
Z β√
1 − K 2 x2 dx
4πα
0
where K 2 =
1
β2
q
1−
α2
.
β2
Estimate the surface area of the ellipsoid for
α=
q
√
(3 − 2 2)/100,
β = 10
using the Newton-Cotes formula with n = 4 given below.
Z b
b−a
f (x) dx ≈
(7f (x0 ) + 32f (x1 ) + 12f (x2 ) + 32f (x3 ) + 7f (x4 ))
90
a
where xk = a + k · (b − a)/4 for k = 0, 1, 2, 3, 4