GAUSS QUADRATURE RULE

INTERACTIVE E-BOOK

INTEGRATION

MAJOR

GENERAL

 On non Internet Explorer browsers, the equations may not show up.

As an alternative or if you prefer,

you can see the pdf version of the ebook instead

Title

An interactive e-book for illustrating Gauss Quadrature Rule for numerical integration.

Creator

Autar K Kaw

Subject and Keywords

Gauss Quadrature Rule, Numerical Integration, Mathcad, Maple, Mathematica, Matlab, Simulations.

Description

An interactive E-book for illustrating Gauss Quadrature Rule.  It includes links to simulations in Mathcad, Maple, Mathematica and Matlab for the algorithm, multiple choice quizzes, problem set, and a PowerPoint presentation.

Publisher

Holistic Numerical Methods Institute,

College of Engineering,

University of South Florida, Tampa, FL 33620-5350.

Contributors

Autar Kaw, Michael Keteltas

Format

Text/HTML

Last Revised

June 14, 2004

Identifier

http://numericalmethods.eng.usf.edu/ebooks/gaussquadrature_07int_ebook.pdf

Language

English

Rights

http://numericalmethods.eng.usf.edu/rights.htm

 

Table of Contents

Background

       What is integration

Gauss Quadrature Rule

        Two-point Gaussian Quadrature Rule

        Higher point Gaussian Quadrature formulas

        PowerPoint presentation

Derivation of Gaussian Quadrature Rule

         Method 1

         Method 2  

         Higher point Gaussian Quadrature formulas

         Argument and weighing factors for n-point Gauss Quadrature Rules

Examples

          Example 1:  Two-point Gauss Quadrature

          Example 2:  Derive the 1-point Gauss Quadrature

          Example 3:  Derivation of a formula

          Example 4: Two-point Gauss Quadrature application problem

          Example 5: Three-point Gauss Quadrature application problem

Simulation

          Method ([MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB])

          Convergence ([MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB])

Problem Sets

              Multiple choice question examination

              A set of homework assignment problems

Background

This is an example of how an instructor of a Numerical Methods course can develop an E-book on a single topic by using resources that are only available at the Holistic Numerical Methods Institute (HNMI) Website.

Although one of the primary advantages of a web-based resource is that one can use documents outside of its own domain, we are particularly using this example as a way to illustrate the holistic nature of the resources available at HNMI.   You are welcome to modify and edit this e-book to suit your purpose.

Using the textbook document written in MS Word 2000 as a foundation, it was made interactive within MS Word 2000 by putting bookmarks and hyperlinks to background information, PowerPoint presentations, Mathcad simulations, historical anecdotes, multiple choice tests, problem sets, etc.   Then the MS Word 2000 file was saved as a webpage and that is what you are about to read here.

Back to TOC

 

What is integration?

Integration is the process of measuring the area under a function plotted on a graph.  Why would we want to do so?  Among the most common examples are finding the velocity of a body from acceleration functions, and displacement of a body from velocity data.  Throughout the engineering fields, there are (what sometimes seems like) countless applications for integral calculus.  Sometimes, the evaluation of expressions involving these integrals can become daunting, if not indeterminate.  For this reason, a wide variety of numerical methods have been developed to simplify the integral.  Here, we will discuss the Gauss Quadrature Rule of integral approximation.

 

 

 

 

 

 

 


 

Figure 1: Integration of a function

Back to TOC

GAUSS QUADRATURE RULE:

Background

Previously, we developed Trapezoidal Rule and Simpson’s 1/3rd Rule by several methods.  One of them was the method of undetermined coefficients.

To derive Trapezoidal rule from the method of undetermined coefficients, we approximated

                                                                                               (1)

Let the right hand side be exact for integrals of a straight line, that is, for integrated form

           

So

           

                                                                                                 (2)

But from Equation (1), we want

                                                                                       (3)

to give the same result as Equation (2) for .

           

                                                                                              (4)

Hence from Equations (2) and (4),

           

Since  and  are arbitrary constants for a general straight line

              

                                                                                                      (5.a,b)

Multiply Equation (5a) by a and subtracting from Equation (5b) gives

                                                                                                                      (6a) 

Substituting the above found value of in Equation (5a) gives

                                                                                                            (6b)

Therefore

           

                                                                                                  (7)

Back to TOC

Derivation of two-point Gaussian Quadrature Rule

Method 1:

The two-point Gauss Quadrature Rule is an extension of the Trapezoidal Rule approximation where the arguments of the function are not predetermined as  and , but as unknowns  and .  So in the two-point Gauss Quadrature Rule, the integral is approximated as

           

  

