You are on page 1of 22

# 1

## Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

2

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

3

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

4

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

5

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

6

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

Solution to Homework #1- EGM6341
Ramin Shamshiri

1. (a) Assume (x) is continuous on a x b, and consider the average
=
=
n
j
j
x f
n
S
1
) (
1

with all points x
j
in the interval [a, b]. Show that
) (, f S =
for some in *a, b+.

Soln: Because (x) is continuous in the interval [a, b], there are two numbers in the interval m and M such that
m (x) M for all x in the interval.
Then nm
=
n
j
j
x f
1
) ( nM m s s
=
n
j
j
x f
n
1
) (
1
M
By the intermediate value theorem (IVT), for every value of y such that m y M, there will be a value in the
interval *a, b+ such that () = y
Thus, there exists a value in the interval such that () =
=
n
j
j
x f
n
1
) (
1

3. (b) For small values of , measure the relative error in sin(x) = x by using
x
x x
x
x x
~
) sin(
) sin(
) sin(
0 = x
Bound this modified relative error for o s x . Choose to make this error less than 0.01, corresponding to a 1
percent error.
(Hint: use Taylor series expansion for f(x) = sin(x) =;
7

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
do NOT interpret f(x) as
) sin(
) sin(
x
x x
)

Soln: Using Taylor Series expansion, we can find the error between the function and its approximation as
x x x E = ) sin( ) ( ...
! 7 ! 5 ! 3
...
! 7 ! 5 ! 3
7 5 3 7 5 3
+ + = + + =
x x x
x
x x x
x
To bound the relative error, we need
01 . 0
|
! 3
|
) sin(
| ...
! 7 ! 5 ! 3
|
3 7 5 3
< ~
+ +
x
x
x
x x x

=> 06 . 0
2
s x

=> 2449 . 0 = so x
Comment: using TS expansion twice (once to replace sin(x) by x in the denominator and then replace sin(x) by
...
! 7 ! 5 ! 3
7 5 3
+ +
x x x
x in the numerator) allows us to determine the value of o rather easily without
solving the transcendental equation.
(b) In case some of you may have interpreted the original function as
) sin(
) sin(
) (
x
x x
x f

= and the approximate
function as
x
x x ) sin(
, then the solution is as follows:
Using Taylor Series expansion, we can find the error between the function and its approximation as
) sin(
) sin( ) ( sin ] ) [sin( ) sin(
) sin(
) sin(
) (
2
x x
x x x x x x
x
x x
x
x x
x E
+
=

=
)
! 7 ! 5 ! 3
(
)
! 7 ! 5 ! 3
( )
! 7 ! 5 ! 3
( )
! 7 ! 5 ! 3
(
7 5 3
7 5 3
2
7 5 3 7 5 3
x x x
x x
x x x
x x
x x x
x
x x x
x
+
+ + + +
=
8

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
)
! 7 ! 5 ! 3
1 (
! 7 120 6
)
! 5 ! 3
2
! 7
2
120
2
6
2
36
(
! 7 120 6
6 4 2
2
8 6 4
2
8 8 6 4 6
2
8 6 4
x x x
x
x x x
x
x x x x x
x
x x x
+
+ + + + +
~
)
6
1 (
1
)
360 36
(
)
! 7 ! 5 ! 3
1 (
360 36
2
6 4
6 4 2
2
8 6
x
x x
x x x
x
x x

+ ~
+
+
~
)
6
1 (
)
10
1 (
)
36
(
2
2
4
x
x
x

= )
15
1 )(
36
(
2 4
x x
+ = (this is the absolute error)
Now, we can also expand the original function f(x) as

...
6
1
...
20
1
6
...
! 7 ! 5 ! 3
...
! 7 ! 5 ! 3
) sin(
) sin(
) (
2
2
2
7 5 3
7 5 3
+
+
=
+ +
+ +
=

x
x
x
x x x
x
x x x
x
x x
x f = ...)
60
7
1 (
6
2 2
+ +
x x

Thus the relative error is
=
+

= =
...)
20
1 (
6
...)
10
1 )(
36
(
) (
) (
.
2 2
2 4
x x
x x
x f
x E
err rel )
20
1 (
6
2 2
x x

For the relative error to be less than .01 we set
01 . 0 )
20
1 (
6
2 2
<
x x

Since x is small,
20
2
x
can be neglected in the above inequality in order to obtain a simple solution. Thus
01 . 0
6
2
<
x
=> = = < 06 . 0 o x ... 2449 . 0
9

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
In the graph shown below, the predicted relative error, )
20
1 (
6
2 2
x x
, is compared with the actual relative error,
] ) [sin(
) sin( ) ( sin ] ) [sin(
) (
) (
2
x x x
x x x x x x
x f
x E

+
= . Very good agreement is observed. This strongly suggests that the
derivation shown above is a correct one.

0
0.05
0.1
0.15
0.2
0.25
0 0.2 0.4 0.6 0.8 1 1.2
actual rel diff
pred rel diff
x
0.00001
0.0001
0.001
0.01
0.1
1
0.01 0.1 1 10
actual rel diff
pred rel diff
x
x=0.2449
10

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
5. (c) Construct a Taylor Series for the following functions, and bound the error when truncating n terms.
f(x) = dt
t
t
x
x
) ( tan 1
1
0

}

Soln: From equation (1.1.11) on page 6 of the textbook, we have
2
3 2
1
1 2 7 5 3
1
1
1
3 2
) 1 (
1 2
) 1 ( ...
7 5 3
) ( tan
x
n
n
n
n
n
t
n
t t t t
t t
, +

+
+
+
+ + + =
+
+
+

Substituting the above expansion of ) ( tan
1
t

## into the integral, we get

f(x) = dt
n
t
n
t t t t
x
x
n
n
n
n
x
]
1
1
3 2
) 1 (
1 2
) 1 ( ...
7 5 3
1 [
1
2
2 2
1
2 6 4 2
0
, +

+
+
+
+ + +
}
+
+
for 1 0 s s t
By using the integral mean value theorem, the last term in the integral above can be expressed as

3 2
2 2
1 2 2
0
2
1
1
1
) 3 2 (
1
) 1 (
1
1
3 2
1
) 1 (
+ + + +
+ +
=
}
+
+

