MTH 451 Quiz 1
1. Write the Taylor series for f (x + h), center at x, up to and including h4 term. Answer:
f (x + h) = f (x) + f ′ (x)h + f ′′ (x) h2 + f ′′′ (x) h3 + f iv (x) h4 + · · · 2 6 24
2. Write the Taylor series for f (x − h), center at x, up to and including h4 term. Answer:
f (x − h) = f (x) − f ′ (x)h + f ′′ (x) h2 − f ′′′ (x) h3 + f iv (x) h4 + · · · 2 6 24
Name:
3. Add the above series and solve for f′′(x). Answer:
f (x + h) + f (x − h) = 2f (x) + f ′′ (x) h2 + f iv (x) h4 + · · ·
12
f ′′ (x) = f (x + h) + f (x − h) − 2f (x) − f iv (x) h2 + · · ·
h2 12
4. Write the Taylor series for f (x + 2h), center at x, up to and including h4 term. Answer:
f (x + 2h) = f (x) + 2f ′ (x)h + 2f ′′ (x) h2 + 4f ′′′ (x) h3 + 2f iv (x) h4 + · · · 33
5. Make a linear combination of series 1 and series 4 to eliminate f′(x). Solve for f′′(x). Answer: Multiplying 1 by -2 and adding it to 4 gives
f (x + 2h) − 2f (x + h) = −f (x) + f ′′ (x) h2 + f ′′′ (x) h3 + 7f iv (x) h4 + · · · 12
f ′′ (x) = f (x + 2h) + f (x) − 2f (x + h) − f ′′′ (x)h − 7f iv (x) h2 + · · · h2 12
The error term in Simpson’s rule can be established by using the Taylor series from §1.2:
f(a+h)=f +hf′ + 1h2f′′ + 1h3f′′′ + 1h4f(4) +··· 2! 3! 4!
where the functions f , f ′, f ′′, . . . on the righthand side are evaluated at a.
Now replacing h by 2h, we have
′ 2 ′′ 4 3 ′′′ 24 4 (4)
f(a+2h)=f+2hf +2hf +3hf +4!hf +···
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §5.3 15 / 51
Using these two series, we obtain
f (a)+4f (a+h)+f (a+2h) = 6f +6hf ′+4h2f ′′+2h3f ′′′+20h4f (4)+··· 4!
Thereby, we have
h3[f (a) + 4f (a + h) + f (a + 2h)] = 2hf + 2h2f ′ + 34h3f ′′
+2h4f′′′+ 20 h5f(4)+···
3 3·4!
Hence, we have a series for the righthand side of (1). Now let’s find one for the left-hand side.
The Taylor series for F (a + 2h) is
(4)
F(a + 2h) = F(a) + 2hF′(a) + 2h2F′′(a) + 43h3F′′′(a) 2 4 (4) 25 5 (5)
+3hF (a)+5!hF (a)+··· Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §5.3
16 / 51
Let
Zx
F (x ) =
By the Fundamental Theorem of Calculus, F ′ = f .
We observe that F(a) = 0 and F(a + 2h) is the integral on the left-hand side of (1).
SinceF′′ =f′,F′′′ =f′′,andsoon,wehave
Z a+2h 4 2 25
f(x)dx =2hf+2h2f′+3h3f′′+3h4f′′′+5·4!h5f(4)+··· (5) Subtracting (2) from (3), we obtain
Za+2h h h5 (4)
a
f (t ) dt
a
a
f(x)dx = 3[f(a)+4f(a+h)+f(a+2h)]− 90f −···
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §5.3 17 / 51
Summary §3.1
For finding a zero r of a given continuous function f in an interval
[a, b], n steps of the bisection method produce a sequence of intervals [a, b] = [a0, b0], [a1, b1], [a2, b2], . . . , [an, bn] each containing the desired root of the function.
The midpoints of these intervals c0, c1, c2, . . . , cn form a sequence of approximations to the root, namely, ci = 21 (ai + bi ).
On each interval [ai , bi ], the error ei = r − ci obeys the inequality | e i | ≤ 21 ( b i − a i )
and after n steps we have
|en|≤ 1 (b0−a0)
2n+1
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §3.1
44 / 45
Summary §3.2
For finding a zero of a continuous and differentiable function f ,
Newton’s method is given by
xn+1 = xn − f (xn) (n ≥ 0)
f′(xn)
It requires a given initial value x0 and two function evaluations (for f
and f ′) per step.
The errors are related by
en+1 = −1?f ′′(ξn)?en2 2 f′(xn)
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §3.2 48 / 51
Summary §3.3
The secant method for finding a zero r of a function f (x) is written
as
xn+1 =xn −? xn −xn−1 ?f(xn) f (xn) − f (xn−1)
for n ≥ 1, which requires two initial values x0 and x1.
After the first step, only one new function evaluation per step is needed.
After n + 1 steps of the secant method, the error iterates ei = r − xi obey the equation
en+1 = −1?f ′′(ξn)?enen−1 2 f′(ζn)
which leads to the approximation
√
|en+1| ≈ C|en|(1+ 5 )/2 ≈ C|en|1.62
Therefore, the secant method has super-linear convergence
behavior.
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §3.3
37 / 37
Summary §4.1
The Lagrange form of the interpolation polynomial is
n
pn (x ) = X li (x )f (xi )
i=0
with cardinal polynomials
li (x ) = Yn ? x − xj ?
j̸=i xi −xj
j=0
that obey the Kronecker delta equation
(0 ≤ i ≤ n)
li(xj)=δij =
(0 ifi̸=j
1 ifi=j
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §4.1 108 / 112
The Newton form of the interpolation polynomial is
n i−1
pn (x ) = X ai Y(x − xj )
i=0 j=0
with divided differences
ai =f[x0,x1,...,xi]= f[x1,x2,...,xi]−f[x0,x1,...,xi−1]
xi −x0
These are two different forms of the unique polynomial p of degree n that interpolates a table of n + 1 pairs of points (xi , f (xi )) for
0 ≤ i ≤ n.
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §4.1 109 / 112
MTH 451 Quiz/Homework 3
x 0 1 2 -1 y 3 2 -3 6
Find the interpolating polynomial for the above table in 1. Lagrage form Answer:
p(x) = 3 (x − 1)(x − 2)(x + 1)+2 x(x − 2)(x + 1)−3 x(x − 1)(x + 1)+6 x(x − 1)(x − 2)
Name:
(−1)(−2)1 1(−1)2 2(1)3
2. Newton form Answer: Divided differences:
(−1)(−2)(−3)
x f[] 03
12
2-3 -1 6
f[,] f[,,] f[,,,] -1
The top entries give p(x) = 3 − 1x − 2x(x − 1) − 1x(x − 1)(x − 2).
-5
-3
-2 -1
-1
The basic trapezoid rule for the subinterval [xi , xi+1] is
Z xi+1
xi
where the error is
1
f(x)dx ≈Ai = 2(xi+1 −xi)[f(xi)+f(xi+1)]
− 1 (xi+1 − xi)3f ′′(ξi) 12
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §5.1 55 / 61
The composite trapezoid rule is
Z b n−1 f(x)dx ≈T(f;P)=XAi =
1 n−1
X(xi+1 −xi)[f(xi)+f(xi+1)]
a
where the error is
i=0
2 i=0
1 Xn
−12
Numerical Mathematics & Computing
i=1
(xi+1 −xi)2f′′(ξi)
Cheney & Kincaid (Cengage⃝c )
§5.1 56 / 61
For uniform spacing of nodes in the interval [a, b], we let xi = a + ih, where
h=(b−a)/n (0≤i ≤n)
The composite trapezoid rule with uniform spacing is
Zb h n−1 f(x)dx ≈T(f;P)= 2[f(x0)+f(xn)]+hXf(xi)
a i=1 where the error is
− 1 (b − a)h2f ′′(ζ) 12
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing
§5.1 57 / 61
For uniform spacing of nodes in the interval [a, b] with 2n subintervals, we let h = (b − a)/2n, and we have
R(0,0)= 12(b−a)[f(a)+f(b)]
R(n,0)=hXf(a+ih)+h2[f(a)+f(b)]
2n −1 i=1
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §5.1 58 / 61
Euler-Maclaurin Formula and Error Term Theorem 1
If f (2m) exists and is continuous on the interval [a, b], then
h n−1 X[f(xi)+f(xi+1)]+E
Z b a
f(x)dx = whereh=(b−a)/n,xi =a+ihfor0≤i≤n,and
2 i=0
E = X A2k h2k [f (2k−1)(a) − f (2k−1)(b)] − A2m(b − a)h2mf (2m)(ξ)
for some ξ in the interval (a, b).
m−1 k=1
Cheney & Kincaid (Cengage⃝c ) Numerical Mathematics & Computing §5.2
19 / 37