Results 1 to 9 of 9

Math Help - Numerical Differentiation Formulas

  1. #1
    Junior Member
    Joined
    Sep 2008
    From
    Boston, Massachusetts
    Posts
    41

    Numerical Differentiation Formulas

    Hello to everyone

    I have a question with many parts that i am needing to do.

    (a)Derive the 2point formula, for numerical differentiation:

     f'(x) = \frac{f(x + h) - f(x)}{h} + O(h)

    What is  O(h) \ ?

    (b) Derive the same formula as (b) witht 3points formula

     f'(x) = \frac{f(x + h) - f(x-h)}{2h} + O(h^2).

    (c) Discretisation error in (a) and (b) is

     E_2(h) = |f'(x) - \frac{f(x + h) - f(x)}{h} |


     E_3(h) = |f'(x) - \frac{f(x + h) - f(x-h)}{h^2} |

    Prove that discretisation error for f'(1), where f(x) = exp(x) is

     E_2(h) = e|1 - \frac{e^h - 1}{h}| = e\frac{h}{2} + O(h^2)


     E_3(h) = e|1 - \frac{e^h - e^-h}{2h}| = e\frac{h^2}{6} + O(h^3)


    I am knowing that


     f'(x) = \lim_{h \to 0} ~ \frac{f(x + h) - f(x)}{h}

    but I cannot realise how to do these parts? Can someone please showing me how to prove?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    May 2008
    From
    Melbourne Australia
    Posts
    210
    Thanks
    25
    I'll give you some thought on part (b). Part (a) is done in a similar way.

    Using Taylor expansion:

     f(x+h) = f(x) + h*f'(x) + \frac{h^2}{2}*f''(x) + O(h^3)

    and

     f(x-h) = f(x) - h*f'(x) + \frac{h^2}{2}*f''(x) + O(h^3)

    so

     f(x+h) - f(x-h) = 2*h*f'(x) + O(h^3)

    rearranging gives

     f'(x) = \frac{f(x+h)-f(x-h)+O(h^3)}{2h}= \frac{f(x+h)-f(x-h)}{2h}+O(h^2)
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Sep 2008
    From
    Boston, Massachusetts
    Posts
    41
    Thank you very much, I understand what you show, but I am now a small amount confused because I found


     f'(x) = \frac{f(x + h) - f(x - h)}{2h} - \frac{h^2}{6}f'''(c) where  (x - h) \ < \ c \ < \ (x +h) for 3-point centered-difference formula.


    Also, using Taylor expansion


     f'(x + h) = f(x) + hf'(x) + \frac{h^2}{2} f''(c) where  x \ < \ c \ < \ (x +h)


    and I now knowing


     f'(x) = \frac{f(x + h) - f(x)}{h} - \frac{h}{2}f''(c) for 2-point forward difference formula but I do not understand how they got there(being very tired).

    So is


     O(h) = - \frac{h}{2}f''(c) or am I wrong?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Member
    Joined
    May 2008
    From
    Melbourne Australia
    Posts
    210
    Thanks
    25

    Big O notation

    You need to find out about "Big O" notation.

    The big O notation gives an idea of the size of something and is used to put an upper bound on the error term in your integration formulas (and lots of other areas of math, science and computer prog.).

    When we write O(h^n) we mean that for any value of k (even any really big finite value) then it is still possible to find a value of h sufficiently small so that O(h)<k*h^n.

    This isn't a good explanation but a web search for "big O notation" should turn up something helpful.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Sep 2008
    From
    Boston, Massachusetts
    Posts
    41
    I now understand what big O notation is. Thank-you for helping me know this.

    But I have spent much time on trying to derive the 2point formula

     f'(x) = \frac{f(x + h) - f(x)}{h} + O(h) using the same method as you doing for deriving  f'(x) = \frac{f(x + h) - f(x-h)}{2h} + O(h^2) but I can not find the answer.

    I get

     f'(x) = \frac{f(x+h) - f(x) - \frac{h^2}{2}f''(x)}{h} + O(h^2)

    of course which is not right. What am I doing wrong?
    Can someone please showing me because I can not see why, and I have used great time amounts trying to get it.

    Follow Math Help Forum on Facebook and Google+

  6. #6
    Member
    Joined
    May 2008
    From
    Melbourne Australia
    Posts
    210
    Thanks
    25
    The following three statements are all true:

    f(x+h) = f(x) + h*f'(x) + \frac{h^2}{2}*f''(x) + \frac{h^3}{6}*f'''(x) + O(h^4)

    f(x+h) = f(x) + h*f'(x) + \frac{h^2}{2}*f''(x) + O(h^3)

    f(x+h) = f(x) + h*f'(x) + O(h^2)

    You used the second option for the central difference equation. You need to use the third option for the forward difference.

    Therefore

    f(x+h) - f(x)= h*f'(x) + O(h^2)

    so

    f'(x)=\frac{f(x+h) - f(x)}{h}-\frac{O(h^2)}{h}
    \therefore f'(x)=\frac{f(x+h) - f(x)}{h}+O(h)
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Junior Member
    Joined
    Sep 2008
    From
    Boston, Massachusetts
    Posts
    41
    Now I understand.....thank-you again. Now that I have seen it I understand how easy it is. I can see the silly mistake I make. You are fantastic
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Kiwi_Dave View Post
    I'll give you some thought on part (b). Part (a) is done in a similar way.

    Using Taylor expansion:

     f(x+h) = f(x) + h*f'(x) + \frac{h^2}{2}*f''(x) + O(h^3)
    If we just have that f is twice differentiable then the final term is little-o h^2 not big-O h^3.

    (Not that it makes any difference to the argument)

    RonL
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Junior Member
    Joined
    Sep 2008
    From
    Boston, Massachusetts
    Posts
    41
    Quote Originally Posted by funnyinga View Post
    (1) Derive the 2point formula, for numerical differentiation:



    What is ?

    (3) Discretisation error in (a) and (b) is

     E_2(h) = |f'(x) - \frac{f(x + h) - f(x)}{h} |


     E_3(h) = |f'(x) - \frac{f(x + h) - f(x-h)}{h^2} |

    Prove that discretisation error for f'(1), where f(x) = exp(x) is

     E_2(h) = e|1 - \frac{e^h - 1}{h}| = e\frac{h}{2} + O(h^2)


     E_3(h) = e|1 - \frac{e^h - e^-h}{2h}| = e\frac{h^2}{6} + O(h^3)
    Now I am having hard time with this part. My thinking is this, but I am confused:

     \frac{\mathrm{d}}{\mathrm{d}x} e^x = e^x

    and  E_2(h) = |f'(x) - \frac{f(x + h) - f(x)}{h} |

    so for  f(x) = e^x

     E_2(h) = |e^x - \frac{e^{x+h} - e^x}{h} |

    and  E_3(h) = |e^x - \frac{e^{x+h} - e^{x-h}}{h} | .

    This is all I have. Can someone please showing me how finish this? I have spent great hours on this question and I am almost ready to leave it.

    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Numerical differentiation problem?
    Posted in the Calculus Forum
    Replies: 2
    Last Post: October 23rd 2010, 09:01 PM
  2. Numerical Differentiation - 2 variables
    Posted in the Calculus Forum
    Replies: 1
    Last Post: September 22nd 2009, 07:16 PM
  3. Numerical Differentiation
    Posted in the Calculus Forum
    Replies: 0
    Last Post: March 9th 2009, 03:10 PM
  4. Numerical Methods: Numerical Differentiation
    Posted in the Calculus Forum
    Replies: 0
    Last Post: February 25th 2009, 02:20 AM
  5. Numerical Differentiation ?
    Posted in the Calculus Forum
    Replies: 1
    Last Post: December 20th 2008, 12:37 AM

Search Tags


/mathhelpforum @mathhelpforum