I am working on a review problem and I have run across a question:
Find nodes and weights for the Gaussian formula of the form:
$\int_{0}^{1}x^4f(x)dx \approx A_0f(x_0)+A_1f(x_1)$
I assume with this I need to do the same method of undetermined coefficients I would use with a regular Gaussian, but I am unsure how to handle the $x^4$ to get the $x_n$ values.My instinct was initially to just raise the regular $x_0$ and $x_n$ values given from Legendre polynomials to the power of four in the regular equation, but that does not work. Is there some formula to follow in order to do this? I can't find anything in my textbook and was hoping someone could give me a pointer so I can solve this problem!
Well, if we take the method of undetermined coefficients literally, that would give a system of equations $$A_0+A_1=\int^1_01\cdot x^4\,dx=\frac15\tag1$$ $$A_0\,x_0+A_1\,x_1=\int^1_0 x\cdot x^4\,dx=\frac16\tag2$$ $$A_0\,x_0^2+A_1\,x_1^2=\int^1_0 x^2\cdot x^4\,dx=\frac17\tag3$$ $$A_0\,x_0^3+A_1\,x_1^3=\int^1_0 x^3\cdot x^4\,dx=\frac18\tag4$$ That might be a bit of a challenge. Fortunately, we know (Fundamental theorem) that the nodes $x_i$ must be the zeroes of a polynomial of degree 2, $p(x)$, orthogonal to all polynomials of lower degree with respect to the weight function $x^4$: for that, it's sufficient that $\int^1_0 x^4\cdot1\cdot p(x)\,dx=0$ and $\int^1_0 x^4\cdot x\cdot p(x)\,dx=0$. Assuming $p(x)=a_0+a_1 x+x^2,$ we obtain the system $$\frac15a_0+\frac16a_1+\frac17=0\tag5$$ $$\frac16a_0+\frac17a_1+\frac18=0\tag6$$ That's easy to solve, and so $x_0,x_1$ are the two solutions of $$x^2-\frac32 x+\frac{15}{28}=0$$ Now, we can calculate $A_0, A_1$ from (1) and (2).
It's interesting to check how accurate that is. For $f(x)=e^{-x}$, we get the approximation $A_0f(x_0)+A_1f(x_1)=0.0878334\ldots$, while Wolfram Alpha gives the exact result $\int^1_0x^4\,e^{-x}\,dx=24 - 65/e \approx 0.0878363238562491$. For a two-point rule, that's not so bad.