Solutions_3. 1 Exercise Exercise January 26, 2017

Σχετικά έγγραφα
Solutions 3. February 2, Apply composite Simpson s rule with m = 1, 2, 4 panels to approximate the integrals:

Lecture 5: Numerical Integration

Oscillatory integrals

Review-2 and Practice problems. sin 2 (x) cos 2 (x)(sin(x)dx) (1 cos 2 (x)) cos 2 (x)(sin(x)dx) let u = cos(x), du = sin(x)dx. = (1 u 2 )u 2 ( du)

ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ ΚΑΙ ΜΗΧΑΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Section 7.6 Double and Half Angle Formulas

Σχολή Εφαρμοσμένων Μαθηματικών και Φυσικών Επιστημών. Εθνικό Μετσόβιο Πολυτεχνείο. Thales Workshop, 1-3 July 2015.

2 Composition. Invertible Mappings

EE512: Error Control Coding

Areas and Lengths in Polar Coordinates

To find the relationships between the coefficients in the original equation and the roots, we have to use a different technique.

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Section 8.3 Trigonometric Equations

AMS 212B Perturbation Methods Lecture 14 Copyright by Hongyun Wang, UCSC. Example: Eigenvalue problem with a turning point inside the interval

Finite Field Problems: Solutions

Areas and Lengths in Polar Coordinates

The Simply Typed Lambda Calculus

Concrete Mathematics Exercises from 30 September 2016

Math221: HW# 1 solutions

Example Sheet 3 Solutions

Homework 3 Solutions

Some definite integrals connected with Gauss s sums

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

Srednicki Chapter 55

CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits.

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

Electromagnetic Waves I

Approximation of distance between locations on earth given by latitude and longitude

Matrices and Determinants

C.S. 430 Assignment 6, Sample Solutions

INTEGRAL INEQUALITY REGARDING r-convex AND

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

forms This gives Remark 1. How to remember the above formulas: Substituting these into the equation we obtain with

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

If ABC is any oblique triangle with sides a, b, and c, the following equations are valid. 2bc. (a) a 2 b 2 c 2 2bc cos A or cos A b2 c 2 a 2.

ST5224: Advanced Statistical Theory II

ES440/ES911: CFD. Chapter 5. Solution of Linear Equation Systems

derivation of the Laplacian from rectangular to spherical coordinates

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Second Order RLC Filters

Inverse trigonometric functions & General Solution of Trigonometric Equations

MathCity.org Merging man and maths

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

Solutions to Exercise Sheet 5

CHAPTER 101 FOURIER SERIES FOR PERIODIC FUNCTIONS OF PERIOD

Second Order Partial Differential Equations

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

6.3 Forecasting ARMA processes

Homework 8 Model Solution Section

Problem Set 3: Solutions

Variational Wavefunction for the Helium Atom

Section 9.2 Polar Equations and Graphs

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

PARTIAL NOTES for 6.1 Trigonometric Identities

9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr

SOLUTIONS TO PROBLEMS IN LIE ALGEBRAS IN PARTICLE PHYSICS BY HOWARD GEORGI STEPHEN HANCOCK

Statistical Inference I Locally most powerful tests

Pg The perimeter is P = 3x The area of a triangle is. where b is the base, h is the height. In our case b = x, then the area is

2. Μηχανικό Μαύρο Κουτί: κύλινδρος με μια μπάλα μέσα σε αυτόν.

ECE Spring Prof. David R. Jackson ECE Dept. Notes 2

Συστήματα Διαχείρισης Βάσεων Δεδομένων

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

I Feel Pretty VOIX. MARIA et Trois Filles - N 12. BERNSTEIN Leonard Adaptation F. Pissaloux. ι œ. % α α α œ % α α α œ. œ œ œ. œ œ œ œ. œ œ. œ œ ƒ.

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Section 7.7 Product-to-Sum and Sum-to-Product Formulas

Solution Series 9. i=1 x i and i=1 x i.

Trigonometric Formula Sheet

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

Other Test Constructions: Likelihood Ratio & Bayes Tests

1. For each of the following power series, find the interval of convergence and the radius of convergence:

Notes on the Open Economy

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Self and Mutual Inductances for Fundamental Harmonic in Synchronous Machine with Round Rotor (Cont.) Double Layer Lap Winding on Stator

( y) Partial Differential Equations

Numerical Analysis FMN011

Answer sheet: Third Midterm for Math 2339

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

CRASH COURSE IN PRECALCULUS

The challenges of non-stable predicates

Exercises to Statistics of Material Fatigue No. 5

Partial Differential Equations in Biology The boundary element method. March 26, 2013

Tridiagonal matrices. Gérard MEURANT. October, 2008

Chapter 7b, Torsion. τ = 0. τ T. T τ D'' A'' C'' B'' 180 -rotation around axis C'' B'' D'' A'' A'' D'' 180 -rotation upside-down C'' B''

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

