Chapter 4
Numerical Integration and Differentiation
Lecture 4.5
Books: (1) Numerical Methods for Engineer and Scientists, by Joe D, Hoffman, McGraw Hill Publication
(ii) ) Numerical Methods for Engineers by Chapra and Canale
In the numerical integration so far we discussed Trapezoidal and Simpson rules. In these methods, as we discussed
earlier, to achieve more accuracy in the results we need to increase the number of intervals.
So we now study more methods for numerical integrations which
are more accurate as compared to
Romberg Integration: Romberg integration is based on successive applications of Trapezoidal rule to obtain more accurate results for the
integral of functions with less efforts.
In order to understand about the Romberg
integration we first understand about Richardson’s Extrapolation.
Richardson’s Extrapolation: These methods use two estimates to get more accurate approximation.
The estimate and error associated with a multiple-application trapezoidal rule can be represented as,
---(1)
where I is the exact value of the integral. I(h) is approximation from an n-segment application of trapezoidal rule and h = (b-a)/n is step size.
Suppose we have two different step sizes h1 and h2 such that
---(2) Error of n-segment trapezoidal rule is given
approximately by
---(3)
Suppose is independent of step size, then using (3), We can write the ratio of errors,
We can further write Eq. (4) as
---(5)
Using (5) in (2), We get
---(6)
We use Eqn (6) into following Eq.
---(7)
and get an improved estimate for the result of Integral
---(8)
Error of above estimate is O(h4) and hence more
If h = h/2, then we have,
Example: Integrate the following function from
a = 0 to b = 0.8 using improved method discussed On last slides. Exact value of integral is 1.640533.
Now we combine the estimates for the one and two segments from given table to get an improved result using (9). We get
The error in improved estimate is
If we use 2 and 4 segment trap rule from table then improved result is
So far we combined the integral with error of order (h2)
to find improved estimate of the integral with error of order (h4).
Now we can combined the integrals of order (h4) to find
More improved estimate of order (h6). Equation for
Integral estimate will be
Two integral of order (h6) can be combined to compute
an integral of order (h8) and Equation is
Example: In last examples we obtained two estimates for the integral of order (h4). These were 1.367467 and 1.623467.
Using these we can find more accurate estimate for integral of order (h6) . So we get
Romberg Integration Algorithm : The Romberg integration is implemented using
In above Eq. and are more and less accurate integrals respectively.
Index k signifies level of accuracy. k= 1 corresponds to ordinary Trapezoidal rule (O(h2)).
k =2 corresponds to (O(h4)) and k = 3 corresponds
to (O(h6)). j distinguish between more (j+1) and less (j)
Gauss Quadrature Formula: In the Newton Cotes formula which we discussed so far the position
of base point was predetermine or fixed.
The formula for trapezoidal rule which give area under straight line is given by
As can be seen from fig there can be situations
However note that if we are free to choose the end points within which we have to join the
straight line, then suitably choosing the end points
we can decrease the error in result. Gauss Quadrature formula is one such technique to implement above
Method of undetermined Coefficients: From the method of undetermined coefficients we shall
first find the Trapezoidal rule. This will help
us in implementing the Gauss Quadrature formula.
We can write using Eq. (1), the following Eq.
We can write following two equations for constant function and straight line respectively
And
Solving further we get
---(3) .
Solving (3) and (4), we get
---(5)
Using (5) in (2), we get
----(6)
Two Point Gauss Legendre Formula: For
Gauss quadrature formula we consider equation
---(7)
Where c’s are unknwon coefficients. In above Eq., in contrast to Trapezoidal
rule, now we have arguments x0 and x1 which are not fixed at end points but are unknown. So we have
To get four conditions, we assume that Eq. (7) fit integral of constant, integral of linear function, integral of parabolic ( y=x2) and integral of
cubic (y=x3) function exactly.
---(8)
---(9)
---(10)
Solving above four equations simultaneously we get following values for unkowns
Using above values in Eq. (7) we get two point Gauss Legendre Formula
---(12)
Note that in above calculations we used the integration limits -1 to +1. We can change other limits to above
limits. For this we consider a linear relation between new variable xd and original variable x i.e.
---(13)
Now let lower limit x = a corresponds to xd = -1. Using These in above equation we get
---(14) For upper limit x = b, xd = +1. So we get from (13),
Solving (14) and (15) we get
---(15)
---(16) Using (15) and (16) in (13) we get
---(17)
Differentiating above eq, we have
Example: Integrate following integral from limits x = 0 to 0.8 using Two point Guass Quadrature
Technique
ANS: We first change the limits a = 0 and b = 0.8 to -1 and +1. We have using (17) and (18),
---(19)
Using (19) and (20) in original equation we get,
---(21)
Now note that the right side of above eq. is in form which is suitable for implementing Gauss
The transformed function can be evaluated at -1/sqrt(3) and 1/sqrt(3).
Finally we get following value for integral of given function