The Comparison of the Trapezoid Rule and the Gaussian Quadrature

Total Page:16

File Type:pdf, Size:1020Kb

The Comparison of the Trapezoid Rule and the Gaussian Quadrature The Comparison of the Trapezoid Rule and the Gaussian Quadrature Margo Rothstein Georgia College and State University May 3, 2018 1 Abstract This paper provides a detailed exploration of the comparison of the Gaussian Quadrature and the Trapezoid Rule. They are both numerical methods that are used to approximate integrals. The Gaussian Quadrature is a much better approximation method than the Trapezoid Rule. We will prove and demonstrate the approximating power of both rules, and provide some practical applications of the rules as well. 2 Introduction Integration is the calculation of the the theorem states the following: area under the curve a function f(x). The integral of f produces a family of an- Z b tiderivatives F (x)+c that is used to calculate f(x)dx = F (b) − F (a): the area, denoted by, a Z f(x)dx: There are many methods developed to find F (x) that will produce the exact area. These A definite integral calculates the area under methods include integration by parts, par- the curve of a function f(x) on a specific in- tial fraction decomposition, change of vari- terval [a; b], denoted by, ables, and trig substitution. However, there are some functions that can not be inte- Z b grated exactly. They must be approximated. f(x)dx: We will discuss two approximation methods a in numerical analysis called the Trapezoid The Fundamental Theorem of Calculus is Rule and the Gaussian Quadrature. The how a definite integral should be calculated; definition of a Quadrature rule for nodes 1 x1 < x2 < x − 3 < ··· < xn is n Z b X f(x)dx ≈ cif(xi): a i=1 A closed quadrature rule means that f(x) is evaluated at the endpoints. An open quadrature rule is when f(x) is not evalu- ated at the endpoints. 3 Trapezoid Rule The Trapezoid Rule is a closed rule will format the area of the trapezoid so Quadrature rule where f(x) is only evalu- that it matches the definition. Note the fol- ated at the endpoints a and b on the inter- lowing: val [a; b]. Visually on a graph, we see the Z b f(a) + f(b) line that passes through points (a; f(a)) and f(x)dx = (b − a) 2 (b; f(b)), which forms a trapezoid with the a (b − a) x-axis. Thus, the area under the curve can = (f(a) + f(b)) be approximated by the area a Trapezoid, as 2 (b − a) (b − a) shown in Figure 1. = f(a) + f(b) 2 2 Figure 1 = c1f(a) + c2f(b) 2 y X = cif(xi): i=1 f(b) The area of a Trapezoid is now in the form of a Quadrature Rule with n = 2. Note that (b−a) c1 = c2 = 2 . That is, the coefficients f(a) are always that same. Since the Trapezoid Rule takes the area under a linear function, the value of the summation is exact only for polynomials of degree ≤ 1. For every poly- a b x nomial of degree > 1, the Trapezoid Rule will over- or under- approximate. Consider the Lagrange Polynomial interpolation for 2 points (x ; f(x )) and (x ; f(x )). The area of a Trapezoid is, 0 0 1 1 (x − x1) (x − x0) 00 Z b f(a) + f(b) P1(x) = f(x0) + f(x1) + Of (cx) f(x)dx = (b − a): x0 − x1 x1 − x0 a 2 00 where Of (cx) is the error term from the Since the Trapezoid Rule is a Quadrature approximation and cx depends continuously 2 on x0 and x1. For a linear function f(x) = tions, we will see how the coefficients and kx + C for some constants k and C, the nodes of the Gaussian Quadrature are spe- second derivative f 00(x) = 0. Therefore, cially chosen to produce high accuracy for whenever f(x) is a linear function, the er- higher degree polynomials. First, we will ex- ror will be zero and thus the approximation plore some underlying information about the will be exact. In the next couple of sec- Legendre Polynomials. 4 The Gaussian Quadrature 4.1 Legendre Polynomials Before we learn about the Gaussian why the property of orthogonal functions is Quadrature, we need to understand the Leg- valuable for the Gaussian Quadrature. endre Polynomials. The Legendre Poly- nomials are a set of nonzero polynomials Theorem (1): If fp1; p2; :::; png is a set of nonzero orthogonal polynomials on the S = fP1(x);P2(x);P3(x) ::: g that are or- thogonal on the interval [−1; 1]. By the def- closed interval [a; b] where the degree of inition of orthogonal, every pi = i for i 2 f1; 2; :::; ng, then every p has i distinct roots on the interval (a; b). ( i Z 1 = 0 if i 6= j Pi(x)Pj(x)dx = By Theorem (1), every P (x) 2 S has i dis- 6= 0 if i = j: i −1 tinct roots on [−1; 1]. We will refer back to The next Theorem will help us understand these roots in the following section. 4.2 Gaussian Quadrature Recall that the Trapezoid Rule is exactly nomials. Z 1 accurate for polynomials of degree ≤ 1. Sup- 1dx = c1 + c2; pose we wanted to develop a Quadrature rule −1 that is accurate for polynomials of a much Z 1 higher degree. Hence, we want a linear com- xdx = c1(x1) + c2(x2); ∗ −1 bination of values f(xi ) that is either ex- Z 1 actly or very close to the actual value of the 2 2 2 integral. Say that we want to integrate a x dx = c1(x1) + c2(x2) ; −1 polynomial function P (x) on [−1; 1] where i Z 1 n = 2. 3 3 3 x dx = c1(x1) + c2(x2) : −1 Z 1 2 X Since we have four unknowns c1, c2, x1, and P (x)dx = ciP (xi) = c1P (x1)+c2P (x2): x2, and 4 equations, we have a solvable sys- −1 i=1 tem. When this system is solved, we obtain q 1 q 1 Consider the integrals of the first four poly- c1 = c2 = 1, x1 = 3 and x2 = − 3 . Note 3 q q 1 1 nd a given n, the Gaussian Quadrature is exact that 3 and − 3 are the roots of the 2 degree Legendre polynomial. When we ex- up to polynomials of degree 2n − 1. Clearly, tend this example to the general nth case, this is a much more accurate method than th the Trapezoid Rule. Table 1 gives the roots we obtain that each xi is a root of the i Legendre polynomial. and coefficients up to n = 4. R 1 −1 dx = c1 + c2 + ::: +cn = 2 R 1 −1 xdx = c1x1 + c2x2 + ::: +cnxn = 0 Table 1 ::: n xi ci R 1 2n−2 2n−2 2n−2 1 x dx = c1x1 + ::: +cnxn = 2 p 1 −1 3 (−1)2n−1 1 − p−1 1 2n−1 2n−1 3 q 3 5 R 1 2n−1 2n−1 2n−1 3 − x dx = c1x + ::: +cnx = 5 9 −1 1 n 8 2n 0 1 − (−1) 9 2n 2n q 3 5 5 9 q p p We have that the Gaussian Quadrature 15+2 30 90−5 30 4 − 35 180 is a linear combination of the function f(x) q p p th 15−2 30 90+5 30 evaluated at the roots of the n Legendre − 35 180 th q p p polynomial. In the n case shown, we can 15−2 30 90+5 30 35 180 see that the degree of the last polynomial in q p p 15+2 30 90−5 30 the series of equations is 2n − 1. Hence, for 35 180 5 Comparison of Applications We will look at a simple example that Now, we show the result from the Gaussian will demonstrate the accuracy of the Gaus- Quadrature with two points. sian Quadrature and the Trapezoid Rule. r r Consider the integral of f(x) = x2 from Z 1 1 1 1 1 2 x2dx = ( )2 + (− )2 = + = : [−1; 1]. The exact value of this integral can −1 3 3 3 3 3 be found by the standard integration rule for polynomials. We see that the Gaussian Quadrature pro- duced the exact answer, while the Trapezoid Z 1 3 Rule was off by 4 . 2 x 1 1 −1 2 3 x dx = j−1 = − ( ) = : −1 3 3 3 3 Consider the integral of a function f(x) The next integral is the result from using the on [a; b] 6= [−1; 1]. The integral is not Trapezoid Rule. given on [−1; 1], and therefore the Gaussian Quadrature cannot be applied directly to it. Z 1 2 (1 − (−1)) 2 2 We must use a substitution for x in order x dx = ((−1) +(1) ) = (1)(2) =to 2 normalize: the function onto [−1; 1]. Let −1 2 4 a = k1t1 + k2 and b = k1t2 + k2, where t1 interval is half of [−1; 1]. and t are the upper and lower bounds of the 2 Z 1 Z 1 1 1 1 interval we want to normalized [a; b] to. In tan−1(x)dx = tan−1( t + ) dt 0 −1 2 2 2 this particular case, [t1; t2] = [−1; 1]; that is, 1 1 r1 1 1 1 r1 1 t1 = −1 and t2 = 1. Note that adding and = (tan−1( ( )) + ) + (tan−1( (− )) + ) 2 2 3 2 2 2 3 2 subtracting a and b yield the following: p p 1 3 + 3 1 − 3 + 3 = (tan−1( )) + (tan−1( )) 2 6 2 6 a + b = −k + k + k + k = 2k , 1 2 1 2 2 ≈ 0:4380: a − b = −k1 + k2 − k1 − k2 = −2k1.
Recommended publications
  • Differential Calculus and by Era Integral Calculus, Which Are Related by in Early Cultures in Classical Antiquity the Fundamental Theorem of Calculus
    History of calculus - Wikipedia, the free encyclopedia 1/1/10 5:02 PM History of calculus From Wikipedia, the free encyclopedia History of science This is a sub-article to Calculus and History of mathematics. History of Calculus is part of the history of mathematics focused on limits, functions, derivatives, integrals, and infinite series. The subject, known Background historically as infinitesimal calculus, Theories/sociology constitutes a major part of modern Historiography mathematics education. It has two major Pseudoscience branches, differential calculus and By era integral calculus, which are related by In early cultures in Classical Antiquity the fundamental theorem of calculus. In the Middle Ages Calculus is the study of change, in the In the Renaissance same way that geometry is the study of Scientific Revolution shape and algebra is the study of By topic operations and their application to Natural sciences solving equations. A course in calculus Astronomy is a gateway to other, more advanced Biology courses in mathematics devoted to the Botany study of functions and limits, broadly Chemistry Ecology called mathematical analysis. Calculus Geography has widespread applications in science, Geology economics, and engineering and can Paleontology solve many problems for which algebra Physics alone is insufficient. Mathematics Algebra Calculus Combinatorics Contents Geometry Logic Statistics 1 Development of calculus Trigonometry 1.1 Integral calculus Social sciences 1.2 Differential calculus Anthropology 1.3 Mathematical analysis
    [Show full text]
  • Squaring the Circle a Case Study in the History of Mathematics the Problem
    Squaring the Circle A Case Study in the History of Mathematics The Problem Using only a compass and straightedge, construct for any given circle, a square with the same area as the circle. The general problem of constructing a square with the same area as a given figure is known as the Quadrature of that figure. So, we seek a quadrature of the circle. The Answer It has been known since 1822 that the quadrature of a circle with straightedge and compass is impossible. Notes: First of all we are not saying that a square of equal area does not exist. If the circle has area A, then a square with side √A clearly has the same area. Secondly, we are not saying that a quadrature of a circle is impossible, since it is possible, but not under the restriction of using only a straightedge and compass. Precursors It has been written, in many places, that the quadrature problem appears in one of the earliest extant mathematical sources, the Rhind Papyrus (~ 1650 B.C.). This is not really an accurate statement. If one means by the “quadrature of the circle” simply a quadrature by any means, then one is just asking for the determination of the area of a circle. This problem does appear in the Rhind Papyrus, but I consider it as just a precursor to the construction problem we are examining. The Rhind Papyrus The papyrus was found in Thebes (Luxor) in the ruins of a small building near the Ramesseum.1 It was purchased in 1858 in Egypt by the Scottish Egyptologist A.
    [Show full text]
  • J. Wallis the Arithmetic of Infinitesimals Series: Sources and Studies in the History of Mathematics and Physical Sciences
    J. Wallis The Arithmetic of Infinitesimals Series: Sources and Studies in the History of Mathematics and Physical Sciences John Wallis was appointed Savilian Professor of Geometry at Oxford University in 1649. He was then a relative newcomer to mathematics, and largely self-taught, but in his first few years at Oxford he produced his two most significant works: De sectionibus conicis and Arithmetica infinitorum. In both books, Wallis drew on ideas originally developed in France, Italy, and the Netherlands: analytic geometry and the method of indivisibles. He handled them in his own way, and the resulting method of quadrature, based on the summation of indivisible or infinitesimal quantities, was a crucial step towards the development of a fully fledged integral calculus some ten years later. To the modern reader, the Arithmetica Infinitorum reveals much that is of historical and mathematical interest, not least the mid seventeenth-century tension between classical geometry on the one hand, and arithmetic and algebra on the other. Newton was to take up Wallis’s work and transform it into mathematics that has become part of the mainstream, but in Wallis’s text we see what we think of as modern mathematics still 2004, XXXIV, 192 p. struggling to emerge. It is this sense of watching new and significant ideas force their way slowly and sometimes painfully into existence that makes the Arithmetica Infinitorum such a relevant text even now for students and historians of mathematics alike. Printed book Dr J.A. Stedall is a Junior Research Fellow at Queen's University. She has written a number Hardcover of papers exploring the history of algebra, particularly the algebra of the sixteenth and 159,99 € | £139.99 | $199.99 ▶ seventeenth centuries.
    [Show full text]
  • The Legendre Transform Ross Bannister, May 2005 Orthogonality of the Legendre Polynomials the Legendre Polynomials Satisfy the Following Orthogonality Property [1], 1
    The Legendre Transform Ross Bannister, May 2005 Orthogonality of the Legendre polynomials The Legendre polynomials satisfy the following orthogonality property [1], 1 2 ¥ ¥§¦ ¥ ¤ ¤ d x Pn ¤ x Pm x mn 1 © 2n ¨ 1 x ¡£¢ 1 ¥ where Pn ¤ x is the nth order Legendre polynomial. In meteorology it is sometimes convenient to integrate over the latitude domain, , instead of over x. This is achieved with the following transform, d x ¦ ¦ ¦ ¥ ¤ x sin cos d x cos d 2 d In latitude (measured in radians), Eq. (1) becomes, /2 2 ¥ ¥ ¥§¦ ¤ ¤ d cos Pn ¤ Pm mn 3 ¨ © 2n 1 ¡£¢ /2 The Legendre transform and its inverse convert to and from the latitudinal and Legendre polynomial representations of functions (I call this these transforms a Legendre transform pair). In the following we shall develop these transforms in matrix form. The matrix form of the transforms is a compact and convenient means of performing summations over and over n (we shall assume that functions are represented discreetly in space and so integrals are represented by summations). In the notation to follow, functions are represented as vectors. A function in space shall be denoted by the vector x, and a function in n space shall be denoted by p. Let the matrix consisting of columns of Legendre polynomials be F. The orthogonality condition, Eq. (3), in matrix form is, T ¦ ¥ ¤ F PF 4 where P is the so-called diagonal inner product matrix whose diagonal elements are cos and is the ¨ ¥ diagonal matrix whose diagonal elements are the normalizations 2 / ¤ 2n 1 . Legendre transform pair ('unbalanced' version) The orthogonality condition, Eq.
    [Show full text]
  • Calculation of Highly Oscillatory Integrals by Quadrature Methods
    CALCULATION OF HIGHLY OSCILLATORY INTEGRALS BY QUADRATURE METHODS A Senior Scholars Thesis by KRISHNA THAPA Submitted to Honors and Undergraduate Research Texas A&M University in partial fulfillment of the requirements for the designation as UNDERGRADUATE RESEARCH SCHOLAR May 2012 Major: Physics CALCULATION OF HIGHLY OSCILLATORY INTEGRALS BY QUADRATURE METHODS A Senior Scholars Thesis by KRISHNA THAPA Submitted to Honors and Undergraduate Research Texas A&M University in partial fulfillment of the requirements for the designation as UNDERGRADUATE RESEARCH SCHOLAR Approved by: Research Advisor: Stephen Fulling Associate Director, Honors and Undergraduate Research: Duncan MacKenzie May 2012 Major: Physics iii ABSTRACT Calculation of Highly Oscillatory Integrals by Quadrature Methods. (May 2012) Krishna Thapa Department of Physics Texas A&M University Research Advisor: Dr. Stephen Fulling Department of Mathematics R 1 i!g(x) Highly oscillatory integrals of the form I(f) = 0 dxf(x)e arise in various problems in dynamics, image analysis, optics, and other fields of physics and math- ematics. Conventional approximation methods for such highly oscillatory integrals tend to give huge errors as frequency (!) ! 1. Over years, various attempts have been made to get over this flaw by considering alternative quadrature methods for integration. One such method was developed by Filon in 1928, which Iserles et al. have recently extended. Using this method, Iserles et al. show that as ! ! 1, the error decreases further as the error is inversely proportional to !. We use methods developed by Iserles' group, along with others like Newton-Cotes, Clenshaw-Curtis and Levin's methods with the aid of Mathematica. Our aim is to find a systematic way of calculating highly oscillatory integrals.
    [Show full text]
  • Numerical Integration of Functions with Logarithmic End Point
    FACTA UNIVERSITATIS (NIS)ˇ Ser. Math. Inform. 17 (2002), 57–74 NUMERICAL INTEGRATION OF FUNCTIONS WITH ∗ LOGARITHMIC END POINT SINGULARITY Gradimir V. Milovanovi´cand Aleksandar S. Cvetkovi´c Abstract. In this paper we study some integration problems of functions involv- ing logarithmic end point singularity. The basic idea of calculating integrals over algebras different from the standard algebra {1,x,x2,...} is given and is applied to evaluation of integrals. Also, some convergence properties of quadrature rules over different algebras are investigated. 1. Introduction The basic motive for our work is a slow convergence of the Gauss-Legendre quadrature rule, transformed to (0, 1), 1 n (1.1) I(f)= f(x) dx Qn(f)= Aνf(xν), 0 ν=1 in the case when f(x)=xx. It is obvious that this function is continuous (even uniformly continuous) and positive over the interval of integration, so that we can expect a convergence of (1.1) in this case. In Table 1.1 we give relative errors in Gauss-Legendre approximations (1.1), rel. err(f)= |(Qn(f) − I(f))/I(f)|,forn = 30, 100, 200, 300 and 400 nodes. All calculations are performed in D- and Q-arithmetic, with machine precision ≈ 2.22 × 10−16 and ≈ 1.93 × 10−34, respectively. (Numbers in parentheses denote decimal exponents.) Received September 12, 2001. The paper was presented at the International Confer- ence FILOMAT 2001 (Niˇs, August 26–30, 2001). 2000 Mathematics Subject Classification. Primary 65D30, 65D32. ∗The authors were supported in part by the Serbian Ministry of Science, Technology and Development (Project #2002: Applied Orthogonal Systems, Constructive Approximation and Numerical Methods).
    [Show full text]
  • Numerical Construction of Gaussian Quadrature Formulas For
    mathematics of computation, VOLUME 27, NUMBER 124, OCTOBER 1973 Numerical Construction of Gaussian Quadrature Formulas for / (-Log *)• xa-f(x)-dx and / Em(x)-j(x)-dx Jo Jo By Bernard Danloy Abstract. Most nonclassical Gaussian quadrature rules are difficult to construct because of the loss of significant digits during the generation of the associated orthogonal poly- nomials. But, in some particular cases, it is possible to develop stable algorithms. This is true for at least two well-known integrals, namely ¡l-(Loêx)-x°f(x)dx and ¡Ô Em(x)f(x)-dx. A new approach is presented, which makes use of known classical Gaussian quadratures and is remarkably well-conditioned since the generation of the orthogonal polynomials requires only the computation of discrete sums of positive quantities. Finally, some numerical results are given. 1. Introduction. Let w(x) be a nonnegative weight function on (a, b) such that all its moments (1.1) M*= / w(x)-x"-dx, k = 0, 1, 2, ••■ , exist. The «-point Gaussian quadrature rule associated with w(x) and (a, b) is that uniquely defined linear functional (1.2) G„-/= ¿X, •/(*,) ¿-i which satisfies (1.3) G„/ = [ w(x)-j(x)-dx Ja whenever / is a polynomial of degree ^ 2n — 1. It is a well-known result [8] that the Gaussian abscissas *¿ are the roots of the polynomials orthogonal on (a, b) with respect to w(x), and that the associated coeffi- cients X,, called Christoffel constants, can also be expressed in terms of these poly- nomials. A direct exploitation of these results is still the most widely recommended procedure, even though alternative approaches have been suggested by Rutishauser [7], Golub and Welsch [6].
    [Show full text]
  • Convolution Quadrature and Discretized Operational Calculus. II*
    Numerische Numer. Math. 52, 413-425 (1988) Mathematik Springer-Verlag 1988 Convolution Quadrature and Discretized Operational Calculus. II* C. Lubich Institut ffir Mathematik und Geometrie,Universit~it Innsbruck, Technikerstrasse 13, A-6020 Innsbruck, Austria Summary. Operational quadrature rules are applied to problems in numerical integration and the numerical solution of integral equations: singular inte- grals (power and logarithmic singularities, finite part integrals), multiple time- scale convolution, Volterra integral equations, Wiener-Hopf integral equa- tions. Frequency domain conditions, which determine the stability of such equations, can be carried over to the discretization. Subject Classifications: AMS(MOS): 65R20, 65D30; CR: G1.9. 6. Introduction In this paper we give applications of the operational quadrature rules of Part I to numerical integration and the numerical solution of integral equations. It is the aim to indicate problem classes where such methods can be applied success- fully, and to point out features which distinguish them from other approaches. Section 8 deals with the approximation of integrals with singular kernel. This comes as a direct application of the results of Part I. In Sect. 9 we study the numerical approximation of convolution integrals whose kernel has components at largely differing time-scales. In Sect. 10 we give a case study for a problem in chemical absorption kinetics. There a system of an ordinary differential equation coupled with a diffusion equation is reduced to a single Volterra integral equation. This reduction is achieved in a standard way via Laplace transform techniques and, as is typical in such situations, it is the Laplace transform of the kernel (rather than the kernel itself) which is known a priori, and which is of a simple form.
    [Show full text]
  • Simplifying Integration for Logarithmic Singularities R.N.L. Smith
    Transactions on Modelling and Simulation vol 12, © 1996 WIT Press, www.witpress.com, ISSN 1743-355X Simplifying integration for logarithmic singularities R.N.L. Smith Department of Applied Mathematics & OR, Cranfield University, RMCS, Shrivenham, Swindon, Wiltshire SN6 SLA, UK Introduction Any implementation of the boundary element method requires consideration of three types of integral - simple non-singular integrals, singular integrals of two kinds and those integrals which are 'nearly singular' (Brebbia and Dominguez 1989). If linear elements are used all integrals may be per- formed exactly (Jaswon and Symm 1977), but the additional complexity of quadratic or cubic element programs appears to give a significant gain in efficiency, and such elements are therefore often utilised; These elements may be curved and can represent complex shapes and changes in boundary variables more effectively. Unfortunately, more complex elements require more complex integration routines than the routines for straight elements. In dealing with BEM codes simplicity is clearly desirable, particularly when attempting to show others the value of boundary methods. Non-singular integrals are almost invariably dealt with by a simple Gauss- Legendre quadrature and problems with near-singular integrals may be overcome by using the same simple integration scheme given a sufficient number of integration points and some restriction on the minimum distance between a given element and the nearest off-element node. The strongly singular integrals which appear in the usual BEM direct method may be evaluated using the row sum technique which may not be the most efficient available but has the virtue of being easy to explain and implement.
    [Show full text]
  • Handout on Gaussian Quadrature, Parts I and II
    Theoretical foundations of Gaussian quadrature 1 Inner product vector space Definition 1. A vector space (or linear space) is a set V = {u, v, w,...} in which the following two operations are defined: (A) Addition of vectors: u + v ∈ V , which satisfies the properties (A1) associativity: u + (v + w) = (u + v) + w ∀ u, v, w in V ; (A2) existence of a zero vector: ∃ 0 ∈ V such that u + 0 = u ∀u ∈ V ; (A3) existence of an opposite element: ∀u ∈ V ∃(−u) ∈ V such that u + (−u) = 0; (A4) commutativity: u + v = v + u ∀ u, v in V ; (B) Multiplication of a number and a vector: αu ∈ V for α ∈ R, which satisfies the properties (B1) α(u + v) = αu + αv ∀ α ∈ R, ∀u, v ∈ V ; (B2) (α + β)u = αu + βu ∀ α, β ∈ R, ∀u ∈ V ; (B3) (αβ)u = α(βu) ∀ α, β ∈ R, ∀u ∈ V ; (B4) 1u = u ∀u ∈ V . Definition 2. An inner product linear space is a linear space V with an operation (·, ·) satisfying the properties (a) (u, v) = (v, u) ∀ u, v in V ; (b) (u + v, w) = (u, w) + (v, w) ∀ u, v, w in V ; (c) (αu, v) = α(u, v) ∀α ∈ R, ∀ u, v, w in V ; (d) (u, u) ≥ 0 ∀u ∈ V ; moreover, (u, u) = 0 if and only if u = 0. d Example. The “standard” inner product of the vectors u = (u1, u2, . , ud) ∈ R and d v = (v1, v2, . , vd) ∈ R is given by d X (u, v) = uivi . i=1 1 Example. Let G be a symmetric positive-definite matrix, for example 5 4 1 G = (gij) = 4 7 0 .
    [Show full text]
  • [Draft] 4.4.3. Examples of Gaussian Quadrature. Gauss–Legendre
    CAAM 453 · NUMERICAL ANALYSIS I Lecture 26: More on Gaussian Quadrature [draft] 4.4.3. Examples of Gaussian Quadrature. Gauss{Legendre quadrature. The best known Gaussian quadrature rule integrates functions over the interval [−1; 1] with the trivial weight function w(x) = 1. As we saw in Lecture 19, the orthogonal polynomials for this interval and weight are called Legendre polynomials. To construct a Gaussian quadrature rule with n + 1 points, we must determine the roots of the degree-(n + 1) Legendre polynomial, then find the associated weights. First, consider the case of n = 1. The quadratic Legendre polynomial is 2 φ2(x) = x − 1=3; and from this polynomialp one can derive the 2-point quadrature rule that is exact for cubic poly- nomials, with roots ±1= 3. This agrees with the special 2-point rule derived in Section 4.4.1. The values for the weights follow simply, w0 = w1 = 1, giving the 2-point Gauss{Legendre rule p p I(f) = f(−1= 3) + f(1= 3): For Gauss{Legendre quadrature rules based on larger numbers of points, there are various ways to compute the nodes and weights. Traditionally, one would consult a book of mathematical tables, such as the venerable Handbook of Mathematical Functions, edited by Milton Abramowitz and Irene Stegun for the National Bureau of Standards in the early 1960s. Now, one can look up these quadrature nodes and weights on web sites, or determine them to high precision using a symbolic mathematics package such as Mathematica. Most effective of all, one can compute these nodes and weights by solving a symmetric tridiagonal eigenvalue problem.
    [Show full text]
  • Chapter 6 Numerical Integration
    Chapter 6 Numerical Integration In many computational economic applications, one must compute the de¯nite integral of a real-valued function f de¯ned on some interval I of n. Some applications call for ¯nding the area under the function, as in comp<uting the change in consumer welfare caused by a price change. In these instances, the integral takes the form f(x) dx: ZI Other applications call for computing the expectation of a function of a random variable with a continuous probability density p. In these instances the integral takes the form f(x)p(x) dx: ZI We will discuss only the three numerical integration techniques most com- monly encountered in practice. Newton-Cotes quadrature techniques employ a strategy that is a straightforward generalization of Riemann integration principles. Newton-Cotes methods are easy to implement. They are not, however, the most computationally e±cient way of computing the expec- tation of a smooth function. In such applications, the moment-matching strategy embodied by Gaussian quadrature is often substantially superior. Finally, Monte Carlo integration methods are discussed. Such methods are simple to implement and are particularly useful for complex high-dimensional integration, but should only be used as a last resort. 1 6.1 Newton-Cotes Quadrature Consider the problem of computing the de¯nite integral f(x) dx Z[a;b] of a real-valued function f over a bounded interval [a; b] on the real line. Newton-Cotes quadrature rules approximate the integrand f with a piece- wise polynomial function f^ and take the integral of f^ as an approximation of the integral of f.
    [Show full text]