# Finite Difference by Polynomials

The other way for approximating a derivative is to represent the function through a polynomial. The coefficients of the polynomial are obtained by the substitution of a dependent variable from a series of equally spaced points of the independent variables. As such, the approximate values of the derivatives are calculated from the polynomial.

Consider a second-order polynomial as

where *A, B* and *C* are constants and we assume the origin at x*. Thus, *x _{i}*=0,

*x*+j = Дх and

_{i}*x*= 2Дx and so on. The values of function

_{i}+_{2}*f*for corresponding

*x*are

_{i}*f(x*

_{i}) =f,

*f(x*+j) =f+j

_{i}^{and f(x}i + 2^{)} *= ^{f}* + 2.

Thus,

and

From Equations 5.42 through 5.44, it follows that and

To compute the first derivative of f, one has the following:

At *x _{{} =* 0, we have
Hence, Equation 5.45 will be

which is same as the second-order accurate forward difference expression obtained by using Taylor series expansion. Here, one may note that this approximation is classified as second-order accurate for *df/dx,* since *d ^{3}f/dx^{3}* vanishes just as in the accuracy analysis of the Taylor series expansion. The second derivative of

*f*may be calculated as

In a similar way, one may write the following:

and is consistent with the first-order finite difference approximation given by Equation 5.38. Considering the spacing of points *i, i* + 1 and *i* + 2 as non-identical, a general form of the finite difference approximation of the derivative procedure at *x _{{}*=0,

*x*

_{{}+

_{x}= Дх and

*x*

_{i}+

_{2}= (1 + а)Дх is as follows.

Here,

and

Consequently,

and

Therefore,

which is a second-order approximation. The second derivative of *f* is obtained as
As a result,

which is a first-order expression. In the same manner, similar relations for backward and central difference approximations may also be obtained.