Error Approximation Associated with Taylor Series

Click For Summary
The discussion focuses on using Taylor series to derive estimates for the derivative of a function at a point, specifically through various finite difference approximations. Each approximation (F1 to F4) is analyzed for its associated error, with F1 and F2 being first-order approximations and F3 being a second-order central difference that eliminates certain error terms. The participants clarify that the leading error term for F1 and F2 involves the second derivative, while F3 introduces a third derivative error term. The conversation emphasizes the importance of understanding how Taylor series expansions work to accurately estimate derivatives and their errors.
aznkid310
Messages
106
Reaction score
1

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

 
Physics news on Phys.org
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 infinite 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:
<br /> \frac{\Delta x^2}{2!}\frac{d^2 u}{dx^2}
So given a point spacing, you can get some sort of estimation.
 
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?
 
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:
<br /> \frac{\Delta x^3}{3!}\frac{d^3 x}{dx^3}
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:
<br /> \frac{\Delta x^2}{2!}\frac{d^2 x}{dx^2}
 
That makes perfect sense. Thanks!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
13
Views
2K
Replies
6
Views
3K
  • · Replies 27 ·
Replies
27
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K