Numerics Chapter 6 Numerical Diffentaion and Integration
Numerics Chapter 6 Numerical Diffentaion and Integration
The graphical definition of a derivative: as x approaches zero in going from (a) to (c), the
difference approximation becomes a derivative.
The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by
which stands for the integral of the function f(x) w.r.t. the independent variable x, evaluated between the limits
x = a to x = b. The function f(x) is referred to as the integrand.
5.The rates at given values of x can then be read from the curve.
visually oriented approaches were employed to integrate tabulated data .A simple intuitive approach is to
Where fi is referred to as the first forward difference and h is called the step size. The entire term f /h is
referred to as a first finite divided difference.
A third way to approximate the first derivative is to subtract backward Taylor series expansions (between xi-1
and xi ) from the forward Taylor series expansion (between xi and xi+1) resulting in
Lower Order Derivatives
First forward difference
Exact Value
x=0.5, f’(x)=-0.9125
For h=0.5
Forward Diff.
Backward Diff.
Centered Diff.
For h=0.25
Forward Diff.
Backward Diff.
Centered Diff.
retain the second-derivative term by substituting the following approximation of the second derivative
Forward Finite-divided Difference Formulas
First derivative
Fourth Derivative
First Derivative
Second Derivative
Third Derivative
Fourth Derivative
Centered Finite-divided Difference Formulas
First Derivative
2 points required
Second Derivative
3 points required
Third Derivative
4 points required
Fourth Derivative
4 points required
The closed forms are those where the data The open forms have integration limits that
points at the beginning and end of the limits extend beyond the range of the data.
of integration are known.
The approximation of an integral by the area
under (a) a single straight line and (b) a single
parabola
Open Newton-Cotes formulas are not generally used for definite integration. However, they are utilized for
evaluating improper integrals and for the solution of ordinary differential equations.
Trapezoidal Rule
Simpson’s Rule [INTRODUCTION]
Simpson’s Rule [1/3]
Simpson’s Rule [3/8]
Trapezoidal Rule
A specific case of Simpson’s polynomial method where the approximation polynomial used is first order/linear
where, for the trapezoidal rule, the average height is the average of the function values at the end points,
or [ f(a) - f(b)]/2.
Example 5.3 : Graphical depiction of the use of a single application of the trapezoidal rule to
approximate the integral of f(x) = 0.2 + 25x - 200x 2+ 675x3 -900x4 + 400x5 from x = 0 to 0.8
} = {−400 𝑥 +2025 {𝑥} ^ {2} −3600 {𝑥} ^ {3} +2000 {𝑥} ^ {4 } | <?> lsub {0} lsup {0.8}} over {0.8−0 ¿
𝑓
Multiple Application of the Trapezoidal Rule
One way to improve the accuracy of the trapezoidal rule is to divide the integration interval from a to b
into a number of segments and apply the method to each segment. The areas of individual segments can
then be added to yield the integral for the entire interval. The resulting equations are called multiple-
application, or composite ,integration formulas
There are n + 1 equally spaced base points (x0, x1, x2, . . . ,xn). Consequently, there are n segments of equal
width:
If a and b are designated as x0 and xn, respectively, the total integral can be represented as
n = 2 (h = 0.4):
I=(0.1/2)*(f(0)+f(0.1)*2+f(0.2)*2+f(0.3)*2+f(0.4)*2+f(0.5)*2+f(0.6)*2+f(0.7)*2+f(0.8))=1.6008
SIMPSON’S RULES
Aside from applying the trapezoidal rule with finer segmentation, another way to obtain a more accurate
estimate of an integral is to use higher-order polynomials to connect the points.
Example
if there is an extra point midway between f(a) and f(b), the three points can be connected with a parabola . If
there are two points equally spaced between f(a) and f(b), the four points can be connected with a third-order
polynomial
Simpson’s 1/3 Rule
if there is an extra point midway between f(a) and f(b), the three points can be connected with a parabola
Simpson’s 1/3 rule results when a second-order interpolating polynomial
If a and b are designated as x0 and x2 and f2(x) is represented by a second-order Lagrange polynomial
where, for this case, h = (b - a)/2. This equation is known as Simpson’s 1/3 rule. It is the second Newton-
Cotes closed integration formula. The label “1/3” stems from the fact that h is divided by 3
= =-4800/2=-2400
where -2400 is the average fourth derivative for the interval
The Multiple-Application Simpson’s 1/3 Rule
Just as with the trapezoidal rule, Simpson’s rule can be improved by dividing the integration interval
into a number of segments of equal width
the multiple-application version of Simpson’s 1/3 rule yields very accurate results. For this reason, it is considered
superior to the trapezoidal rule for most applications.
it is limited to cases where the values are equi-spaced. Further, it is limited to situations
where there are an even number of segments and an odd number of points.
Example 5.7: Use Multiple-Application Simpson’s 1/3 Rule with n = 4 to estimate the integral of
n = 4 (h = 0.2)
Simpson’s 3/8 Rule
In a similar manner to the derivation of the trapezoidal and Simpson’s 1/3 rule, a third order Lagrange
polynomial can be fit to four points and integrated:
where h =(b - a)/3. This equation is called Simpson’s 3/8 rule because h is multiplied by 3/8. It is the
third Newton-Cotes closed integration formula.
the 3/8 rule has utility when the number of segments is odd
Example 5.8: Use Simpson’s 3/8 rule to integrate
from a = 0 to b = 0.8
A single application of Simpson’s 3/8 rule requires four equally spaced points:
Use it in conjunction with Simpson’s 1/3 rule to integrate the same function for five segments.
The data needed for a five-segment application (h = 0.16) is
Needs 5 segments or 6 points (3 points(2 intervals) for
1/3 application, 4 points (3 intervals) for 3/8 application
=7 points-1 common point=6 points)
The integral for the first two segments is obtained using Simpson’s 1/3 rule :
For the last three segments, the 3/8 rule can be used to obtain