ec7fa5d1609343965c348c9459526377.jpeg
Document Details

Uploaded by KindlyHeliotrope7228
Columban College, Inc.
Full Transcript
# Lecture 24 ## Numerical Integration: Gaussian Quadrature ### Motivation We want to approximate the integral $\qquad \int_a^b f(x) dx$ ### Newton-Cotes * Use values of $f(x)$ at equally spaced points. * Approximate $f(x)$ by polynomial interpolation. * Integrate the polynomial approximatio...
# Lecture 24 ## Numerical Integration: Gaussian Quadrature ### Motivation We want to approximate the integral $\qquad \int_a^b f(x) dx$ ### Newton-Cotes * Use values of $f(x)$ at equally spaced points. * Approximate $f(x)$ by polynomial interpolation. * Integrate the polynomial approximation analytically. ### Problems with Newton-Cotes * Requires $f(x)$ to be known at equally spaced points. * For high-order polynomials, the weights can be negative, leading to instability. ### Gaussian Quadrature * Chooses points $x_i$ and weights $w_i$ to maximize accuracy. * Based on orthogonal polynomials. ### Legendre Polynomials * Orthogonal on the interval $[-1, 1]$ with weight function $w(x) = 1$. * Satisfy the recurrence relation $\qquad (n+1)P_{n+1}(x) = (2n+1)xP_n(x) - nP_{n-1}(x)$ * First few Legendre polynomials: * $P_0(x) = 1$ * $P_1(x) = x$ * $P_2(x) = \frac{1}{2}(3x^2 - 1)$ * $P_3(x) = \frac{1}{2}(5x^3 - 3x)$ ### Gaussian Quadrature Formula $\qquad \int_{-1}^1 f(x) dx \approx \sum_{i=1}^n w_i f(x_i)$ where $x_i$ are the roots of the Legendre polynomial $P_n(x)$ and the weights $w_i$ are chosen to make the formula exact for polynomials of degree up to $2n-1$. ### Example: $n = 2$ * $P_2(x) = \frac{1}{2}(3x^2 - 1)$ * Roots: $x_1 = -\sqrt{\frac{1}{3}}, \quad x_2 = \sqrt{\frac{1}{3}}$ * Weights: $w_1 = w_2 = 1$ * Quadrature formula: $\qquad \int_{-1}^1 f(x) dx \approx f\left(-\sqrt{\frac{1}{3}}\right) + f\left(\sqrt{\frac{1}{3}}\right)$ ### General Interval $[a, b]$ * Map the interval $[a, b]$ to $[-1, 1]$ using the linear transformation $\qquad x = \frac{b-a}{2}t + \frac{a+b}{2}$ * Then $\qquad \int_a^b f(x) dx = \frac{b-a}{2} \int_{-1}^1 f\left(\frac{b-a}{2}t + \frac{a+b}{2}\right) dt$ ### Error Estimate * If $f \in C^{2n}[a, b]$, then $\qquad \int_a^b f(x) dx - \sum_{i=1}^n w_i f(x_i) = \frac{(b-a)^{2n+1} (n!)^4}{(2n+1)[(2n)!]^3} f^{(2n)}(\xi)$ for some $\xi \in [a, b]$. ### Advantages of Gaussian Quadrature * Higher accuracy than Newton-Cotes for the same number of points. * Optimal choice of points and weights. ### Disadvantages of Gaussian Quadrature * Requires knowledge of orthogonal polynomials. * Points are not equally spaced. * Changing the interval requires recalculating the points and weights.