There are four unknowns , ,  and .  These are found by assuming that the formula gives exact results for integrating a general third order polynomial, .  Hence

           

                          

                                                  (8)

The formula would then give

             (9)

Equating Equations (8) and (9) gives

                            (10)

Since in Equation (10), the constants    and  are arbitrary, the coefficients of    and are equal.  This gives us four equations as follows.

              

         

          

                                                                                                     (11)

Without proof (see Example 1 for proof of a related problem), we can find that the above four simultaneous nonlinear equations have only one acceptable solution

           

           

           

                                                                                              (12)

Hence

           

                                                                                                                                          (13)

Back to TOC

Method 2:

We can derive the same formula by assuming that the expression gives exact values for integrals of individual integrals of    and .  The reason the formula can also be derived using this method is that the linear combination of the above integrands is a general third order polynomial given by.

These will give four equations as follows

 

             

           

                                                                          (14)

These four simultaneous nonlinear Equations (14) can be solved with a single acceptable solution

           

           

           

                                                                                  (15)

Hence

       (16)

Since two points are chosen, it is called the two-point Gauss Quadrature Rule.  Higher point versions can also be developed.

 

Simulations

          Method ([MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB])

          Convergence ([MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB])

 

Back to TOC

Higher point Gaussian Quadrature Formulas

For example

                                                             (17)

is called the three-point Gauss Quadrature Rule.  The coefficients ,  and , and the function arguments ,  and  are calculated by assuming the formula gives exact expressions for integrating a fifth order polynomial .  General n-point rules would approximate the integral

                                             (18)

Back to TOC

Arguments and weighing factors for n-point Gauss Quadrature Rules

In handbooks (see Table 1), coefficients and arguments given for n-point Gauss Quadrature Rule are given for integrals of the form

                                                                                          (19)

Table 1: Weighting factors  and function arguments

used in Gauss Quadrature formulas

 

Points

Weighting

Factors

Function

Arguments

2

 

 

3

 

 

 

4

 

 

 

 

5

 

 

 

 

 

6

 

 

 

 

 

 

 

 

 

So if the table is given for  integrals, how does one solve ?

The answer lies in that any integral with limits of  can be converted into an integral with limits .  Let

                                                                                                            (20)

If  then

If  then

such that

           

                                                                                                          (21)

Solving these two simultaneous linear Equations (21) gives

           

                                                                                                              (22)

Hence

           

Substituting our values of  and  into the integral gives us

                                                           (23)

 

Back to TOC

Example 1

For an integral  show that the two-point Gauss Quadrature rule approximates to

           

where

           

           

           

           

Solution

Assuming the formula                                         (E1.1)

gives exact values for integrals    and   .  Then       

                                                                                                         (E1.2)

                                                                                                 (E1.3)

                                                                                            (E1.4)

                                                                                             (E1.5)

Multiplying Equation (E1.3) by  and subtracting from Equation (E1.5) gives

            .                                                                                           (E1.6)

The solution to the above equation is

 or/and

 or/and

 or/and

            .

I.                     is not acceptable as Equations (E1.2-E1.5) reduce to   and .  But since, then  from , but conflicts with

II.                  is not acceptable as Equations (E1.2-E1.5) reduce to ; .  Since , then  or  has to be zero but this violates .

III.                is not acceptable as Equations (E1.2-E1.5) reduce to ; .  If , then gives  and that violates .  If , then violates

That leaves the solution of as the only possible acceptable solution and in fact, it does not have violations (see it for yourself)

                                                                                                                        (E1.7)

Substituting (E1.7) in Equation (E1.3) gives

                                                                                                                                                (E1.8)

From Equations (E1.2) and (E1.8),

                                                                                                                     (E1.9)

Equations (E1.4) and (E1.9) gives

                                                                                                  (E1.10)

Since Equation (E1.7) requires that the two results be of opposite sign, we get

           

           

Hence

                                     (E1.11)

 

Back to TOC

Example 2

For an integral,  derive the one-point Gaussian Quadrature Rule.

Solution

The one-point Gaussian quadrature rule is

                                                                                           (E2.1)

Assuming the formula gives exact values for integrals  and

           

                                                                                      (E2.2)

Since  the other equation becomes

           

                                                                                             (E2.3)

Therefore, one-point Gauss Quadrature Rule can be expressed as

                                                                            (E2.4)

 

Back to TOC

Example 3

What would be the formula for

if you want the above formula to give you exact values of  that is a linear combination of  and .

Solution 

If the formula is exact for linear combination of  and , then

 

                                                                        (E3.1)

