solhw9

# solhw9 - Solutions for Homework 9 Foundations of...

This preview shows pages 1–3. Sign up to view the full content.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions for Homework 9 Foundations of Computational Math 2 Spring 2011 Problem 9.1 In this problem we consider the numerical approximation of the integral I = integraldisplay 1 1 f ( x ) dx with f ( x ) = e x . In particular, we use a priori error estimation to choose a step size h for Newton Cotes or a number of points for a Gaussian integration method. 9.1.a Consider the use of the composite Trapezoidal rule to approximate the integral I . Use the fact that we have an analytical form of f ( x ) to estimate the error using the composite trapezoidal rule and to determine a stepsize h so that the error will be less than or equal to the tolerance 10 2 . Approximately how many points does your h require? Solution: We must use the error expression for the composite trapezoidal rule, the expression for the appropriate derivative bound, and the required tolerance to get an a priori estimate for h . f ( x ) = e x = f ( x ) f ( x ) f (1) 2 . 72 E =- h 2 12 ( b- a ) f ( ) h 2 12 10 2 ( b- a ) f ( ) = . 06 f ( ) . 06 2 . 72 . 02 h . 14 n = ( b- a ) h = 2 . 14 14 steps Using the composite trapezoidal rule yields the following results: n I n I- I n 2 2 . 5308- . 1926 8 2 . 3623- . 01223 14 2 . 3544- . 00399 16 2 . 35346- . 00305 1 9.1.b Consider the use of the Gauss-Legendre method to approximate the integral I . Use n = 1, i.e., two points x and x 1 with weights and 1 . Use the fact that we have an analytical form of f ( x ) to estimate the error that will result from using the two-point Gauss-Legendre method to approximate the integral. How does your estimate compare to the tolerance 10 2 used in the first part of the question? Recall that for n = 1 we have the Gauss Legendre nodes x - . 5774 and x 1 . 5774. Apply the method to approximate I and compare its error to your prediction. The true value is I = integraldisplay 1 1 e x dx 2 . 3504 Solution: Recall the error formula for Gauss Legendre E = 2 2 n +3 [( n + 1)!] 4 (2 n + 3) [(2 n + 2)!] 3 f (2 n +2) ( ) We have f (2 n +2) ( x ) = e x e 1 2 . 72 and for n = 1 E = 2 5 [2!] 4 5 [4!] 3 (2...
View Full Document

## This note was uploaded on 11/10/2011 for the course MAD 5404 taught by Professor Gallivan during the Spring '11 term at FSU.

### Page1 / 8

solhw9 - Solutions for Homework 9 Foundations of...

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

View Full Document
Ask a homework question - tutors are online