You are on page 1of 12

Gaussian

Gaussian
Quadratures
Quadratures
Newton-Cotes Formulae
use evenly-spaced functional values
Did not use the flexibility we have to select the quadrature points
In fact a quadrature point has several degrees of freedom.
Q(f)=
i=1
m
c
i
f(x
i
)
A formula with m function evaluations requires specification of
2m numbers c
i
and x
i
Gaussian Quadratures
select both these weights and locations so that a higher order
polynomial can be integrated (alternatively the error is proportional
to a higher derivatives)
Price: functional values must now be evaluated at non-
uniformly distributed points to achieve higher accuracy
Weights are no longer simple numbers
Usually derived for an interval such as [-1,1]
Other intervals [a,b] determined by mapping to [-1,1]
Gaussian Quadrature on [-1, 1]
Two function evaluations:
Choose (c1, c2, x1, x2) such that the method yields exact
integral for f(x) = x
0
, x
1
, x
2
, x
3
) x ( f c ) x ( f c ) x ( f c ) x ( f c dx ) x ( f
n n 2 2 1 1 i
1
1
n
1 i
i
+ + + =

=
L
) f(x c ) f(x c
f(x)dx : 2 n
2 2 1 1
1
1
+ =
=

x
2
x
1 -1 1
Finding quadrature nodes and weights
One way is through the theory of orthogonal
polynomials.
Here we will do it via brute force
Set up equations by requiring that the 2m points
guarantee that a polynomial of degree 2m-1 is integrated
exactly.
In general process is non-linear
(involves a polynomial function involving the unknown point
and its product with unknown weight)
Can be solved by using a multidimensional nonlinear solver
Alternatively can sometimes be done step by step
Gaussian Quadrature on
Gaussian Quadrature on
[
[
-
-
1, 1]
1, 1]
Exact integral for f = x
0
, x
1
, x
2
, x
3
Four equations for four unknowns
) f(x c ) f(x c f(x)dx : 2 n
2 2 1 1
1
1
+ = =

=
=
=

+ = = =
+ = = =
+ = = =
+ = = =

3
1
x
3
1
x
1 c
1 c

x c x c 0 dx x x f
x c x c
3
2
dx x x f
x c x c 0 xdx x f
c c 2 dx 1 1 f
2
1
2
1
3
2 2
3
1
1
1
1
3 3
2
2 2
2
1
1
1
1
2 2
2 2 1
1
1
1
2
1
1
1
)
3
1
( f )
3
1
( f dx ) x ( f I
1
1
+ = =

Error
If we approximate a function with a Gaussian quadrature
formula we cause an error proportional to 2n th
derivative
Gaussian Quadrature on
Gaussian Quadrature on
[
[
-
-
1, 1]
1, 1]
Choose (c
1
, c
2
, c
3
, x
1
, x
2
, x
3
) such that the method
yields exact integral for f(x) = x
0
, x
1
, x
2
, x
3
,x
4
, x
5
) x ( f c ) x ( f c ) x ( f c dx ) x ( f : 3 n
3 3 2 2 1 1
1
1
+ + = =

x
3
x
1 -1 1
x
2
Gaussian Quadrature on
Gaussian Quadrature on
[
[
-
-
1, 1]
1, 1]
5
3 3
5
2 2
5
1 1
1
1
5 5
4
3 3
4
2 2
4
1 1
1
1
4 4
3
3 3
3
2 2
3
1 1
1
1
3 3
2
3 3
2
2 2
2
1 1
1
1
2 2
3 3 2 2 1 1
1
1
3 2 1
1
1
0
5
2
0
3
2
0
2 1
x c x c x c dx x x f
x c x c x c dx x x f
x c x c x c dx x x f
x c x c x c dx x x f
x c x c x c xdx x f
c c c xdx f
+ + = = =
+ + = = =
+ + = = =
+ + = = =
+ + = = =
+ + = = =

=
=
=
=
=
=

5 / 3
0
5 / 3
9 / 5
9 / 8
9 / 5
3
2
1
3
2
1
x
x
x
c
c
c
Gaussian Quadrature on
Gaussian Quadrature on
[
[
-
-
1, 1]
1, 1]
Exact integral for f = x
0
, x
1
, x
2
, x
3,
x
4
, x
5
)
5
3
( f
9
5
) 0 ( f
9
8
)
5
3
( f
9
5
dx ) x ( f I
1
1
+ + = =

Gaussian Quadrature on
Gaussian Quadrature on
[a, b]
[a, b]
Coordinate transformation from [a,b] to [-1,1]
t
2
t
1
a b


=
+
+

=
1
1
1
1
b
a
dx ) x ( g dx )
2
a b
)(
2
a b
x
2
a b
( f dt ) t ( f

= =
= =
+
+

=
b t 1 x
a t 1 x
2
a b
x
2
a b
t
Example: Gaussian Quadrature
Example: Gaussian Quadrature
Evaluate
Coordinate transformation
Two-point formula
33.34%) ( 543936 . 3477 376279 . 3468 167657324 . 9
e )
3
4
4 ( e )
3
4
4 ( )
3
1
( f )
3
1
( f dx ) x ( f I
3
4
4
3
4
4
1
1
= = + =
+ + = +

= =
+

926477 . 5216 dt te I
4
0
t 2
= =



+
= + = =
= + =
+
+

=
1
1
1
1
4 4
4
0
2
) ( ) 4 4 (
2dx dt ; 2 2
2 2
dx x f dx e x dt te I
x
a b
x
a b
t
x t
Example: Gaussian Quadrature
Example: Gaussian Quadrature
Three-point formula
Four-point formula
4.79%) ( 106689 . 4967
) 142689 . 8589 (
9
5
) 3926001 . 218 (
9
8
) 221191545 . 2 (
9
5
e ) 6 . 0 4 4 (
9
5
e ) 4 (
9
8
e ) 6 . 0 4 4 (
9
5
) 6 . 0 ( f
9
5
) 0 ( f
9
8
) 6 . 0 ( f
9
5
dx ) x ( f I
6 . 0 4 4 6 . 0 4
1
1
= =
+ + =
+ + + =
+ + = =
+

[ ]
[ ]
%) 37 . 0 ( 54375 . 5197
) 339981 . 0 ( f ) 339981 . 0 ( f 652145 . 0
) 861136 . 0 ( f ) 861136 . 0 ( f 34785 . 0 dx ) x ( f I
1
1
= =
+ +
+ = =

Other rules
Gauss-Lobatto:
requiring end points be included in the formula
Gauss-Radau
Require one end point be in the formula

You might also like