"); hg.document.close(); } function tipclose(){ hg.window.close(); }
NUMERICAL DIFFERENTIATION


  1. Methods based on interpolation

  2. Methods based on interpolation uses the ponomial approximation obtained by nterpolation to find the derivative of the function, which is known at discrete points in the interval [a, b]

    Consider the function f(x) known at a set of points, say, x0, x1, . . ., xn has function values f0, f1, . . ., fn respectively.

    Then by Newton's divided difference formula

    f(x) = pn(x) = f [x0] + (x - x0) f [x0, x1] + (x - x0) (x - x1) f [x0, x1, x2
                       +  . . .   + (x - x0) (x - x1) . . . (x - xn-1) f [x0, x1, . . ., xn]

    is an nth degree polynomial approximation to the function f(x).

    The r (r<n)th derivative of the function at any point x Î [a,b] can be obtained by finding  dr(pn(x))/dxr at x.

    Here, though f(x) and the approximated polynomial Pn(x) coinside at the nodal points xi, i = 0,1, . . . n, the values of derivatives of the function f(x) need not coinside with the value of derivatives of Pn(x) even at nodal points. The situation may be much worse at non-nodal points. 

    The error in the interpolation is given by 

    Er(x) = f(r)(x) - Pn(r)(x)





    Case(i): Interpolation with a linear polynomial

    If (x1, f1) and (x2, f2) be any two data points then from Lagrange's interpolation formula
     

     
    (x - x2)
     
    (x - x1)
     
    f(x)  =  P1(x)  =

    f

     f2
     
    (x1 - x2
     
    (x2 - x1)
     

     
     
    f1
     
     f2
     
    f '(x)  =  P1'(x)  =

     

     
     
    (x1 - x2
     
    (x2 - x1)
     

     
         
     f2 - f1
     
       

     
     
     
     
    (x2 - x1)
     

    Error in the approximation
     

    E1(x) = f '(x) - P1'(x)

     
     
    [
    (x - x1) (x - x2)
     
    ] /

     f(2)(x)
     
      2!
     
    x0 < x < xn
      2x - x1 - x2
     + 
    (x - x1) (x - x2)
     
     = 

     f(2)(x)

     d/dx   f(2)(x)
     
    2
      2
     

    since x is unknown and is a function of x, finding d/dx  f(2)(x) at x =x is not possible. However, at the given datapoints since the coefficient of this term is zero, the total error can be written as
     

      2x - x1 - x2
     E1(x) 

     f(2)(x)
     
    2

    at the nodal points.

    Case(ii): Interpolation with a second degree polynomial

    Non-uniform grid points :

    Again by Lagrange's formula
     

     
    (x - x2)(x - x3)
      (x - x1)(x - x3)
    (x - x1)(x - x2)
     
    f(x) = P2(x) = 

     f1

     f2

     f3
     
    (x1 - x2)(x1 - x3)
      (x2 - x1)(x2 - x3)
    (x3 - x1)(x3 - x2)
     

     
     
    (2x - x2 - x3)
      (2x - x1 - x3)
    (2x - x1 - x2)
     
    f '(x) = P2'(x) = 

     f1

     f2

     f3
     
    (x1 - x2)(x1 - x3)
      (x2 - x1)(x2 - x3)
    (x3 - x1)(x3 - x2)
     

    Uniform grid points

    The error in the approximation

    E'2(x) = [(x - x1)(x - x2)(x - x3)]  1/2!  f(3)(x)               x1 < x < x2
     

    Case(iii): Interpolation with a polynomial of degree n.

    Non-uniform grid points :

    The nth degree Lagranges interpolation formula for f(x)
     

    n
    f(x) = Pn(x) =
    S
    li(x)fi
    i=0

     
    li(x) =        p(x) 
    (x - xi)p'(xk)

    with p(x)  = (x - x0) (x - x1) . . . (x - xn)
     

    n
    f '(x) = Pn'(x) =
    S
    li'(x)fi
    i=0

    The error in the approximation is
     

      p'(x)
     + 
    p(x)
     
     E'n(x) 

     f(n+1)(x)

     d/dx   f(n+1)(x)
     
    (n + 1)!
      (n + 1)!
     
    where   x0 < x < xn
    Again, since x is an unknown in (x0, xn) finding  E'n(x) at x = xis not feasible. However at nodal points xi, i = 0,1, . . ., n since p(xi) = 0 we get
     
      p'(x)
     
     
     E'n(x) 

     f(n+1)(x)  
     where   x0 < x < xn
     
    (n + 1)!
     
     

    provided  d/dx (f(n+1)(x)) is finite

    These formulae can be extended to find any rth derivative at a point of a function f(x) in the interval 
    (x0, xn) by taking the rth derivative of Pn(x). For example, for any  1 <r <n we get 
     

    n
    f (r)(x) = Pn(r)(x) =
    S
    li(r)(x)fi
    i=0
    at any point x

Solution of Transcendental Equations | Solution of Linear System of Algebraic Equations | Interpolation & Curve Fitting
Numerical Differentiation & Integration | Numerical Solution of Ordinary Differential Equations
Numerical Solution of Partial Differential Equations