How do you find weights for unevenly spaced quadrature rules

approximate integrationnumerical methodsquadrature

I'm taking a Numerical-mathematics class right now and am fighting with a certain problem. We got this following exercise for Quadrature rules:

Find the weights $w_1,w_2$ for the Quadrature rule :

$$ \hat{I}(f) = w_1 f\Big(\frac{1}{2}\Big) + w_2 f\Big(\frac{3}{4}\Big)$$

So that the rule is exact for uneven/odd polynomials of degree up to 3 on the interval $[0,1]$.


What i have tried so far, is just creating the interpolation polynomial of degree 1 for $f$ at the given points:

$$
x_1 = 1/2, x_2 = 3/4, f(x_1) = y_1 , f(x_2) = y_2 \\
p_1(x) = y_1 + \frac{y_2-y_1}{x_2-x_1}(x-x_1) = y_1 + \frac{y_2-y_1}{1/4}(x-1/2)\\
= y_1 + (y_2 – y_1)(4x – 2) = 4x(y_2 – y_1) + 3 y_1 – 2 y_2
$$

And then integrate that:
$$
\int_0^1 (4x(y_2 – y_1) + 3 y_1 – 2 y_2) dx = y_1
$$

So: $y_1 = w_1 y_1+ w_2 y_2$


Where i am stuck now is getting a second equation for the weights. How do i go about setting up the polynomial of degree 3 for the 2 given points ?

Is there a generalized form of this kind of unequally spaced Quadrature rule ?

Any help (on the specific problem or pointing me in the right direction) is appreciated!

Best Answer

You just need to compute $w_1, w_2$ such that $\hat I (x) = I(x)$ and $\hat I(x^3) = I(x^3)$. This leads to the solution of the linear system $$ \begin{cases} \frac 12 w_1 + \frac 34 w_2 = \frac 12\\ \frac 18 w_2 + \frac{27}{64} w_2 = \frac{1}{4} \end{cases}, $$ i.e., $w_1= \frac{1}{5}$, $w_2=\frac{8}{15}$.

Related Question