Lecture8

Lecture8 - Numerical Integration and Differentiation...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Numerical Integration and Differentiation EGN5455 cture 8 Lecture 8
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Numerical Integration: Trapezoid rule Objective: to approximate the integral on a given interval [a,b]. Assumption: f(x) is a scalar-valued function of x and has a continuous second derivative. To find the linear polynomial which interpolates (a,f(a)) and (b,f(b)), we can use Lagrange interpolation: a x b f b x a f ) )( ( ) )( ( a b b a
Background image of page 2
Trapezoid rule We integrate the Lagrange polynomial from a to b, with the result:  ). ( ) ( ) ( 2 1 a b b f a f Example1: Use the trapezoid rule to approximate the integral of f(x)=x 2 on interval [1,2].    5 . 2 1 2 ) 2 ( ) 1 ( 2 / 1 f f The actual value is 7/3= 2.33
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Why the error in the trapezoid rule? Taylor series approximation 1 here is the interval [ ,x 2 ) 2 ( ) 1 ( ) )( ( 2 ) )( ( ) ( ) ( x a f x a x f x f a f Where is in the interval [a,x]. e tegrate each side from a to b: We integrate each side from a to b:  3 ) 2 ( ) 1 ( ) )( ( 1 ) ( ) ( ) ( ) ( ) ( a b f dx x xf a af b af dx x f a b a f b a b a 6
Background image of page 4
Error analysis of trapezoid rule Recall from calculus the technique of integration by parts b a b a b a dx x g x f dx x g x f x g x f ) ( ) ( ) ( ) ( ) ( ) ( ) 1 ( ) 1 ( b a b a b a dx x f dx x xf x xf ) ( ) ( ) ( ) 1 (
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Error analysis of trapezoid rule By some simplifications, we can have  3 ) 2 ( ) ( ) ( 12 1 ) ( ) ( ) ( 2 1 ) ( a b f a b b f a f dx x f b a and approximately 3 ) 2 ( ) ( 12 1 ) ( ) ( ) ( 2 1 ) ( a b f a b b f a f dx x f b a 6
Background image of page 6
Error analysis of trapezoid rule Example 2: If on the interval [0,2], what is the estimated error using 8 intervals 2 ) ( x x f and what is the actual error? Since the second derivative of is 2, 2 x The actual and estimated error is: 3 3 4 12 2 2 What is the value of the integral?
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Composite-trapezoid We break-up the interval [a,b] into n equally sized subintervals and apply the trapezoid rule. If we divide the interval into n subintervals, the trapezoid applied to ith interval is: n a b h / ) (  h ih a f h i a f ) ( ) ) 1 ( ( 2 1
Background image of page 8
Composite-trapezoid If we add these n areas together, we have 1 1 ) ( ) ( 2 ) ( 2 n i b f ih a f a f h Assumptions: We assume the function is integrable nd for error analysis, it has a teg ab e ad o e o aa y s s ,t a s a continuous derivative.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Composite-trapezoid With a single trapezoid: 1/2( ( ) ( )) b T f f b h ith a composite trapezoid, we ivide the 0 , hb a Tf a fb  With a composite trapezoid, we divide the
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 32

Lecture8 - Numerical Integration and Differentiation...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online