1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Error Approximation Associated with Taylor Series

  1. Mar 31, 2009 #1
    1. The problem statement, all variables and given/known data

    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?

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

    2. Relevant 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?

    3. The attempt at a solution
  2. jcsd
  3. Apr 1, 2009 #2


    User Avatar
    Science Advisor

    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:
    \frac{\Delta x^2}{2!}\frac{d^2 u}{dx^2}[/tex]
    So given a point spacing, you can get some sort of estimation.
  4. Apr 1, 2009 #3
    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?
  5. Apr 2, 2009 #4


    User Avatar
    Science Advisor

    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:
    \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:
    \frac{\Delta x^2}{2!}\frac{d^2 x}{dx^2}[/tex]
  6. Apr 2, 2009 #5
    That makes perfect sense. Thanks!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook