Numerical Analysis/Gaussian Quadrature

From Wikiversity
Jump to navigation Jump to search

For the first example, I just want an example to show that the solution is exact for polynomials of degree , using the th degree Legendre polynomial. I'm going to approximate .

This problem accurately illustrates the method for solving problems using the Gaussian Quadrature algorithm. Note that the zeros of the Legendre polynomials of degree are and .

We can see from the previous example that this method works quite well if we are integrating from to , but in application, we rarely want to integrate over such a simple region. So in our next example, we will show that this technique is also effective if we change the limits of integration, as seen on the Wikipedia page, then we will solve the example

We will next show how to solve a problem that isn't a simple polynomial. We will approximate using a two point Gaussian approximation, and discuss the error analysis.

We will next analyze this error, looking at the actual error followed by finding the error bound. We denote the approximation by and the exact solution by .

The theoretical error bound when using the Legendre polynomial method is

In our example, the actual error was well within the error bound. We also see that with only two calculations, this is a very good algorithm for approximating integrals quickly with relatively good accuracy.

Exercises[edit | edit source]

1. Show that Gaussian Quadrature can solve exactly general cubic polynomials.

a) Set up the integral:

b) Evaluate the integral:

c) Evaluate the approximation:

d) Do parts b and c correspond?


2. Approximate using Gaussian Quadrature

a) Evaluate the problem symbolically:

b) Evaluate the approximation:

c) Find the actual error

d) Find the error bound

d) Is the actual error less than the error bound?


3. If are the roots of the th Legendre Polynomial and that for each , the numbers are defined by

Prove that if is any polynomial of degree less than , then

Gaussian Quadrature Example[edit | edit source]

I realized that there was insufficient information after the derived and solved sample on Gaussian Quadrature thus i took the pain to edit this wikiversity page by adding a solved example to the information already on there and below is what i factored in.


Find the constants C_0, C_1, and x_1 so that the quadrature formula

has the highest possible degree of precision.

Solution

Since there are three unknowns, C_0, C_1 and x_1, we will expect the formula to be exact for

Thus

Equation 2 and 3 will yield.

Hence

Now,

And

Thus the degree of the precision is 2

Example Quiz[edit | edit source]

1 Why do we use the zeros of the Legendre polynomials in this method?

By convention for consistency
Because Legendre polynomials of degree are orthogonal to any other polynomial with degree less than
Because they make when approximating
None of these

2 The integral of a 6th degree polynomial can be approximated exactly using the 3rd degree Legendre polynomial, True or False

True
False

3 Calculate the error bound for a general 3rd degree polynomial using a 2nd order Legendre polynomial

10.56
0
4.13
50.25

4 Calculate the error bound for using a 3rd degree Legendre polynomial

5.85
0.13
28.83
12.44

5 What are the failure conditions for this algorithm?

The th derivative of must be nonzero
is discontinuous over the range of integration
is constant over the range
The method never fails, it just can suffer from poor accuracy