Oscillation of Nonlinear Delay Partial Difference Equations. LIU Guanghui [a],*

Exercise 2: The form of the generalized likelihood ratio

4.6 Autoregressive Moving Average Model ARMA(1,1)

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

Written Examination. Antennas and Propagation (AA ) April 26, 2017.

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Every set of first-order formulas is equivalent to an independent set

CHAPTER (2) Electric Charges, Electric Charge Densities and Electric Field Intensity

(a,b) Let s review the general definitions of trig functions first. (See back cover of your book) sin θ = b/r cos θ = a/r tan θ = b/a, a 0

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

Εγχειρίδια Μαθηµατικών και Χταποδάκι στα Κάρβουνα

Part III - Pricing A Down-And-Out Call Option

Transcript:

s_3 Jnury 26, 217 1 Exercise 5.2.3 Apply composite Simpson s rule with m = 1, 2, 4 pnels to pproximte the integrls: () x 2 dx = 1 π/2 3, (b) cos(x) dx = 1, (c) e x dx = e 1, nd report the errors. () f(x) = x 2. For m = 1 we put h = (1 )/2 = 1/2, x =, x 1 = 1/2, x 2 = 1; y = f(x ) =, y 1 = f(x 1 ) = 1/4, y 2 = f(x 2 ) = 1. The pproximtion is then I h/3(y + 4y 1 + y 2 ) = ( + 4 1/4 + 1)/6 = 1/3. The error is thus. For m = 2 we hve h = (1 )/4 = 1/4, (x, x 1,..., x 4 ) = (, 1/4, 1/2, 3/4, 1), (y, y 1,..., y 4 ) = (, 1/16, 1/4, 9/16, 1). The pproximtion is then I h/3(y +4y 1 +2y 2 +4y 3 +y 4 ) = (+4 1/16+ 2 1/4 + 4 9/16 + 1)/12 = (1/4 + 2/4 + 9/4 + 4/4)/12 = 16/(3 4 4) = 1/3. The error is thus. One could continue with m = 3, but the error hs to be zero. Indeed, Simpson s rule is bsed on qudrtic interpoltion polynomils, which mens tht x 2 will be represented exctly by the interpolting polynomil nd the qudrture will be exct. (b) f(x) = cos(x) For m = 1 we put h = (π/2 )/2 = π/4, x =, x 1 = π/4, x 2 = π/2; y = f(x ) = 1, y 1 = f(x 1 ) = 1/ 2, y 2 = f(x 2 ) =. The pproximtion is then I h/3(y + 4y 1 + y 2 ) = (1 + 4/ 2 + ) π/12 1.227. The error is thus.227. For m = 2, h = π/8, (x,..., x 4 ) = (, π/8, π/4, 3π/8, π/2), (y,..., y 4 ) (1,.9238795, 1/ 2,.38268343, ). I h/3(y + 4y 1 + 2y 2 + 4y 3 + y 4 ) 1.135, giving the error.135. For m = 3, h = π/6, I 1.2631, errror.2631. (c) f(x) = exp(x) For m = 1 we put h = (1 )/2 = 1/2, x =, x 1 = 1/2, x 2 = 1; y = f(x ) = 1, y 1 = f(x 1 ) = e 1/2, y 2 = f(x 2 ) = e. The pproximtion is then I h/3(y + 4y 1 + y 2 ) = (1 + 4 e + e)/6 1.71886115. The error is thus 1.71886115 e + 1 5.79 1 4. For m = 2, h = 1/4, (x,..., x 4 ) = (, 1/4, 1/2, 3/4, 1),... I h/3(y + 4y 1 + 2y 2 + 4y 3 + y 4 ) 1.71831884192175, giving the error 3.7 1 5. For m = 3, h = 1/6, I 1.7182891699283, errror 7.34 1 6. 2 Exercise 5.2.11 Find the degree of precision of the following pproximtion for 1 f(x) dx: 1