n
x
n n
x
x
n
x
n
dt t
n
q q
, 1 0 s s s x
x
q
Thus, term by term integration gives
f(x) = ]
1
1
) 3 2 (
) 1 (
) 1 2 (
) 1 ( ...
7 5 3
[
1
2 2
3 2
1
2
1 2
2
7
2
5
2
3
x
n
n
n
n
n
x
n
x x x x
x
x
q +

+
+
+
+ + +
+
+
+

=
2 2
2 2
1
2
2
2
6
2
4
2
2
1
1
) 3 2 (
) 1 (
) 1 2 (
) 1 ( ...
7 5 3
1
x
n
n
n
n
n
x
n
x x x x
q +

+
+
+
+ + +
+
+

for 1 0 s s x and x
x
s sq 0 .
(NOTE:
x x
q = )
Thus,
f(x)
2
2
2
6
2
4
2
2
) 1 2 (
) 1 ( ...
7 5 3
1
+
+ + + ~
n
x x x x
n
n

and the magnitude of the remainder R(x) is bounded by

11

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

2
2 2
2 2
2 2
2 2
) 3 2 ( 1
1
) 3 2 (
| ) ( |
+
s
+

+
=
+ +
+
n
x
n
x
x R
n
x
n
n
q
.
12

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
7. (a) Using Taylors theorem for functions of two variables, find linear and quadratic approximations to the follow
functions f(x, y) for small values of x and y. Give the tangent plane function z = p(x,y) whose graph is tangent to
that of z = f(x,y) at (0,0,f(0,0)).
y x y x f + = 2 1 ) , (

Soln: There are two methods we can use to find an approximation for f(x,y).

1) Let c=2x-y. For small |z|, the binomial expansion for (1+z)

gives:
(1+c)

= ...
8 2
1
2
+ +
c c
8
4 4
2
2
1
2 2
y xy x y x +

+ = +
=> y x y x f + = 2 1 ) , (
8 2 2 2
1
2 2
y xy x y
x + + ~ which is quadratic approximation.
For linear approximation, y x y x f + = 2 1 ) , ( 2 / 1 y x + = .
2) We can use Taylors Theorem to expand f(x,y) about (x,y)=(0,0)

,
2 1 2
1
,
2 1
1
y x y
f
y x x
f
+
=
c
c
+
=
c
c

2
1
2 1 2
1
1
2 1
1
0 , 0
0 , 0
0 , 0
0 , 0
=
+
=
c
c
=
+
=
c
c
y x y
f
y x x
f

