Midterm MATH 5610 (6860)

advertisement
Midterm
MATH 5610 (6860)
For each problem, show your work. Your answers must be clear and follow a logical progression.
Read the questions carefully. You do not need to compute decimal expansions of your answers. For
23
example sin(8) and 331
are very good answers.
Each problem is worth 15 points. Answer 7 problems for a total of 105 points. If you answer all
8, you can not score more than 105 points.
1. Find the root of f (x) = ex + x using one iteration of (A) Newton’s Method and (B) fixed point
iteration. (C) Justify your initial approximation.
(A) f 0 (x) = ex + 1. Let x0 = −1. Then using Newton’s Method
x1 = x0 −
f (x0 )
e−1 − 1
−(e−1 + 1) − (e−1 − 1)
−2e−1
=
−1
−
=
=
.
f 0 (x0 )
e−1 + 1
e−1 + 1
e−1 + 1
2
So x1 = − 1+e
is the approximation.
(B) Let x0 = −1. We know that f (x) = 0 ⇔ x = −ex so we perform fixed point iteration with
the function g(x) = −ex :
1
x1 = g(x0 ) = −e−1 = − .
e
(C) It is easy to check that f (0) = 1 > 0 and f (−1) = 1e − 1 < 0. Since f is continuous on
[−1, 0], the root must lie in (−1, 0). Since |f (−1) − 0| = 1e < 1 = |f (0) − 0|, I chose the endpoint
that is the better approximation to the root.
(If instead, you bisect this interval then x0 = −.5 and (A) x1 = − 2+23√e and (B) x1 = − √1e .
Both are better respective approximations of the actual root.)
1
. Show that for any initial approximation, p0 , in the interval [ 14 , 1], the sequence
2. Let g(x) = x+2
generated by pn+1 = g(pn ) will converge to a fixed point of f .
By the Fixed Point Theorem, I must show that for all x ∈ [ 14 , 1], g(x) ∈ [ 41 , 1] and that g 0 (x)
exists on [ 41 , 1] with |g 0 (x)| ≤ k < 1 for all x ∈ ( 41 , 1).
1
−1
1
(i) g 0 (x) = (x+2)
Therefore, g is monotonically
2 exists on ( 4 , 1) and is negative on [ 4 , 1].
decreasing on [ 41 , 1]. Since g(1) =
(ii) Let h(x) = |g 0 (x)| =
1
3
1
.
(x+2)2
>
1
4
and g( 14 ) =
Then h0 (x) =
4
9
< 1, then g(x) ∈ [ 14 , 1] for all x ∈ [ 14 , 1].
−2
(x+2)3
< 0 on [ 41 , 1]. Since h is monotonically
decreasing on [ 14 , 1], we have
0 g (x) = h(x) ≤ h
1
=
4
1
16
=
< 1.
2
9
81
4
16
So let k = 81
.
Thus, by the Fixed Point Theorem, for any p0 ∈ [ 14 , 1], the sequence pn+1 = g(pn ) converges to
a unique fixed point p = g(p) ∈ [ 14 , 1].
1
Midterm
MATH 5610 (6860)
3. Suppose the sequence pn converges to p of order α with asymptotic error constant λ > 0. Prove
that for all β < α, pn converges to p of order β and determine the appropriate asymptotic error
constant.
Since pn → p of order α with asymptotic error constant λ, then
lim
n→∞
|pn+1 − p|
= λ.
|pn − p|α
Let β < α. Then α − β > 0 and since pn → p, we have that limn→∞ |pn − p|α−β = 0. Therefore,
lim
n→∞
|pn+1 − p|
|pn − p|
β
= lim
|pn+1 − p|
|pn − p|α |pn − p|β−α
!
|pn+1 − p|
1
= lim
lim
α
n→∞ |pn − p|
n→∞ |p − p|β−α
n
= λ lim |pn − p|α−β
n→∞
n→∞
= λ (0)
= 0.
Hence, pn → p of order β with asymptotic error constant 0.
4. Suppose f (x) ∈ C 3 [0, 2] and that f (3) (x) ≤ 3 for all x ∈ [0, 2]. Also suppose f (.5) = 1,
f (1) = 2, and f (1.25) = 4.
(A) Determine the Langrange polynomial that interpolates f at the points x0 = .5, x1 = 1, and
x2 = 1.25.
(B) Determine the best upper bound on the error when you approximate f (.75) with your Lagrange
polynomial.
(A)
(B)
(x − 1)(x − 1.25)
(x − .5)(x − 1.25)
(x − .5)(x − 1)
+2
+4
(−.5)(−.75)
(.5)(−.25)
(.75)(.25)
2
= 8x − 10x + 4.
P2 (x) = 1
1
f (3) (ξ)
|f (x) − P2 (x)| = (x − .5)(x − 1)(x − 1.25) ≤ |(x − .5)(x − 1)(x − 1.25)|
3!
2
with the last inequality coming from the bound given in the problem. Therefore, we have
1
1
1
|f (.75) − P2 (.75)| ≤ (.25)(.25)(.5) =
= .
2
2·4·4·2
64
2
Midterm
MATH 5610 (6860)
5. Suppose H(x) is the Hermite polynomial determined from the following data:
x
1
1.3
1.5
1.8
2
f (x)
1
2.3
3.8
2.4
3
f 0 (x)
.5
1.5
-.5
.75
2
(A) What is the maximum degree of H(x)?
(B) What are the values H(1.8) and H 0 (1.3)?
(C) If f ∈ C ∞ [1, 2], what is |f (x) − H(x)| for any x ∈ (1, 2)?
(A) A Hermite polynomial interpolating n + 1 nodes has degree at most 2n + 1 so the degree of
H is at most 2(4) + 1 = 9.
(B) Hermite polynomials agree with f and f 0 at each of the nodes. Thus, H(1.8) = f (1.8) = 2.4
and H 0 (1.3) = f 0 (1.3) = 1.5.
(C) For all x ∈ (1, 2), the error bound is
(10) f
(ξ)
|f (x) − H(x)| =
(x − 1)2 (x − 1.3)2 (x − 1.5)2 (x − 1.8)2 (x − 2)2
10!
where ξ = ξ(x) ∈ (1, 2).
6. Suppose g is a function defined on [a, b] and a = x0 < x1 < x2 < · · · < xn = b is a set of nodes
in [a, b]. Describe the properties of the clamped cubic spline interpolant of g. What is the main
advantage of cubic spline interpolation?
The clamped cubic spline, S(x), is a piecewise cubic polynomial interpolating g at the nodes
and satisfying the following conditions:
(a) S(x) = Si (x) on [xi , xi+1 ] for i = 0, . . . , n − 1 where Si (x) is a cubic polynomial;
(b) Si (xi ) = f (xi ) and Si (xi+1 ) = f (xi+1 ) for i = 0, . . . , n − 1;
(c) Si (xi+1 ) = Si+1 (xi+1 ) for i = 0, . . . , n − 2;
0 (x
(d) Si0 (xi+1 ) = Si+1
i+1 ) for i = 0, . . . , n − 2;
00
00
(e) Si (xi+1 ) = Si+1 (xi+1 ) for i = 0, . . . , n − 2;
(f) S 0 (x0 ) = f 0 (x0 ) and S 0 (xn ) = f 0 (xn ).
The main advantage of a cubic spline interpolating polynomial is that S ∈ C 2 [a, b] so it is a
smooth function. In fact, we saw in class that S satisfies a minimal curvature condition with respect
to the curvature of f .
3
Midterm
MATH 5610 (6860)
7. (A) Suppose M is an upper bound on the second derivative of the function f on the interval [a, b].
Let f˜(x) be your computer approximation to the function f where roundoff error only guarantees
that f (x) − f˜(x) < . Then the error term for the forward difference formula for approximating
h
f 0 (x), x ∈ [a, b], is bounded above by 2
h + 2 M . Using this bound, find the optimal step size, h, for
the forward difference formula to approximate f 0 (x).
(B) If f (x) = x3 + x, use a 3-point formula with h = .5 to approximate f 0 (1.5).
h
(A) This error bound depends on the step size h: e(h) = 2
h + 2 M . So the optimal step size
will minimize this error. We use basic calculus to find the minimizer of e:
e0 (h) =
−2 M
+
=0
h2
2
2
M
=
h2
2
⇔
⇔
h2 =
4
.
M
p
p
So h = ±2 /M are the critical points. Since e00 (h) = h43 > 0 when h > 0, then h = 2 /M is
p
the minimizer of e(h). Thus the optimal step size is h = 2 /M .
(B) The centered 3-point formula for approximating a derivative is
f 0 (x) ≈
1
[f (x + h) − f (x − h)] .
2h
So with f (x) = x3 + x and h = .5, we have
f 0 (1.5) ≈
1
[(8 + 2) − (1 + 1)] = 8.
2(.5)
4
Midterm
MATH 5610 (6860)
8. (A) Use Simpson’s method (not Composite Simpson’s, just Simpson’s) to approximate
2
Z
0
x−1
dx.
x3 + 1
(B) Find the minimum n required for Composite Simpson’s method to approximate the following
integral with error less than .01:
Z
2
ln(x)dx.
1
You may use that f (x) = ln(x) then f (4) (x) ≤ 6 on [1, 2].
(A) Simpson’s Method is
Z
0
2
Rb
a
f (x)dx ≈
h
3
[f (a) + 4f (a + h) + f (b)] where h =
b−a
2 .
Thus,
x−1
1
1
9 1
8
1 −1
0
+
=
− +
=− .
dx ≈
+4
3
x +1
3 1
2
9
3
9 9
27
(B) In Composite Simpson’s method, h =
b−a
n
and the absolute error term is
b − a 4 (4) (b − a)5 1 (4) h f (ξ) =
f (ξ) .
180
180 n4
With f (x) = ln(x), then f (4) (x) ≤ 6 on [1, 2]. For this integral, b − a = 1. Therefore, we must
find n so that
1
1 1
6 < .01 =
.
180 n4
100
Solving for n we have
r
1
3
10
4 10
4
<
⇔
n >
⇔
n>
.
4
n
10
3
3
q
q
√
4 10
We know 2 = 4 > 10
>
3
3 . Then n = 2 is sufficient since we need the smallest even integer
q
n satisfying n > 4 10
3 .
5
Download