{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $(a, b)$ be an interval, bounded or not, and let $w$ be a weight function on $(a, b)$.\nThis means that $w$ is integrable, $w \u003e 0$ almost everywhere, and every moment $\\int_a^b x^k w(x)\\,dx$ is finite.\nLet $n \\ge 1$.\nConsider a [[quadrature rule|ADSVMCY77A]]\n$$\\int_a^b f(x)\\, w(x)\\,dx \\approx \\sum_{i=1}^{n} w_i f(x_i)$$\nwith distinct nodes $x_1, \\dots, x_n$ in $(a, b)$ and real weights $w_1, \\dots, w_n$.\nIt is an $n$-point *Gaussian quadrature* rule for $w$ if it is an equality for every polynomial $f$ of degree at most $2n - 1$.\n\n## Remarks\n\nFor each $w$ and $n$ such a rule exists and is unique.\nIts nodes are the zeros of the degree $n$ [[orthogonal polynomial|8TXASARQN1]] $p_n$ for the inner product $\\langle f, g \\rangle = \\int_a^b f g\\, w\\,dx$, and its weights are positive.\nNo $n$-point rule is exact for all polynomials of degree $2n$: the polynomial $\\prod_{i}(x - x_i)^2$ has a positive integral but vanishes at every node.\nSo $2n - 1$ is the largest possible [[degree of exactness|ZYT1JNT1Y0]].\n\nExample: $w = 1$ on $(-1, 1)$ and $n = 1$.\nThe rule $\\int_{-1}^{1} f \\approx 2 f(0)$ is exact for $f = 1$ (both sides are $2$) and for $f = x$ (both sides are $0$), so it is the one-point Gaussian rule, the midpoint rule.\n\nNon-example: the trapezoidal rule $\\int_{-1}^{1} f \\approx f(-1) + f(1)$ has two nodes but fails for $f = x^2$, since the left side is $2/3$ and the right side is $2$.\nSo it is not exact up to degree $3$ and is not a Gaussian rule.\n\nThe rule for $w = 1$ on $(-1, 1)$ is [[Gauss–Legendre quadrature|RGGXDRCJVE]].\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "FP37BTP93K",
    "kind": "definition",
    "msc": [
      "65D32",
      "41A55",
      "33C45"
    ],
    "name": "Gaussian quadrature",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Gaussian_quadrature"
      }
    ],
    "tag": "SZ6XCSQA5H",
    "uses": [
      "ADSVMCY77A",
      "ZYT1JNT1Y0",
      "8TXASARQN1"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/SZ6XCSQA5H/",
  "links": [
    {
      "field": "defines",
      "target": "FP37BTP93K"
    },
    {
      "field": "uses",
      "target": "ADSVMCY77A"
    },
    {
      "field": "uses",
      "target": "ZYT1JNT1Y0"
    },
    {
      "field": "uses",
      "target": "8TXASARQN1"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/SZ6XCSQA5H.md",
  "msc": [
    "65D32",
    "41A55",
    "33C45"
  ],
  "name": "Gaussian quadrature",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/SZ6/SZ6XCSQA5H.md",
  "status": null,
  "tag": "SZ6XCSQA5H",
  "uri": "m2://SZ6XCSQA5H",
  "url": "https://tamnd.github.io/math2/wiki/gaussian-quadrature-definition/",
  "writing": {
    "tag": "SZ6XCSQA5H",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