,
) 2 1 ( 2
1
,
) 2 1 ( 4
1
,
) 2 1 (
1
2 / 3
2
2 / 3 2
2
2 / 3 2
2
y x
y x
f
y x y
f
y x x
f
+
=
c c
c
+
=
c
c
+
=
c
c

2
1
) 2 1 ( 2
1
4
1
) 2 1 ( 4
1
1
) 2 1 (
1
0 , 0
2 / 3
0 , 0
2
0 , 0
2 / 3
0 , 0
2
2
0 , 0
2 / 3
0 , 0
2
2
=
+
=
c c
c
=
+
=
c
c
=
+
=
c
c
y x y x
f
y x y
f
y x x
f

)
4
(
2
1
2
1 ) , (
2
2
xy
y
x
y
x y x f + + + =
8 2 2 2
1
2 2
y xy x y
x + + =

Comment: Method 1 and 2 gave the same results, but method 1 is obviously easier and should be used whenever
possible to reduce the amount of effort.
13

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

3) To find the equation of the tangent plane, we note that the normal of the tangent plane at
(x, y, z) = (0, 0, 1) is ) 1 ,
2
1
, 1 ( ) 1 , (
0 , 0
0 , 0
=
c
c
c
c
y
f
x
f

Thus, the tangent plane is given by
0 ) 1 ( ) 0 ( ) 0 (
0 , 0
0 , 0
=
c
c
+
c
c
z y
y
f
x
x
f

1
2
1
= z y x
14

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
8. Consider the second-order divided difference ] , , [
2 1 0
x x x f defined in (1.1.13).

(a) Prove the property (1.1.15) that the order of the arguments x
0
, x
1
, x
2
does not affect the value of the divided
difference
(b) Prove the formula (1.1.14),
) (
2
1
] , , [
2 1 0
, f x x x f ' ' =
for some between the minimum and maximum of x
0
, x
1
, and x
2
.
Hint: from part (a), there is no loss in generality in assuming x
0
< x
1
< x
2
. Use Taylors theorem to reduce
] , , [
2 1 0
x x x f , expanding about x
1
; and then use the intermediate value theorem to simplify the error term.

Soln:
(a) If we can prove the property for two nontrivial permutations of x
0
, x
1
, and x
2
, then it will hold for other
permutations.
Note that it is trivial to prove ] , , [
2 1 0
x x x f = ] , , [
0 1 2
x x x f . Hence we consider ] , , [
2 1 0
x x x f and
] , , [
1 2 0
x x x f .
Note: ] , , [
2 1 0
x x x f =
0 2
0 1
0 1
1 2
1 2
) ( ) ( ) ( ) (
x x
x x
x f x f
x x
x f x f

and ] , , [
1 2 0
x x x f =
0 1
0 2
0 2
2 1
2 1
) ( ) ( ) ( ) (
x x
x x
x f x f
x x
x f x f

.

Let
0 1 1
x x h = and
1 2 2
x x h = . Then
0 2 2 1
x x h h = + .
] , , [
2 1 0
x x x f =
2 1
1
0 1
2
1 2
) ( ) ( ) ( ) (
h h
h
x f x f
h
x f x f
+

=
2 1 2 1
0 1 2 1 2 1
) (
)] ( ) ( [ )] ( ) ( [
h h h h
x f x f h x f x f h
+

=
2 1 2 1
0 1 2 1 2 1
) (
)] ( ) ( [ )] ( ) ( [
h h h h
x f x f h x f x f h
+

15

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
=
2 1 2 1
0 2 1 2 1 1 2 1
) (
) ( ) ( ) ( ) (
h h h h
x f h x f h x f h x f h
+
+
(1)

] , , [
1 2 0
x x x f =
1
2 1
0 2
2
2 1
) ( ) ( ) ( ) (
h
h h
x f x f
h
x f x f
+

=
1
2 1
0 2
2
1 2
) ( ) ( ) ( ) (
h
h h
x f x f
h
x f x f
+

=
) (
) ( ) ( ) ( ) ( ) ( ) (
2 1 2 1
0 2 2 2 1 2 2 2 1 1 2 1
h h h h
x f h x f h x f h x f h x f h x f h
+
+ +

=
2 1 2 1
0 2 1 2 1 1 2 1
) (
) ( ) ( ) ( ) (
h h h h
x f h x f h x f h x f h
+
+
(2)

Since equations (1) and (2) are the same, it is proven that ] , , [
2 1 0
x x x f = ] , , [
1 2 0
x x x f .
(b) ] , , [
2 1 0
x x x f =
2 1
1
0 1
2
1 2
) ( ) ( ) ( ) (
h h
h
x f x f
h
x f x f
+

Using Taylor series, we can expand ) (
0
x f and ) (
2
x f near
1
x as
) (
0
x f = ) (
! 2
1
) ( ) (
1
2
1 1 1 1
f h x f h x f ' ' + ' ,
1 1 0
x x s s
) (
2
x f = ) (
! 2
1
) ( ) (
2
2
2 1 2 1
f h x f h x f ' ' + ' + ,
2 2 1
x x s s
Thus,

1
0 1
) ( ) (
h
x f x f
= ) (
! 2
1
) (
1 1 1
f h x f ' ' '
2
1 2
) ( ) (
h
x f x f
= ) (
! 2
1
) (
2 2 1
f h x f ' ' + '
16

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
Hence ] , , [
2 1 0
x x x f =
2 1
1 1 2 2
) (
2
1
) (
2
1
h h
f h f h
+
' '

' '

= )] ( ) ( [
2
1
2
2 1
2
1
2 1
1
f
h h
h
f
h h
h
' '
+
+ ' '
+

Let g(x) ) (x f ' ' ,
2 1
1
1
h h
h
w
+
= ,
2 1
2
2
h h
h
w
+
=
For a continuous function g(x), it possesses a minimum m and maximum M in the interval [x
0
, x
2
] such that
M x g m s s ) ( for all x in the interval.
Then,
M h g h m h
1 1 1 1
) ( s s & M h g h m h
2 2 2 2
) ( s s
for positive
2
h and
1
h .
Thus, M h h g h g h m h h ) ( ) ( ) ( ) (
2 1 2 2 1 1 2 1
+ s + s +
M g w g w m s + s ) ( ) (
2 2 1 1

By the intermediate value theorem (IVT), there exists a value q in the interval [x
0
,x
2
] with M g m s s ) (q such
that ) ( ) ( ) (
2 2 1 1
q g w g w g + = . Thus,
= ' ' ) (q f ) ( ) (
2 2 1 1
f w f w ' ' + ' ' for
2 0
x x s sq .
That is, ] , , [
2 1 0
x x x f =
2
1
) (q f ' ' for some q in the interval [x
0
,x
2
].

17

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
10. Convert the following numbers to their decimal equivalents.
(a) (10101.101)
2
(c) (.10101010101)
2

(f) (11.1)
2
with the parentheses enclosing n 1s.

Soln:
(a) (10101.101)
2
= 2
4
+ 2
2
+ 2
0
+ 2
-1
+ 2
-3
= 21.625

(c) (.10101010101)
2
= 2
-1
+ 2
-3
+ 2
-5
+ 2
-7
+ .
= ...
2
1
2
1
2
1
2
1
7 5 3
+ + +
This is a geometric series, the first term is
2
1
1
= a , the common ratio is
2
2
1
= r and the number of term is of
course infinity, = n . Then the sum is computed as
Sum = ... 66666 . 0
3
2
3
4
2
1
4
1
1
4
1
1
2
1
1
) 1 (
1
= = =

|
.
|

\
|

r
r a
n

(f) (11.1)
2
= 2
0
+ 2
1
+ 2
2
+ 2
3
+ . + 2
n-1
= 1 + 2(1-2
n-1
)/(1-2) = 1 + 2
n
2 = 2
n
1

Additional problems:
A1: The leading terms in the following expansion of x in powers of sinx are
... sin sin sin
5
5
3
3
+ + + = x a x a x x
Show that
6
1
3
= a and
40
3
5
= a
Numerically verify that the above expansion is correct by showing graphically that
x x x a x a x c
7 5
5
3
3 7
sin / ) sin sin (sin + + = remains to be a constant over a reasonable range of small
values of x.

18

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
Soln: (This expansion is called Burman expansion)
Taylor series expansions:
...
! 7 ! 5 ! 3
sin
7 5 3
+ + =
x x x
x x
...
! 5
13
! 2
sin
7 5
3 3
+ + =
x x
x x
...
! 3
5
sin
7
5 5
+ =
x
x x
Plug into the equation:
... sin sin sin
5
5
3
3
+ + + = x a x a x x
...
! 3
5
! 5
13
! 2 ! 7 ! 5 ! 3
7
5
5
7 5
3
3
7 5 3
+
|
|
.
|

\
|
+
|
|
.
|

\
|
+ + + =
x
x a
x x
x a
x x x
x x
... )
! 5
1
! 2
( )
! 3
1
( 0
5
5
3 3
3
+ + + + = x a
a
x a

Then balance the coefficient:

6
1
! 3
1
3
= = a

40
3
120
9
120
1
12
1
! 5
1
! 2
3
5
= = = =
a
a

19

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09

A2: Using integration by parts to find an asymptotic expansion for
I(x) = dt
t
t
x
) cos(
}

## for large positive values of x.

Answer: I(x) ~ x
x
x
x
x x
sin ...)
! 2 1
( cos ...)
! 3 1
(
3 4 2
+ +
Hint: see Example 8 in the Supplemental Reading for Chapter 1.

Soln:
Let

tdt dv
t u
cos
/ 1
=
=
=>
t v
dt t du
sin
/ 1
2
=
=

} }

