NLA-lib Explorer

NLAlib.integral_gaussQuadrature

Library · theorem

The integral against the Gauss rule with the interpolatory weights: for a finite measure \mu supported in [a, \mathbf{b}], every k and every f : \mathbb{R} \to \mathbb{R}, \int f\,d\,\mathsf{gaussQuadrature}(\mu, k) = \sum_{\mathbf{x}\in G}\Bigl(\int\ell_\mathbf{x}\,d\mu\Bigr)f(\mathbf{x})\,, G the Gauss nodes of order k and \ell_\mathbf{x} the Lagrange basis polynomial of \mathbf{x}.

NLAlib.integral_gaussQuadrature {μ : Measure ℝ} [IsFiniteMeasure μ] {a b : ℝ}
  (hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (k : ℕ) (f : ℝ → ℝ) :
  ∫ (x : ℝ), f x ∂gaussQuadrature μ k =
    ∑ x ∈ gaussNodes μ k,
      (∫ (t : ℝ), Polynomial.eval t (Lagrange.basis (gaussNodes μ k) id x) ∂μ) * f x

Full source on GitHub

Import NLAlib.Polynomial.Orthogonal.Gauss.