First of ll, let us evlute the integrl of monomil x n, n : [ ] { x x n n+1 x=1, for odd n, dx = = n + 1 2/(n + 1), for even n. 1 x= 1 () f(1) + f( 1): Let us pply the qudrture to the monomil x n, n : { 1 n + ( 1) n, for odd n, = 2, for even n, Therefore the qudrture grees with the integrl for n =, 1 (nd ll odd n), nd its degree of precision is 1. (One could lso observe tht this is trpezoid qudrture on [ 1, 1], which is known to be exct for polynomils up to degree 1.) (b) 2/3[f(-1) + f() + f(1)]. We check the qudrture on monomils of incresing degree: 2, for n =, 2/3[( 1) n + n + ( 1) n ] =, for odd n, 4/3, for even n >, which grees with the integrl for n =, 1 (nd odd n). Thus degree of precision is 1. (c) We check the qudrture on monomils of incresing degree: [( 1/ 3) n + (1/ { 3) n, for odd n, ] = 2/3 n/2, for even n, which grees with the integrl for n =, 1, 2, 3 (nd odd n). Thus degree of precision is 3. (This is n exmple of Gussin qudrture, which re exct for polynomils of degree up to 2n 1 when n points re used.) 3 Exercise 5.2.16 Use the fct tht the error term of Boole s Rule (see Exercise 5.2.15) is proportionl to f (6) (c) to find the exct error term. We pply the qudrture to the monomil x 6, for which f (6) (c) 6!, for ll c. Thus 4h [ x x 6 7 dx = 7 ] x=4h x= = 47 h 7 7 = 2h 45 (7 6 + 32 h 6 + 12 (2h) 6 + 32 (3h) 6 + 7 (4h) 6 ) + C6! nd we re interested in finding C. In [1]: from sympy import * init_printing() h,c=symbols('h C') integrl = (4*h)**7/7 qudrture = 2*h/45*(32*h**6 + 12*(2*h)**6 + 32*(3*h)**6 + 7*(4*h)**6) simplify(integrl-qudrture) 2

Out[1]: Thus C = 128h 7 /(21 6!) = 8h 7 /945 128h7 21 4 Exercise 5.2.12 Wee need to find c 1, c 2, c 3 such tht the rule hs degree of precision greter thn one. To hve degree of precision we need tht f(x) dx c 1 f() + c 2 f(.5) + c 3 f(1) 1 dx = 1 = c 1 f() + c 2 f(.5) + c 3 f(1) = c 1 + c 2 + c 3. Similrly, for degree of precision 1 we need x dx = 1/2 = c 1 f() + c 2 f(.5) + c 3 f(1) =.5c 2 + c 3. Finlly, for degree of precision 2 we need x 2 dx = 1/3 = c 1 f() + c 2 f(.5) + c 3 f(1) =.25c 2 + c 3. This gives us 3 liner equtions in 3 unknowns, whose solution is c 1 = c 3 = 1/6, c 2 = 2/3. This is the sme s Simpson s rule. 5 Exercise 3b), Exm 8.216 L M [,b] f og T [,b] f være midpunkt og trpezoid kvdrturer med n = 1 pnel for funksjonen f på intervl [, b]. Feilestimtetene for disse kvdrturer er gitt v f(x) dx = M [,b] f + h3 24 f (c) + O(h 4 ), og f(x) dx = T [,b] f h3 12 f (c) + O(h 4 ), hvor c = ( + b)/2, og h = b. L oss definere en ny kvdrtur som Q [,b] f = αm [,b] f + βt [,b] f. Bestem verdiene α, β slik t : We hve f(x) dx = Q [,b] f + O(h 4 ). 3

nd therefore M [,b] f = T [,b] f = f(x) dx h3 24 f (c) + O(h 4 ), og f(x) dx + h3 12 f (c) + O(h 4 ), Q [,b] f = (α + β) As result we get system of equtions f(x) dx + (2β α) h3 24 + O(h4 ). α + β = 1, 2β α =. Thus α = 2/3, β = 1/3, which in fct gives us Simpson s rule: 6 Exercise 5.4.1 2 3 M [,b]f + 1 3 T [,b]f = 2h 3 f(c) + h 6 (f() + f(b)) = h [f() + 4f(c) + f(b)]. 6 Apply Adptive Qudrture by hnd, using the Trpezoid Rule with tolernce T OL =.5 to pproximte the integrls. Find the pproximtion error. () In this cse, f(x) = x 2, =, b = 1. We begin with n = 1 intervl, =, b = b. We will use S[, b] to denote the Trpezoid qudrture pplied on the intervl [, b]. c = ( + b)/2, S[, b] = ( 2 + 1 2 )/2 = 1/2, S[, c] = ( 2 + (1/2) 2 )/4 = 1/16, S[c, b] = ((1/2) 2 + 1 2 )/4 = 5/16. S[, b] S[, c] S[c, b] = 1/8 =.125 < 3.5 ((b )/(b )) =.15. Thus we stop with the pproximtion S[, c] + S[c, b] = 3/8 =.375 nd n error estimte (S[, b] S[, c] S[c, b])/3 = 1/24.417. The ctul integrtion error is x2 3/8 = 1/3 3/8 = 1/24. Our estimte is exct becuse f is constnt in this cse, thus the pproximte eqution (5.38) in the book is ctully exct. (b) f(x) = cos(x), =, b = π/2. S[, π/2] = (π/2) (1 + )/2 = π/2 1.578, S[, π/4] = (π/4) (1 + 1/ 2)/2.7854, S[π/4, π, 2] = (π/4) (1/ 2 + )/2.27768. S[, b] S[, c] S[c, b].5772 3.5 (π/2)/(π/2) =.15. Thus we need to split the intervl nd pply the dptive lgorithm recursively. S[, π/4] = (π/4) (1 + 1/ 2)/2.7854, S[, π/8] = (π/8) (1 + cos(π/8))/2.37775, S[π/8, π/4] = (π/8) (cos(π/8) + cos(π/4))/2.3224, S[, π/4] S[, π/8] S[π/8, π/4].8741 3.5 (π/4)/(π/2) =.75. Thus we need to split this intervl gin pply the dptive lgorithm recursively. S[, π/8] = (π/8) (1+cos(π/8))/2.37775, S[, π/16] = (π/16) (1+cos(π/16))/2.19446, S[π/16, π/8] = (π/16) (cos(π/16)+cos(π/8))/2.18699, S[, π/8] S[, π/16] S[π/16, π/8].37 < 3.5 (π/8)/(π/2) =.375. Thus we re done on the intervl [, π/8] with the pproximtion S[, π/16] + S[π/16, π/8].38145. 4

Let us look t the intervl [π/8, π/4] now. S[π/8, π/4] = (π/8) (cos(π/8) + cos(pi/4))/2.3224, S[π/8, 3π/16] = (π/16) (cos(π/8) + cos(3π/16))/2.17233, S[3π/16, π/4] = (π/16) (cos(3π/16) + cos(π/4))/2.1515, S[π/8, π/4] S[π/8, 3π/16] S[3π/16, π/4].314 < 3.5 (π/8)/(π/2) =.375. Thus we re done on the intervl [π/8, π/4] with the pproximtion S[π/8, 3π/16] + S[3π/16, π/4].32338. Let us look t the intervl [π/4, π/2] now. S[π/4, π/2] = (π/4) (cos(π/4) + cos(pi/2))/2.27768, S[π/4, 3π/8] = (π/8) (cos(π/4) + cos(3π/8))/2.21398, S[3π/8, π/2] = (π/8) (cos(3π/8) + cos(π/2))/2.7514, S[π/4, π/2] S[π/4, 3π/8] S[3π/8, π/2].1144 < 3.5 (π/4)/(π/2) =.75. Thus we re done on the intervl [π/4, π/2] with the pproximtion S[π/4, 3π/8] + S[3π/8, π/2].28912. There re no intervls left, nd therefore the finl pproximtion is.38145 +.32338 +.28912 =.99395 wheres the exct integrl is π/2 cos(x) = 1. Thus the error is.99395 1.6 <.5. (c) In this cse, f(x) = exp(x), =, b = 1. S[, 1] = (1 + e)/2 1.85914, S[,.5] = (1 + exp(.5))/4.66218, S[.5, 1] = (exp(.5) + exp(1))/4 1.9175. S[, b] S[, c] S[c, b].152 < 3.5 ((b )/(b )) =.15. Thus we stop with the pproximtion S[, c] + S[c, b] 1.75393 nd n error estimte (S[, b] S[, c] S[c, b])/3.35. The ctul integrtion error is exp(x) (S[, c] + S[c, b]).36. Our estimte is quite good in this cse. 7 Exercise 5.4.4 Develop n Adptive Qudrture method for rule (5.28). Let c = ( + b)/2, h = b nd pply the qudrture on [, b], [, c], nd [c, b] (we use the sme nottion s in the book): c f(x) dx + c f(x) dx = S[, b] + 14h5 45 f (4) (c 1 ), c 1 [, b], f(x) dx = S[, c] + S[c, b] + 14(h/2)5 45 f (4) (c 2 ) + 14(h/2)5 f (4) (c 3 ), 45 c 2 [, c], c3 [c, b]. Further ssuming tht f (4) (c 1 ) f (4) (c 2 ) f (4) (c 3 ) we obtin: c f(x) dx + c f(x) dx = S[, b] + 14h5 45 f (4) (c 1 ), f(x) dx S[, c] + S[c, b] + 1 14h 5 16 45 f (4) (c 1 ). We cn now subtrct the second eqution from the first to obtin: S[, b] S[, c] S[c, b] 15 1 14h 5 16 45 f (4) (c 1 ). 5

Thus the number S[, b] S[, c] S[c, b] gives n pproximtion to 15 times the error of the qudrture S[, c] + S[c, b]. The rest is exctly the sme s for other qudrtures; one stops subdividing the intervl when S[, b] S[, c] S[c, b] < 15 T OL (b )/(b orig orig ) nd returns S[, c] + S[c, b] s the pproximtion of the integrl over the intervl [,b]. 8 Computer exercise 5.2.8 Answers: () 1.547866 (b) 1.277978 (c) 1.277978 9 Computer exercise 5.2.1 See the file uniform_refinement.py vilble on the wiki. Adpt the code to use Simpson s rule insted of Trpezoid. 6