Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

NUMERICAL

INTEGRATION
Dr.rer.nat. Wiwin Windupranata
GD2203 Estimation and Approximation
Geodesy and Geomatics Engineering Study
Program, FITB - ITB
04/05/2015 Dr.rer.nat. Wiwin Windupranata 2

Newton-Cotes Integration Formula


• The Newton-Cotes formulas are the most common
numerical integration schemes.
• They are based on the strategy of replacing a complicated
function or tabulated data with an approximating function
that is easy to integrate
04/05/2015 Dr.rer.nat. Wiwin Windupranata 3

Newton-Cotes Integration Formula

The approximation of an integral by the area under


(a) a single straight line and (b) a single parabola
04/05/2015 Dr.rer.nat. Wiwin Windupranata 4

Newton-Cotes Integration Formula

The approximation of an integral by the area under three straight-line segments


04/05/2015 Dr.rer.nat. Wiwin Windupranata 5

Newton-Cotes Integration Formula

The difference between


(a) closed and (b) open integration formulas
04/05/2015 Dr.rer.nat. Wiwin Windupranata 6

The Trapezoidal Rule


• The trapezoidal rule is the first of the Newton-Cotes
closed integration formulas.
• It corresponds to the case where the polynomial is in the
first-order:
04/05/2015 Dr.rer.nat. Wiwin Windupranata 7

The Trapezoidal Rule


04/05/2015 Dr.rer.nat. Wiwin Windupranata 8

The Trapezoidal Rule

Graphical depiction of the trapezoidal rule

or
04/05/2015 Dr.rer.nat. Wiwin Windupranata 9

The Trapezoidal Rule

(a) The formula for computing the area of a trapezoid: height times
the average of the bases.
(b) For the trapezoidal rule, the concept is the same but the trapezoid
is on its side.
04/05/2015 Dr.rer.nat. Wiwin Windupranata 10

The Trapezoidal Rule


• Error in the Trapezoidal Rule

Graphical depiction of
the use of a single
application of the
trapezoidal rule to
approximate the
integral of

f(x) = 0.2 + 25x − 200x2 +


675x3 − 900x4 + 400x5

from x = 0 to 0.8
04/05/2015 Dr.rer.nat. Wiwin Windupranata 11

The Trapezoidal Rule


Example
• Use the trapezoidal rule to numerically integrate the
following equation for a=0 to b=0.8

• Exact solution ???


1.640533
04/05/2015 Dr.rer.nat. Wiwin Windupranata 12

The Trapezoidal Rule


• Approximate Error
04/05/2015 Dr.rer.nat. Wiwin Windupranata 13

The Multiple App. of 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
Illustration of the multiple application
trapezoidal rule.
(a) two segments,
(b) three segments,
(c) four segments, and
(d) five segments.
04/05/2015 Dr.rer.nat. Wiwin Windupranata 14

The Multiple App. of Trapezoidal Rule


• 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
04/05/2015 Dr.rer.nat. Wiwin Windupranata 15

The Multiple App. of Trapezoidal Rule


04/05/2015 Dr.rer.nat. Wiwin Windupranata 16

The Multiple App. of Trapezoidal Rule


04/05/2015 Dr.rer.nat. Wiwin Windupranata 17

The Multiple App. of Trapezoidal Rule


Example
• Use the two-segment trapezoidal rule to estimate the
integral of

• from a = 0 to b = 0.8, remember the correct value is


1.640533
04/05/2015 Dr.rer.nat. Wiwin Windupranata 18

The Multiple App. of Trapezoidal Rule

• Notice how the error decreases as the number of segments


increases. However, also notice that the rate of decrease is
gradual.
• This is because the error is inversely related to the square of n
04/05/2015 Dr.rer.nat. Wiwin Windupranata 19

Quiz
• Use the multiple application of trapezoidal rule to estimate
the integral of

• for n = 3 to 10, remember the exact value is 1.640533


04/05/2015 Dr.rer.nat. Wiwin Windupranata 20

Simpson’s Rule
• 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
• For example, if there is an extra point midway between
f(a) and f(b), the points can be connected with a parabola
or with a third-order polynomial
• The formulas that result from taking the integrals under
these polynomials are called Simpson’s rules.
04/05/2015 Dr.rer.nat. Wiwin Windupranata 21

Simpson’s Rule

(a) Graphical depiction of Simpson’s 1/3 rule: It consists of taking the area under a
parabola connecting three points.
(b) Graphical depiction of Simpson’s 3/8 rule: It consists of taking the area under
a cubic equation connecting four points.
04/05/2015 Dr.rer.nat. Wiwin Windupranata 22

Simpson’s 1/3 Rule


• Simpson’s 1/3 Rule uses second order interpolating
polynomial
04/05/2015 Dr.rer.nat. Wiwin Windupranata 23

Simpson’s 1/3 Rule


• After integration and algebraic manipulation
04/05/2015 Dr.rer.nat. Wiwin Windupranata 24

Simpson’s 1/3 Rule


Example
• Use the Simpson’s 1/3 Rule to estimate the integral of

• from a = 0 to b = 0.8, remember the correct value is


1.640533
04/05/2015 Dr.rer.nat. Wiwin Windupranata 25

The Multiple App. of Simp’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 total integral can be represented as


04/05/2015 Dr.rer.nat. Wiwin Windupranata 26

The Multiple App. of Simp’s 1/3 Rule


• Substituting Simpson’s 1/3 rule for the individual integral
yields

• or
04/05/2015 Dr.rer.nat. Wiwin Windupranata 27

The Multiple App. of Simp’s 1/3 Rule

Graphical representation of the multiple application of Simpson’s 1/3


rule. Note that the method can be employed only if the number of
segments is even.
04/05/2015 Dr.rer.nat. Wiwin Windupranata 28

The Multiple App. of Simp’s 1/3 Rule


• Error Estimate

• Where is the fourth derivative for the interval


• Using the previous example
04/05/2015 Dr.rer.nat. Wiwin Windupranata 29

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

• to yield

• where h = (b – 1)/3
04/05/2015 Dr.rer.nat. Wiwin Windupranata 30

Simpson’s 3/8 Rule


• 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 can also be expressed in the form of

• and the approximate error


04/05/2015 Dr.rer.nat. Wiwin Windupranata 31

THANK YOU
Dr.rer.nat. Wiwin Windupranata
GD2203 Estimation and Approximation
Geodesy and Geomatics Engineering Study
Program, FITB - ITB

You might also like