Exactness for special quadrature formula

numerical methodsnumerical-calculus

Given the quadrature formula $Q(f):= w_0f(-a) + w_1f(a)$ and $I(f):= \int_{-1}^1 f(x) dx$ and $a\in [0,1]$. I need to find $a$ so that $Q(f)$ is

a) exact for polynomials of degree $1$.

b) exact for polynomials of degree $2$.

Exactness for degree $n$ means that $R(p):= Q(p)-I(p)$ for all polynomials $p$ of degree $\leq n$. I try to understand the idea behind this.

Is the right way to take a polynomial $p(t)=m_0+m_1t$ of degree $1$ and then just put it into the formulas above? That would mean finding $a$ would be done by solving:
$w_0p(-a) + w_1p(a) = \int_{-1}^1 p(x) dx$? Another idea was that I know (or have shown in the lecture) that $Q(f)$ is exact for polynomials of max. degree $n$ if and only if $Q(f)=\sum_{j=0}^n w_j f(t_j)$ with $w_j$ being Lagrange polynomials. So if that is the case, isn't $Q(f):= w_0f(-a) + w_1f(a)$ exact for polynomials of degree max. $1$ if $w_0,w_1$ are the Lagrange polynomials and can't $a$ in that case be $a$ a value from the whole interval $[0,1]$?

Best Answer

The formula is linear, so you just need to check that $Q(x^i) = I(x^i), i=0,1, \cdots$.So,

a) $$ \begin{cases} Q(1) = I(1)\\ Q(x) = I(x)\end{cases} \Leftrightarrow \begin{cases} w_0 + w_1 = 2\\ w_0 (-a) + w_1 a = 0\end{cases} $$

The solutions are: i. $a=0$, with any $w_0,w_1$ such that $w_0+w_1=2$; ii. $w_0=w_1=1$, with any $a$.

b) $$ \begin{cases} Q(1) = I(1)\\ Q(x) = I(x)\\Q(x^2=I(x^2)\end{cases} \Leftrightarrow \begin{cases} w_0 + w_1 = 2\\ w_0 (-a) + w_1 a = 0 \\ w_0 a^2 + w_1 a^2 = \frac 23\end{cases} $$

From last equation you get $a= \frac{\pm 1}{\sqrt{3}}$ and from the first two equations you then deduce that $w_0=w_1=1$.