There is these notes about Gaussian Quadrature and I am trying to understand what does the sentence "is exact for all polynomials of degree up to $2n+1$" actually mean.
Gaussian Quadrature - General $n$:
Given an interval $[a,b]$ and a natural number $n$, we want to find constants $A_i$ and $x_i\in[a,b]$ such that the approximation $$\int_a^bf(x)dx\approx\sum_{i=0}^nA_if(x_i)$$
is exact for all polynomials of degree up to $2n+1$.
My doubts:
Does the sentence mean for all $f(x)$ that has the degree $0$ to $2n+1$, we have $\int_a^bf(x)dx=\sum_{i=0}^nA_if(x_i)$ ? What does the word exact mean? And what does it mean by for all polynomials?
Thanks for the help!
You already guessed it mostly: The $A_i$ shall be determined in such a way that the $\approx$ can be replaced with $=$ whenever the function $f$ is in fact a polynomial function of degree up to $2n+1$, i.e., whenever $f(x)=a_{2n+1}x^{2n+1}+a_{2n}x^{2n}+\ldots + a_1x+a_0$. For example, the simple approximation $\int_a^b f(x)\,\mathrm dx\approx (b-a)\cdot f(a)$ is exact for constant functions, i.e., for all polynomials of degree up to $0$. (In fact, for some lucky choices of $a$ and $b$ this might even be exact for degree $1$ polynomials - can you guess what "lucky" means here?)