Re: NIntegrate - Gaussian quadrature more exact than thought
- To: mathgroup at smc.vnet.net
- Subject: [mg73893] Re: NIntegrate - Gaussian quadrature more exact than thought
- From: "ben" <benjamin.friedrich at gmail.com>
- Date: Sat, 3 Mar 2007 00:47:21 -0500 (EST)
- References: <es6dmv$s61$1@smc.vnet.net>
On 1 Mrz., 12:33, "janos" <janostothmeis... at gmail.com> wrote:
> NIntegrate[x^4, {x, 0, 1}, Method->GaussKronrod, GaussPoints->2]
>
> gives 0.2, the exact result, although the Gauss quadrature should be
> inexact on a polynomial of degree 2n+2 where n is the number of
> GaussPoints. More exactly, we expected the same results as here:
>
> << NumericalMath`GaussianQuadrature`
> gw = GaussianQuadratureWeights[2, 0, 1]
> f[{x_, y_}] := x^4 y
> Total[f /@ gw]
> 0.194444
>
> This is inexact, OK.
>
> Why is NIntegrate so good?
> Something I may have missed.
>
> Thank you for your help.
>
> Janos
Hi
I wouldn't be surprised if Mathematica does some preprocessing of
the integrand and realizes that the integral can be faster
computed in closed form; however the implementation notes
on NIntegrate do not state such a thing
Bye
Ben