+ = =
x x x
dt
t
t
t
t
dt
t
t
x I
2
sin sin ) cos(
) (
Let

tdt dv
t u
sin
/ 1
2
=
=
=>
t v
dt t du
cos
/ 2
3
=
=

-0.05
-0.048
-0.046
-0.044
-0.042
-0.04
0.00 0.05 0.10 0.15 0.20
x
c
7
20

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
} }

= + =
x x x x x
dt
t
t
t
t
t
t
dt
t
t
t
t
x I
3 2 2
cos
2
cos sin sin sin
) (
Let

tdt dv
t u
cos
/ 1
3
=
=
=>
t v
dt t du
sin
/ 3
4
=
=

(
(

+ =
}

x x x x
dt
t
t
t
t
t
t
t
t
x I
4 3 2
sin
3
sin
2
cos sin
) (
Let

tdt dv
t u
sin
/ 1
4
=
=
=>
t v
dt t du
cos
/ 4
5
=
=

(
(

=
}

x x x x x
dt
t
t
t
t
t
t
t
t
t
t
x I
5 4 3 2
cos
4
cos
6
sin
2
cos sin
) (
}

+ + =
x x x x x
dt
t
t
t
t
t
t
t
t
t
t
x I
5 4 3 2
cos
! 4
cos
! 3
sin
! 2
cos sin
) (

}

+ + + =
x
dt
t
t
x
x
x
x
x
x
x
x
x I
5 4 3 2
cos
! 4
cos
! 3
sin
! 2
cos sin
) (
Hence
x
x x
x
x x
x I sin ...
! 2 1
cos ...
! 3 1
) (
3 4 2
|
.
|

\
|
+
|
.
|

\
|
+ ~

A3: Acceleration of convergence in summation using known results:
Given
6
1
2
2
1
t
=

= k k
,
90
1
4
4
1
t
=

= k k
,
945
1
6
6
1
t
=

= k k

evaluate the sum
+

= 1
1
2
1 k k

+

=
]
) 1 (
1 1
[
2 2 2
1 k k k k

21

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
using only 6 terms in the eventual summation.

Soln: S =
+

= 1
1
2
1 k k
]
) 1 (
1 1
[
2 2 2
1 +

= k k k k

]
) 1 (
1 1
[
1
) 1 (
1 1
1
1
2 4 4 2 2 2 2 2
+
=
+
=
+ k k k k k k k k

=
) 1 (
1 1 1 1
2 6 6 4 2
+
+
k k k k k

=>
+

= 1
1
2
1 k k
]
) 1 (
1 1 1 1
[
2 6 6 4 2
1 +
+

= k k k k k k

=
) 1 (
1
945 90 6
2 6
1
6 4 2
+
+

= k k k
t t t

22

Ramin Shamshiri EGM 6478, HW #1 Due 01/15/09
Approximating
) 1 (
1
2 6
1 +

= k k k
using 6, 12, 18, 24 terms, respectively, we obtain
# of terms S
6 1.07667431887561 (Has 7 significant digits)
12 1.07667405040602
18 1.07667404765946
24 1.07667404749540

If we directly sum the series S(M)=
1
1
2
1 +

= k
M
k
we get
# of terms S
1000 1.075674548
2000 1.076174172
4000 1.076424079 (Has 4 significant digits only)