I have some doubts about the following exercise
What is the most efficient way to calculate $I =\int_0^1 (1-x)^{1/2}(x^3+1)dx $ ?
Solution: Let $g(x)=x^3+1$ and $w(x)=(1-x)^{1/2}$. With a change of variable $ x = \frac{t}{2}+\frac{1}{2}$ it can be transform to an integral over $[-1,1]$ :
$I =(\frac{1}{2})^{(\frac{3}{2})}\int_{-1}^1 (1-t)^{1/2}((\frac{t}{2}+\frac{1}{2})^3+1) dt$
so now I think that I can use a Gauss-Jacobi quadrature formula with n nodes, wich is:
$\int_{-1}^1 (1-t)^{\alpha}(1+t)^\beta f(t)dt \approx \sum_{i = 1}^n w_i f(x_i) $,...(*)
where $w_i$ are the weights and $x_i$ are the nodes (zeros of the Jacobi orthogonal polynomials over [-1,1] with respect to the Jacobi weight function $(1-t)^{\alpha}(1+t)^\beta$):
and since gaussian quadrature formulas with $n$ nodes are exact up to polynomials of degree $2n -1$, it suffices to take $3\le 2n-1 \iff n\ge 2$ nodes, so n=2 nodes is enough
My questions are
- Supposing my solution is ok, and this is indeed the most efficient way, if with n=2 nodes the formula is exact, what is the degree of the interpolating polynomial that is used to have an exact formula? There is something I am misunderstanding since I arrive to a contradiction: If I just use 2 nodes as found, it means I use an interpolating polynomial of degree 1, right? But since the regular part of the integral $I$ which is $g(x) $ is a polynomial of degree 3 and the interpolating polynomial of a polynomial is the polynomial itself, so it must have degree 3, right? Does it make sense to interpolate a polynomial with another of lower degree?
- Why is this the most efficient way compared to for instance a Newton-Cotes formula or a composite formula? I think efficiency must be understood as a compromise between fewer number of function evaluations and maximum accuracy