Solving the two Equations (E3.1) simultaneously gives

       

                                                                         (E3.2)

So

                          (E3.3)

Let us see if the formula works.

Evaluate  using the above formula.

 

The exact value of  is given by

           

           

           

 

Any surprises? 

Now evaluate  using the above formula

             

                       

                       

The exact value of  is given by

 

 

Because the formula will only give exact values for linear combinations of  and , it does not work exactly even for a simple integral of .

Do you see now why we choose  as the integrand for which the formula

           

gives us exact values?

Back to TOC

Example 4

Use two-point Gauss Quadrature Rule to approximate the distance covered by a rocket from  to  as given by

           

Also, find the absolute relative true error.

Solution

First, change the limits of integration from * to  using Equation 23 gives

           

                         

Next, get weighting factors and function argument values from Table 1 for the two point rule,

            .

Now we can use the Gauss Quadrature formula

           

                                        

                                        

    

                                        

since

                                

          

                                

The absolute relative true error, , is (Exact value = 11061.34m)

           

                 

 

Back to TOC

Example 5

Use three-point Gauss Quadrature Rule to approximate the distance covered by a rocket from  to  as given by

           

Also, find the absolute relative true error.

Solution:

First, change the limits of integration from * to  using Equation (23) gives

           

                         

The weighting factors and function argument values are

           

and the formula is

           

           

           

since

           

                                

           

                                

           

                                  

 

The absolute relative true error, , is (Exact value = 11061.34m)

           

                 

 

Back to TOC

Problem Set

 

1..The upward velocity of a rocket is given by 

v(t)= 200 ln(t+1) ‑ 10 t, t>0,

where t is given in seconds and v is given in meters per second.

a)      Use 2-point Gauss Quadrature rule to calculate the distance covered by the rocket form t=0 to t=5 s. 

b)      What is the true value of the distance covered by the rocket form t=0 to t=5 s?

c)      What is the true error in part (a)?

d)      What is the relative true error in part (a)?

e)      What is the absolute relative true error in percentage for part (a).

f)        Use 3-point Gauss Quadrature rule to calculate the distance covered by the rocket form t=0 to t=5 s.

            Answer: a) 1035m       b) 1025m c) –10m, d) -0.9756%, e) 0.9756% f) 1025 m       

 

2..The velocity of a body is given by 

                      v(t)=(t +1), 0<t<2, and v(t)=33  2<t<5, 

where the velocity, v(t) is given in m/s and t is in seconds.

a)      Find the distance covered by the body between 1<t<1.9 seconds by using the two-point Gauss quadrature rule. Find the absolute relative true error.

b)      Find the distance covered by the body between 1<t<1.9 seconds by four-segment Trapezoidal rule.  Find the absolute relative true error.

c)      Find the distance covered by the body between 1<t<3.9 seconds by using the two-point Gauss quadrature rule. Find the absolute relative true error.

d)      Find the distance covered by the body between 1<t<3.9 seconds by four-segment Trapezoidal rule.  Find the absolute relative true error.

 

Answer: a) 2.205, 0%   b) 2.205%, 0%   c) 51.63m, 20.81%     d)62.51m, 4.12%

 

3..A scientist develops an approximate formula for integration as

.

The values of c1 and c2 are found by assuming that the formula is exact for the functions of the form a0x+a1x2 polynomial.

a)         Find the values of c1 and c2

b)      Verify the formula works exactly for the integral of

c)      Verify the formula does not work exactly for the integral of

 

Answer: a) c1=;c2=

              b) 447.7          c) 10 (exact) 12.976 (by formula)

 

*4..Find the value of the integral e-t dt using 2-point Gaussian Quadrature rule.

Answer: 0.3473

 

*5..The one-point Gauss Quadrature rule is defined as

 

, where a ≤ x1≤ b.

 

The values of c1 and x1 are found by assuming that the one-point formula is exact for any first order polynomial.  Find c1 in the above one-point Gauss quadrature rule.

Answer: b-a

 

*6..The one-point Gauss Quadrature rule is defined as

 

, where a ≤ x1≤ b.

 

The values of c1 and x1 are found by assuming that the one-point formula is exact for any first order polynomial.  Find x1 in the above one-point Gauss quadrature rule.

Answer: (b+a)/2

 

*7..A scientist develops an approximate formula for integration as

 

, where a ≤ x1≤ b.

The values of c1 and x1 are found by assuming that the formula is exact for the functions of the form a0x+a1x2 polynomial.  Find c1 and x1.

Answer:

Multiple choice question examination

Back to TOC