Problem Set 1, Math 128A, Exercises of Mathematics

Answers to PS1 for Math 128A (UC Berkeley)

Typology: Exercises

2016/2017

Uploaded on 11/15/2017

romainlhardy
romainlhardy 🇺🇸

1 document

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 128A Problem Set 1
Romain Hardy
September 7, 2017
Exercise 1.1.2(c)
Let f(x) = x32x24x+ 2. We have f(2) = 6,f(1) = 3,f(1) = 3, and f(4) = 18. Since
fis a polynomial, it is necessarily continuous on R. By the Intermediate Value Theorem, there
exist x1[2,1],x2[1,1], and x3[1,4] such that f(x1) = f(x2) = f(x3) = 0.
Exercise 1.1.2(d)
Let f(x) = x3+ 4.001x2+ 4.002x+ 1.101. We have f(3) = 1.896,f(2) = 1.101,f(2
3) =
0.0851, and f(0) = 1.101. Since fis a p olynomial, it is necessarily continuous on R. By the
Intermediate Value Theorem, there exist x1[3,2],x2[2,2
3], and x3[2
3,0] such that
f(x1) = f(x2) = f(x3) = 0.
Exercise 1.1.4(d)
Let f(x) = 1 + ecos(x1).fis always positive, so |f|=f. Since fis continuous on [1,2], it has
a maximum and a minimum value on this interval. feither attains these values at the endpoints
of [1,2] or at a critical point. The derivative of fis f0(x) = sin(x1)ecos(x1).f0(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 fon [1,2] are f(1) = 1 + e1and f(2) = 1 + ecos1 ,
respectively.
Exercise 1.1.6
We will proceed by contradiction. Let fC[a, b]with f0(x)6= 0 for all x[a, b], and suppose
there are x1, x2[a, b](x1< x2) such that f(x1) = f(x2)=0. By the Mean Value Theorem,
there exists x3(x1, x2)such that
f0(x3) = f(x2)f(x1)
x2x1
= 0;
contradiction. We conclude that there exists at most one x[a, b]such that f(x)=0.
Exercise 1.1.14
The Maclaurin series for f(x) = sin xis
sin x=
X
k=0
(1)k
(2k+ 1)!x2k+1.
By Taylor’s Theorem, we have
sin x=xcos(ξ(x))
3! x3,
where ξ(x)is between 0and x. The absolute error involved in using sin xxfor x= 1=π
180 is
bounded by
sin π
180π
1801
3!π
18038.860961557 ×107.
1
pf3
pf4
pf5

Partial preview of the text

Download Problem Set 1, Math 128A and more Exercises Mathematics in PDF only on Docsity!

Math 128A Problem Set 1

Romain Hardy

September 7, 2017

Exercise 1.1.2(c)

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.

Exercise 1.1.2(d)

Let f (x) = x

3

    1. 001 x

2

    1. 002 x + 1. 101. We have f (−3) = − 1. 896 , f (−2) = 1. 101 , f (−

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.

Exercise 1.1.4(d)

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.

Exercise 1.1.

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.

Exercise 1.1.

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

π

π

∣ ≤^

π

≈ 8. 860961557 × 10

− 7 .

Exercise 1.1.

(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).

Exercise 1.2.2(c)

Let p

∗ be an approximation for

  1. If the relative error between p

∗ 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

  • 10

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+...

∣ ×^10

−k

× 10

−k

≤ 0. 5 × 10

−k+ .

Exercise 1.3.2(c)

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

∣ ≈^8.^394377783 ×^10

− 4 .

Exercise 1.3.

(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

  • n − 1.

(b) We can rewrite the sum as

b 1

( (^) ∑n

i=

ai

  • b 2

( (^) ∑n

i=

ai

  • · · · + bnan =

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).

Exercise 1.3.

(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

γ ).

Exercise 1.3.

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 =

Exercise 2.1.6(d)

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.

Exercise 2.1.

(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.

Exercise 2.1.

(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.