# Numerical Differentiation

In the case of differentiation, we first write the interpolating formula on the interval and the differentiate the polynomial term by term to get an approximated polynomial to the derivative of the function. When the tabular points are equidistant, one uses either the Newton's Forward/ Backward Formula or Sterling's Formula; otherwise Lagrange's formula is used. Newton's Forward/ Backward formula is used depending upon the location of the point at which the derivative is to be computed. In case the given point is near the mid point of the interval, Sterling's formula can be used. We illustrate the process by taking (i) Newton's Forward formula, and (ii) Sterling's formula.

Recall, that the Newton's forward interpolating polynomial is given by

 (13.2.1)

Differentiating (13.2.1), we get the approximate value of the first derivative at as

 (13.2.2)

where,

Thus, an approximation to the value of first derivative at i.e. is obtained as :

 (13.2.3)

Similarly, using Stirling's formula:
 (13.2.4)

Therefore,
 (13.2.5)

Thus, the derivative at is obtained as:

 (13.2.6)

Remark 13.2.1   Numerical differentiation using Stirling's formula is found to be more accurate than that with the Newton's difference formulae. Also it is more convenient to use.

Now higher derivatives can be found by successively differentiating the interpolating polynomials. Thus e.g. using (13.2.2), we get the second derivative at as

EXAMPLE 13.2.2   Compute from following table the value of the derivative of at :
 1.73 1.74 1.75 1.76 1.77 1.77284 1.1552 1.73774 1.72045 1.70333
Solution: We note here that so , and

Thus, is obtained as:
(i) Using Newton's Forward difference formula,

(ii) Using Stirling's formula, we get:

It may be pointed out here that the above table is for , whose derivative has the value -0.1739652000 at

EXAMPLE 13.2.3   Using only the first term in the formula (13.2.6) show that

Hence compute from following table the value of the derivative of at :
 1.05 1.15 1.25 2.8577 3.1582 3.4903
Solution: Truncating the formula (13.2.6)after the first term, we get:

Now from the given table, taking , we have

Note the error between the computed value and the true value is

EXERCISE 13.2.4   Retaining only the first two terms in the formula (13.2.3), show that

Hence compute the derivative of at from the following table:
 1.15 1.2 1.25 3.1582 3.3201 3.4903
Also compare your result with the computed value in the example (13.2.3).

EXERCISE 13.2.5   Retaining only the first two terms in the formula (13.2.6), show that

Hence compute from following table the value of the derivative of at :
 1.05 1.1 1.15 1.2 1.25 2.8577 3.0042 3.1582 3.3201 3.4903

EXERCISE 13.2.6   Following table gives the values of at the tabular points ,
 0 0.05 0.1 0.15 0.2 0.25 0 0.10017 0.20134 0.30452 0.41075 0.5211
Compute (i)the derivatives and at by using the formula (13.2.2). (ii)the second derivative at by using the formula (13.2.6).

Similarly, if we have tabular points which are not equidistant, one can use Lagrange's interpolating polynomial, which is differentiated to get an estimate of first derivative. We shall see the result for four tabular points and then give the general formula. Let be the tabular points, then the corresponding Lagrange's formula gives us:

Differentiation of the above interpolating polynomial gives:
 (13.2.7)

In particular, the value of the derivative at is given by

Now, generalizing Equation (13.2.7) for tabular points we get:

EXAMPLE 13.2.7   Compute from following table the value of the derivative of at :
 0.4 0.6 0.7 3.38365 4.24424 4.72751
Solution: The given tabular points are not equidistant, so we use Lagrange's interpolating polynomial with three points: . Now differentiating this polynomial the derivative of the function at is obtained in the following form:

Note: The reader is advised to derive the above expression.
Now, using the values from the table, we get:

For the sake of comparison, it may be pointed out here that the above table is for the function , and the value of its derivative at is

EXERCISE 13.2.8   For the function, whose tabular values are given in the above example(13.2.8), compute the value of its derivative at

Remark 13.2.9   It may be remarked here that the numerical differentiation for higher derivatives does not give very accurate results and so is not much preferred.

A K Lal 2007-09-12