Error Approximation Associated with Taylor Series

  • Thread starter aznkid310
  • Start date
  • #1
109
0

Homework Statement



Q1) Use the Taylor series of f (x), centered at x0 to show that

F1 =[ f (x + h) - f (x)]/h
F2 =[ f (x) - f (x - h) ]/h
F3 =[ f (x + h) - f (x - h) ]/2h
F4 =[ f (x - 2h) - 8 f (x - h) + 8 f (x + h) - f (x + 2h) ]/12h

are all estimates of f '(x). What is the error associated with the approximation
Fi ~ f ' (x), for i = 1; 2; 3; 4?

Example:
f (x + 3h) = f (x) + 3h f '(x) +[(9h^2)/2]*f ''(x) + ...

F5 = [f (x + 3h) - f (x)]/3h = f '(x) + (3h/2)*f ''(x) + ...

so F5 is f '(x) with an error 3h f ''=2, which is of order h1 (i.e., first-order).

Homework Equations



Im trying to understand the example. So is x0 = x + 3h? If so, and I plug that into the taylor equation f (x + 3h) = f(x+3h) + f'(x+3h)*(3h) + f''(x+3h)*([9h^2]/2)+...

What am I doing wrong?

The Attempt at a Solution

 

Answers and Replies

  • #2
minger
Science Advisor
1,495
2
Are you familiar with Taylor series expansions? When you expand a Taylor series approxmation about a point, you are saying that you can guess the value at the next point by using derivative values at the current point. By weighing the derivatives properly, you can get as close as you basically want.

There will always be terms that are left out; remember that a Taylor series is an infinte series. So, you can approximate the error by the leading error term. If you are using say a second-order stencil, then you have an leading error term that IIRC looks something like:
[tex]
\frac{\Delta x^2}{2!}\frac{d^2 u}{dx^2}[/tex]
So given a point spacing, you can get some sort of estimation.
 
  • #3
109
0
The taylor expansion centered at x0 is
f(x) = f(x0) + f'(x0)(x-x0) + f''(x0)[(x-x0)^2]/2! + f'''(x0)[(x-x0)^2]/3! +...

so for my case: f(x+h) = f(x) + hf'(x) + [( h^2)/2]f''(x) + ...

F1 = [f(x+h) - f(x)]/h = f'(x) + (h/2)f''(x) + (h/6)f'''(x) + ...

so error is hf''/2?

F2 = [f(x) - f(x-h)]/h = - [ f'(x) + (h/2)f''(x) + ...]

and error is -hf''/2?


Are these correct?
How would I get F3,F4?
 
  • #4
minger
Science Advisor
1,495
2
I'm not entirely familiar with your particular notation, but your approxmations for the derivative are based on certain stencils. In the CFD world, we call your F1 a first-order forward difference (unstable btw but off topic). F2 is a first-order backwards difference. In theory, given the same point-spacing these two stencils should give the same errors.

Look at the expansions. Actually write them out and subtract f(x+Δx) - f(x). What do you have. You'll see that the f(x) on the RHS cancel out and the first term you have is the first derivative. However, you have a bunch of stuff to the right of it. Those exist along with the derivative causing error.

Now, if we look at F3, that's what we call a second order central difference. It's central difference because we use the same points on each side of the point of interest. It's called second-order because we have algebraically eliminated one of those error terms.

If you actually take f(x+Δx) and subtract f(x-Δx), you'll see that not only have we eliminated the f(x) terms, but we've also eliminated the second derivative. However, we do still have the third derivative error term.

Since the error terms are a function of 1/n!, the values of them decrease very exponentially. Because of this, when we look at errors, we typically look at only the leading term. In your case of F3, it will be something like:
[tex]
\frac{\Delta x^3}{3!}\frac{d^3 x}{dx^3}[/tex]
Actually, when you do the algebra, it might be 2x that term. That compares to the first-order schemes when our leading error term was:
[tex]
\frac{\Delta x^2}{2!}\frac{d^2 x}{dx^2}[/tex]
 
  • #5
109
0
That makes perfect sense. Thanks!
 

Related Threads on Error Approximation Associated with Taylor Series

  • Last Post
Replies
5
Views
1K
  • Last Post
Replies
1
Views
13K
  • Last Post
Replies
2
Views
2K
Replies
9
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
3K
Replies
2
Views
971
Replies
5
Views
4K
Replies
10
Views
2K
  • Last Post
Replies
8
Views
2K
Top