



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Answers to PS1 for Math 128A (UC Berkeley)
Typology: Exercises
1 / 6
This page cannot be seen from the preview
Don't miss anything!




Let f (x) = x
3 − 2 x
2 − 4 x + 2. We have f (−2) = − 6 , f (−1) = 3, f (1) = − 3 , and f (4) = 18. Since
f is a polynomial, it is necessarily continuous on R. By the Intermediate Value Theorem, there
exist x 1 ∈ [− 2 , −1], x 2 ∈ [− 1 , 1], and x 3 ∈ [1, 4] such that f (x 1 ) = f (x 2 ) = f (x 3 ) = 0.
Let f (x) = x
3
2
2 3
− 0. 0851 , and f (0) = 1. 101. Since f is a polynomial, it is necessarily continuous on R. By the
Intermediate Value Theorem, there exist x 1 ∈ [− 3 , −2], x 2 ∈ [− 2 , −
2 3 ], and x 3 ∈ [−
2 3 , 0] such that
f (x 1 ) = f (x 2 ) = f (x 3 ) = 0.
Let f (x) = 1 + e
− cos(x−1)
. f is always positive, so |f | = f. Since f is continuous on [1, 2], it has
a maximum and a minimum value on this interval. f either attains these values at the endpoints
of [1, 2] or at a critical point. The derivative of f is f
′ (x) = sin(x − 1)e
− cos(x−1)
. f
′ (x) is zero
at a single point on the interval [1, 2], namely, x = 1. We have f (1) ≈ 1. 368 and f (2) ≈ 1. 583 ,
so the maximum and minimum values of f on [1, 2] are f (1) = 1 + e − 1 and f (2) = 1 + e − cos 1 ,
respectively.
We will proceed by contradiction. Let f ∈ C[a, b] with f
′ (x) 6 = 0 for all x ∈ [a, b], and suppose
there are x 1 , x 2 ∈ [a, b] (x 1 < x 2 ) such that f (x 1 ) = f (x 2 ) = 0. By the Mean Value Theorem,
there exists x 3 ∈ (x 1 , x 2 ) such that
f
′ (x 3 ) =
f (x 2 ) − f (x 1 )
x 2 − x 1
contradiction. We conclude that there exists at most one x ∈ [a, b] such that f (x) = 0.
The Maclaurin series for f (x) = sin x is
sin x =
∞ ∑
k=
k
(2k + 1)!
x
2 k+ .
By Taylor’s Theorem, we have
sin x = x −
cos(ξ(x))
x
3 ,
where ξ(x) is between 0 and x. The absolute error involved in using sin x ≈ x for x = 1
π 180
is
bounded by ∣ ∣ ∣ sin
π
π
π
− 7 .
(a) Let f (x) = e
−x 2
. In general,
f
(n) (0) =
0 if n = 2k + 1
k n! k!
if n = 2k
The Maclaurin series for f is thus
e
−x 2 =
∞ ∑
k=
k
k!
x
2 k
. (1)
We integrate (1) term by term to obtain an expression for erf(x):
erf(x) =
π
x
0
∞ ∑
k=
k
k!
x
2 k dx =
π
∞ ∑
k=
k
k!(2k + 1)
x
2 k+
. (2)
(b) We are given that
erf(x) =
π
e
−x 2
∞ ∑
k=
k
1 · 3 · 5 · · · (2k + 1)
x
2 k+
. (3)
Using the Maclaurin series for f , we rewrite (3) as
erf(x) =
π
k=
k
k!
x
2 k
k=
k
1 · 3 · 5 · · · (2k + 1)
x
2 k+
We verify that the x
3 , x
5 , x
7 , and x
9 terms in (2) and (4) agree. The x
3 term in (2) is − √^2 π
x 3
3
and the x
3 term in (4) is
2 √ π
(−x
3
2 x 3
3
2 √ π
x 3
3
. The x
5 term in (2) is
2 √ π
x 5
10
, and the x
5
term in (4) is √^2 π
x 5
2
2 x 5
3
4 x 5
15
√^2 π
x 5
10
. The x
7 term in (2) is − √^2 π
x 7
42 , and the x
7 term in
(4) is
2 √ π
x 7
6
x 7
3
4 x 7
15
8 x 7
105
2 √ π
x 7
42
. The x 9 term in (2) in
2 √ π
x 9
216
, and the x 9 term in
(4) is
2 √ π
x 9
24
x 9
9
2 x 9
15
8 x 9
105
16 x 9
945
2 √ π
x 9
216
(c) By the Alternating Series Theorem,
∣erf(1) −
π
n ∑
k=
k
k!(2k + 1)
π
n!(2n + 1)
We wish to approximate erf(1) to within 10
− 7 , so the right-hand side must be less than 10
− 7 .
This condition is satisfied if n = 10, so we will approximate erf(1) using the first 11 terms of
(2). Evaluation in MATLAB yields erf(1) ≈ 0. 8427007941.
(d) Estimating erf(1) using the first 11 terms of (3) yields erf(1) ≈ 0. 7527684737.
(e) Because of the 2 k term in the numerator of (3), its terms tend to 0 more slowly than those of
(2). Therefore, an accurate approximation of erf(1) using (3) requires more terms than (2).
Let p
∗ be an approximation for
∗ and
2 is less than or equal
to 10
− 4 , then
|
2 − p
∗ | √ 2
− 4 .
The largest interval in which p
∗ must lie in is thus [
− 4 ),
− 4 )]. Using
seven-digit rounding arithmetic, this interval is [1. 414073 , 1 .414355].
Otherwise, dk+1 > 5 , and f l(y) = 0.d 1 d 2... dk × 10
n
n−k
. Therefore,
y − f l(y)
y
0 .d 1 d 2... dkdk+1... × 10
n − 0 .d 1 d 2... dk × 10
n − 10
n−k
0 .d 1 d 2... dkdk+1... × 10 n
0 .dk+1dk+2... × 10
n−k − 10
n−k
0 .d 1 d 2... dkdk+1... × 10 n
0 .dk+1dk+2... − 1
0 .d 1 d 2... dkdk+...
−k
−k
−k+ .
Evaluating the Taylor series approximation of e using four-digit chopping arithmetic yields
e ≈
10 ∑
k=
k!
The absolute error is
|e − 2. 716 | ≈ 0. 0022818285 ,
and the relative error is ∣ ∣ ∣
e − 2. 716
e
− 4 .
(a) The number of multiplications required is equal to the total number of terms in the sum. There
are 1+2+· · ·+n = 1 2
n(n+1) terms, so 1 2
n(n+1) multiplications are required. Since the number
of additions required is one less than the number of multiplications required, 1 2
n(n + 1) − 1
additions are required. The total number of computations required is n 2
(b) We can rewrite the sum as
b 1
( (^) ∑n
i=
ai
( (^) ∑n
i=
ai
n ∑
i=
bi
( (^) ∑n
j=i
ai
The number of additions required is
1 2 n(n − 1) + (n − 1), and the number of multiplications
required is n. The total number of computations required is
1 2 n
2
3 2 n − 1 , less than in part
(a) for all n > 1 (both sums require one computation when n = 1).
(a) By definition,
|F 1 (x) − L 1 | ≤ K 1 |x
α | and |F 2 (x) − L 2 | ≤ K 2 |x
β |,
for sufficiently small x and K 1 , K 2 ∈ R. By the triangle inequality,
|F (x) − (c 1 L 1 + c 1 L 2 )| = |c 1 F 1 (x) + c 2 F 2 (x) − c 1 L 1 − c 2 L 2 |
≤ c 1 |F 1 (x) − L 1 | + c 2 |F 2 (x) − L 2 |
≤ c 1 K 1 |x
α | + c 2 K 2 |x
β |
≤ (c 1 K 1 + c 2 K 2 )|x
γ |.
Letting K = c 1 K 1 + c 2 K 2 , we have
|F (x) − (c 1 L 1 + c 1 L 2 )| ≤ K|x
γ |.
It follows that F (x) = c 1 L 1 + c 1 L 2 + O(x γ ).
(b) Using the triangle inequality once more, we have
|G(x) − (L 1 + L 2 )| = |F (c 1 x) + F (c 2 x) − L 1 − L 2 |
≤ |F (c 1 x) − L 1 | + |F (c 2 x) − L 2 |
≤ K 1 |(c 1 x)
α | + K 2 |(c 2 x)
β |
≤ (K 1 |c
α 1 |^ +^ K^2 |c
β 2 |)|x
γ |.
Letting K = K 1 |c
α 1 |^ +^ K^2 |c
β 2 |, we have
|G(x) − (L 1 + L 2 )| ≤ K|x
γ |.
It follows that G(x) = L 1 + L 2 + O(x
γ ).
The sequence 〈Fn〉 is recursively defined by Fn+2 = Fn+1 + Fn. Dividing through by Fn+1 and
simplifying, we obtain xnxn+1 = 1 + xn. Assuming limn→∞ xn = x exists, we have x 2 = 1 + x by
the properties of limits. This quadratic equation has solutions
x =
Clearly, 〈xn〉 cannot converge to the negative root since its terms are only positive. Therefore,
lim n→∞
xn =
We wish to know how many steps of the Bisection Algorithm to apply to ensure that our estimates
are within 10 − 5 of the true value. By Theorem 2.1, we have
|p − pn| ≤
b − a
n
− 5
Solving for n with a = 0 and b = 0. 5 , we obtain n ≈ 15. 61 , so we apply the algorithm 16 times to
get p 1 ≈ 0. 2060317993164062 and p 2 ≈ 0. 6819686889648438. I have included the MATLAB code
for the Bisection Algorithm at the end of this assignment.
(a) Graphs of f (x) = x and g(x) = tan x are included at the end of this assignment.
(b) We will use the Bisection Algorithm to solve x − tan x = 0 on the interval [4, 5]. To ensure
that our estimate is within 10
− 5 of the actual value, we perform 17 iterations of the algorithm
to get x ≈ 4. 493415832519531.
(a) The Bisection Algorithm converges to 0 on this interval.
(b) The Bisection Algorithm converges to 0 on this interval.
(c) The Bisection Algorithm converges to 2 on this interval.
(d) The Bisection Algorithm converges to − 2 on this interval.