Numerical Methods: Unit - Iv Numerical Differentiation
Numerical Methods: Unit - Iv Numerical Differentiation
Numerical Differentiation
In the case of differentiation, we first write the interpolating formula on the interval (x0,xn)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. The Newton's forward interpolating polynomial is given by
as
Where,
Therefore,
Remark 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 we get the second derivative at x = x0 as
EXAMPLE 1 Compute from following table the value of the derivative of y = f(x) at 1.73 1.74 1.75 1.76 1.77
, And
It may be pointed out here that the above table is for f(x) = e-x, whose derivative has the value -0.1739652000 at
EXAMPLE 2. Using only the first term in the formula , show that
Hence compute from following table the value of the derivative of y = ex at 1.05 1.15 1.25
Note the error between the computed value and the true value is
Numerical Integration
Numerical Integration is the process of computing the value of a definite integral,
when the values of the integrand function, y = f(x) are given at some tabular points. As in the case of Numerical differentiation, here also the integrand is first replaced with an interpolating polynomial, and then the integrating polynomial is integrated to compute the value of the definite integral.
Trapezoidal Rule
Here, the integral is computed on each of the sub-intervals by using linear interpolating formula, i.e. for summing them up to obtain the desired integral. and then
Note that
on the interval
we get,
Thus, we have,
i.e.
This is called TRAPEZOIDAL RULE. EXAMPLE 3. Using Trapezoidal rule compute the integral
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
1.0000 1.0100 1.0408 1.0941 1.1735 1.2840 1.4333 1.6323 1.8964 2.247 2.7182 0 5 1 7 1 2 2 1 8 9 8 Solution: Here,
and
Thus,
Simpson's Rule
If we are given odd number of tabular points,i.e. is even, then we can divide the given integral of integration in even number of sub-intervals [x2k, x2k+2 ] . Note that for each of these sub-intervals, we have the three tabular points x2k, x2k+1, x2k+2 .and so the integrand is replaced with a quadratic interpolating polynomial. Thus
EXAMPLE 4. Using the table for the values of y = ex2, compute the integral by Simpson's rule. Also estimate the error in its calculation and compare it with the error using Trapezoidal rule. Solution: Here, thus we have odd number of nodal points. Further,
and
Thus,
To find the error estimates, we consider the forward difference table, which is given below:
0.00189 0.00338
0.00149 0.00171
0.2 1.04081 0.05336 0.02598 0.00519 0.00243 0.3 1.09417 0.07934 0.03117 0.00762 0.00320 0.4 1.17351 0.11051 0.01090 0.00459 0.00658 0.00964
0.3879
0.5 1.28402 0.14930 0.04969 0.6 1.43332 0.19899 0.06518 0.7 1.63231 0.26417 0.08725 0.8 1.89648 0.35142 0.11896 0.9 2.24790 0.47038 1.0 2.71828
It shows that the error in numerical integration is much less by using Simpson's rule. EXAMPLE 5. Compute the integral
, where the table for the values of y = f(x) is given below: 0.05 0.1 0.15 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
0.078 0.156 0.233 0.309 0.454 0.587 0.707 0.809 0.891 0.951 0.987 1.000 5 4 4 0 0 8 1 0 0 1 7 0 Solution: Note that here the points are not given to be equidistant, so as such we can not use any of the above two formulae. However, we notice that the tabular points0.05,0.10,0.15 and points 0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9 and . Now we can divide the interval in two subinterval: , ; are equidistant and so are the tabular
thus,
. The integrals then can be evaluated in each interval. We observe that the second set has odd number of points. Thus, the first integral is evaluated by using Trapezoidal rule and the second one by Simpson's rule (of course, one could have used Trapezoidal rule in both the subintervals). For the first integral Thus, and for the second one .
which gives,
MATRICES
In linear algebra an n-by-n (square) matrix A is called invertible or nonsingular or nondegenerate, if there exists an n -by-n matrix B such that where In denotes the n-by-n identity matrix and the multiplication used is ordinary matrix multiplication. If this is the case, then the matrix B is uniquely determined by A and is called the inverse of A, denoted by A1. It follows from the theory of matrices that if for finite square matrices A and B, then also Non-square matrices (m-by-n matrices for which m n) do not have an inverse. However, in some cases such a matrix may have a left inverse or right inverse. If A is m-by-n and the rank of A is equal to n, then A has a left inverse: an n-bym matrix B such that BA = I. If A has rank m, then it has a right inverse: an n-by-m matrix B such that AB = I. A square matrix that is not invertible is called singular or degenerate. A square matrix is singular if and only if its determinant is 0. Singular matrices are rare in the sense that if you pick a random square matrix, it will almost surely not be singular. While the most common case is that of matrices over the real or complex numbers, all these definitions can be given for matrices over any commutative ring. However, in this case the condition for a square matrix to be invertible is that its determinant is invertible in the ring, which in general is a much stricter requirement than being nonzero. Matrix inversion is the process of finding the matrix B that satisfies the prior equation for a given invertible matrix A.
Properties
Let A be a square n by n matrix over a field K (for example the field R of real numbers). Then the following statements are equivalent:
A is invertible. A is row-equivalent to the n-by-n identity matrix In. A is column-equivalent to the n-by-n identity matrix In.
A has n pivot positions. det A 0. In general, a square matrix over a commutative ring is invertible if and only if its determinant is a unit in that ring. rank A = n. The equation Ax = 0 has only the trivial solution x = 0 (i.e., Null A = {0}) The equation Ax = b has exactly one solution for each b in Kn, (x 0). The columns of A are linearly independent. The columns of A span Kn (i.e. Col A = Kn). The columns of A form a basis of Kn. The linear transformation mapping x to Ax is a bijection from K to K . There is an n by n matrix B such that AB = In = BA. The transpose AT is an invertible matrix (hence rows of A are linearly independent, span Kn, and form a basis of Kn). The number 0 is not an eigenvalue of A. The matrix A can be expressed as a finite product of elementary matrices. Furthermore, the following properties hold for an invertible matrix A:
n n
and
, is called an involution.
The expression f(x + h)-f(x) gives the FIRST FORWARD DIFFERENCE of f(x) and the operator FIRST FORWARD DIFFERENCE OPERATOR. Given the step size h, this formula uses the values at and x+h the point at the next step. As it is moving in the forward direction, it is called the forward difference operator.
is called the
DEFINITION 2. (Second Forward Difference Operator) The second forward difference operator2, is defined as
We note that
and
Solution: Here,
Thus the
Now,
Thus, rf(x) = 0 for all r 3. Remark . 1. For a set of tabular values, the horizontal forward difference table is written as:
2.In many books, a diagonal form of the difference table is also used. This is written as:
..
Given the step size h, note that this formula uses the values at and x-h the point at the previous step. As it moves in the backward direction, it is called the backward difference operator. DEFINITION 5. ( Backward Difference Operator) The backward difference operator, r is defined as
With
EXAMPLE 3. Using the tabulated values in the above Example find y4and Solution: We have And
y3.
f(x) as follows:
Now
Remark . For a set of tabular values, backward difference table in the horizontal form is written as:
..
EXAMPLE 5. For the following set of tabular values ( xi, yi) write the forward and backward difference tables. 9 10 11 12 13 14
5.0 5.4 6.0 6.8 7.5 8.7 Solution: The forward difference table is written as
5 0.4 = 5.4 - 5 0.2 = 0.6 - 0.4 0= 0.2-0.2 -.3 = -0.3 - 0.0 0.6 = 0.3 - (-0.3) 0.2 -0.1 -0.1 -0.3 0.0 0.3
10 5.4 0.4
11
12 6.8 0.8 0.2 13 7.5 0.7 -0.1 14 8.1 0.6 -0.1 Observe from the above two tables that , .
Thus,
Then
Thus, , yk).
uses the table of (xk, yk). It is easy to see that only the even central differences use the tabular point values (xk
for any two points xi and xj is called the FIRST DIVIDED DIFFERENCE of f(x) relative to xi and xj . It is denoted by
is defined as SECOND DIVIDED DIFFERENCE of f(x) relative to xi , xj and xk. EXAMPLE 6. Using the following tabular values for a function y = f(x) obtain its second degree polynomial approximation. 0 0.1 1 0.16 2 0.2
1.12 1.24 1.40 Also, find the approximate value of the function at Solution: We shall first calculate the desired divided differences.
Thus,
Therefore
divided difference.
DEFINITION 9. ( Divided Difference) The kth DIVIDED DIFFERENCE of f(x) relative to the tabular points x0,x 1,,xk is defined recursively as
In general,
Now since,
For k = 1,
which on rearranging the terms gives the desired result. Therefore, by mathematical induction, the proof of the theorem is complete. height6pt width 6pt depth 0pt
or,
which gives ,
at
for
This polynomial approximation is called LAGRANGE'S INTERPOLATION FORMULA. EXAMPLE 12.3.6 Using the following data, find by Lagrange's formula, the value of f(x) at 0 9.3 1 9.6 2 10.2 3 10.4 4 10.8
11.40 12.80 14.70 17.00 19.80 Also find the value of where f(x) = 16.00.
Thus,
is obtained as: