Gaussian Integration verification

73 Views Asked by At

I have the following problem:

For the formula $$\int_0^1 f(x) dx\approx w_1f(0)+w_2f(x_2)$$ determine the weights $w_1, w_2$ and the node $x_2$ so that the formula is exact for all polynomials of as degree as possible. What is the degree of precision of the formula?

This is my attempt. We require $3$ unknowns, namely: $w_1,w_2$ and $x_2$. We then use: $f(x)=1,f(x)=x$ and $f(x) = x^2$.Therefore I have the following system of equations $$\int_0^1 1dx =1\Rightarrow1= w_1+w_2$$ $$\int_0^1 xdx =\frac{1}{2}\Rightarrow \frac{1}{2} = w_1x_1+w_2x_2$$ $$\int_0^1 x^2dx =\frac{1}{3}\Rightarrow \frac{1}{3} = w_1x_1^2+w_2x_2^2$$ Now, since $x_1=0$, we have: $$1= w_1+w_2$$ $$ \frac{1}{2} = w_2x_2$$ $$\frac{1}{3} =w_2x_2^2$$ The solution of this system is given by $w_1 = \frac{1}{4}, w_2 =\frac{3}{4}$ and $x_2 = \frac{2}{3}$, so that $$\int_0^1 f(x) dx\approx -2f(0)+3f(\frac{2}{3}).$$ The degree of precision is $2$, since for $f(x) = x^3$, we have: $$\int_0^1 x^3 dx - [\frac{1}{4}f(0)+\frac{3}{4}f(\frac{2}{3})] = \frac{1}{36}\neq 0$$

1

There are 1 best solutions below

0
On BEST ANSWER

Considering the system of equations you wrote $$1= w_1+w_2$$ $$\frac{1}{2} = w_2x_2$$ $$\frac{1}{3} =w_2x_2^2$$ the solution should be $$\left\{{w_1}= \frac{1}{4},{w_2}=\frac{3}{4},{x_2}= \frac{2}{3}\right\}$$ as A.G. commented.

The solution is immediate if you divide the third equation by the second : it gives $x_2= \frac{2}{3}$ and the other variables are immediately obtained.