Docsity

Taylor Series Expansion: Analysis of CS/Math 3414 Assignment 4 - Prof. Narendran Ramakrish, Assignments of Computer Science

Toggle sidebar
bg1
CS/Math 3414 Assignment 4
Solution Sketches
1. This is trivial. Expand f(2h) as a Taylor series around 0. The error term will be given by
−h f 00(ξ) where ξ∈(0,2h). Thus the formula is O(h).
2. We know that
f0(x) = f(x+h)−f(x)
h+h
2f00(x) + h2
6f000(x) + ···
and
f0(x) = f(x)−f(x−h)
h−h
2f00(x) + h2
6f000(x)− · · ·
This gives
2f0(x) = f(x+h)−f(x−h)
h+h2
3f000(x) + ···
If we make
f0(x)≈f(x+h)−f(x−h)
2h
then the error will be h2
6f000(ξ) or O(h2).
3. In the first expression, ξ∈(x, x +h) while in the second ξ∈(x−h, x). Obviously, these
cannot be canceled out.
4. Taking the suggestion from the book, we see that
D(h) = f(x+h)−f(x−h)
= 2hf 0(x) + h3
3f000(x) + 2h5
5! f(5)(x) + ···
S(h) = f(x+h) + f(x−h)
= 2f(x) + h2f00(x) + 2h4
4! f(4)(x) + · · ·
Now,
D(2h) = 4hf 0(x) + 8h3
3f000(x) + 64h5
5! f(5)(x) + ···
2D(h) = 4hf 0(x) + 2h3
3f000(x) + 4h5
5! f(5)(x) + ···
This means,
D(2h)−2D(h) = 2h3f000(x) + 60h5
120 f(5)(x) + ···
pf2

Partial preview of the text

Download Taylor Series Expansion: Analysis of CS/Math 3414 Assignment 4 - Prof. Narendran Ramakrish and more Assignments Computer Science in PDF only on Docsity!

CS/Math 3414 Assignment 4 Solution Sketches

  1. This is trivial. Expand f (2h) as a Taylor series around 0. The error term will be given by −h f ′′(ξ) where ξ ∈ (0, 2 h). Thus the formula is O(h).
  2. We know that f ′(x) = f^ (x^ +^ h h)^ −^ f^ (x)+ h 2 f ′′(x) + h 2 6 f^

′′′(x) + · · ·

and f ′(x) = f^ (x)^ −^ f h^ ( x^ −^ h)− h 2 f ′′(x) + h 2 6 f^

′′′(x) − · · ·

This gives 2 f ′(x) = f^ (x^ +^ h)^ − h f^ (x^ −^ h)+ h

2 3 f^

′′′(x) + · · · If we make f ′(x) ≈ f^ (x^ +^ h)^2 −h^ f^ (x^ −^ h) then the error will be h 62 f ′′′(ξ) or O(h^2 ).

  1. In the first expression, ξ ∈ (x, x + h) while in the second ξ ∈ (x − h, x). Obviously, these cannot be canceled out.
  2. Taking the suggestion from the book, we see that D(h) = f (x + h) − f (x − h) = 2 hf ′(x) + h 3 3 f^

′′′(x) +^2 h^5 5! f^

(5)(x) + · · · S(h) = f (x + h) + f (x − h) = 2 f (x) + h^2 f ′′(x) +^2 h

4 4! f^

(4)(x) + · · · Now, D(2h) = 4 hf ′(x) +^8 h 3 3 f^

′′′(x) +^64 h^5 5! f^

(5)(x) + · · · 2 D(h) = 4 hf ′(x) +^2 h 3 3 f^

′′′(x) +^4 h^5 5! f^

(5)(x) + · · ·

This means, D(2h) − 2 D(h) = 2 h^3 f ′′′(x) +^60 h 5 120 f^

(5)(x) + · · ·

Or,

f ′′′(x) = D(2h) 2 −h 3 2 D(h)− h 2 4 f^

(5)(ξ)

Similarly, we can express the calculations for f (4)(x) in terms of the S function.

S(h) = 2 f (x) + h^2 f ′′(x) + h 4 12 f^

(4)(x) + h^6 360 f^

(6)(x) + · · · 4 S(h) = 8 f (x) + 4h^2 f ′′(x) +^4 h 4 12 f^

(4)(x) +^4 h^6 360 f^

(6)(x) + · · · S(2h) = 2 f (x) + 4h^2 f ′′(x) +^16 h 4 12 f^

(4)(x) +^64 h^6 360 f^

(6)(x) + · · ·

Therefore,

S(2h) − 4 S(h) = − 6 f (x) + h^4 f (4)(x) + h 6 6 f^

(6)(x) + · · ·

Or,

S(2h) − 4 S(h) + 6f (x) = h^4 f (4)(x) + h 6 6 f^

(6)(x) + · · ·

Thus,

f (4)(x) = S(2h)^ −^4 S h( 4 h ) + 6f^ (x)− h

2 6 f^

(6)(ξ)

Both formulas are thus O(h^2 ) but the second has a smaller error term.