Вы находитесь на странице: 1из 3

Mohsin Raza/Handout 8 -1- Numerical Analysis CS-572

Lecture 14
Numerical Integration
The need often arises for evaluating the definite integral of a function that has no explicit
anti-derivative or whose anti-derivative is not easy to obtain.
The basic method involved in approximating
( )
b
a
f x dx
}
is called numerical quadrature.
let us consider formulas produced by using first and second Lagrange polynomials with
equally-spaced nodes. This gives the Trapezoidal rule and Simpsons rule,
Recall (handout 1 lecture 2)
Theorem 1.13 (Weighted mean value theorem for integrals)
Suppose
| |
, , f C a b e the Riemann integral of g exists on
| |
a , b , and
( )
g x does not
change sign on
| |
, , a b then there exists a number c in
( )
a , b , with
( ) ( ) ( ) ( )
b b
a a
f x g x dx f c g x dx =
} }

The Trapezoidal Rule
When we use the term trapezoid we mean a four-sided figure that has at least two of its sides
parallel. The European term for this figure is trapezium. To further confuse the issue, the
European word trapezoidal refers to a four-sided figure with no sides equal, and the
American word for this type of figure is trapezium.
Derivation of Trapezoidal Formula
To derive the Trapezoidal rule for approximating
( )
b
a
f x dx
}
,let
0
, x a =
1
, x b h b a = =
and use the linear Lagrange polynomial:






Mohsin Raza/Handout 8 -2- Numerical Analysis CS-572






Note
The error term for the Trapezoidal rule involves ( )
f x '' , so the rule gives the exact result
when applied to any function whose second derivative is identically zero, that is, any
polynomial of degree one or less.

Mohsin Raza/Handout 8 -3- Numerical Analysis CS-572

Class Task
Compare the Trapezoidal rule and Simpsons rule approximations to
( )
2
0
f x dx
}
when
( )
f x is

Solution


-------------------------------------------------------------------------------------------


This lesson is identical to the lecture which is presented in the Class and
this lesson is not intended as a complete set of lecture for the course: there
are many things explained in the lecture that arent in these notes.
Important for the Readers

Вам также может понравиться