I'm trying to determine the weights for the following integral using gaussian quadrature:
$\int_{0}^{1} x^2 f(x) \approx w_0 f(0) + w_1 f(a)$
I understand that you write polynomials from $\ x^n$ where n = 0, 1, 2...
I am confused when it comes to evaluating the first couple of lines of this:
if we take $x^0$ then would this yield $\int_{0}^{1} x^2 x^0 = \frac{1}{3} \approx w_0 *0 + w_1$ which implies $\ \frac{1}{3} = w_1$ or is this not how it works? I am quite unsure about this example in specific, if the latter equation is correct, then what would the weight of $w_0$ evaluate to (since it always going to be 0 in the equation)? Also, would the order of precision for this equation be 2?
thank you!
With Gaussian quadrature we have $$\int_{-1}^1g(x)dx \approx g(-1/{\sqrt 3})+ g(1/{\sqrt 3})$$
Thus $$\int_0^1x^2f(x)dx=1/2 \int_{-1}^1 (\frac {t+1}{2})f(\frac {t+1}{2})dt\approx $$
$$(1/2)\int_{-1}^1 g(t)dt \approx (1/2) [g(-1/{\sqrt 3})+ g(1/{\sqrt 3})]$$