Numerical Analysis, Numerical Integration.
can be calculated exactly by constructing an interpolatory quadrature of n+1 nodes, which will be exact for degree ≤ n. These n+1 nodes we choose to be the zeros of our n+1 degree Legendre orthogonal polynomial. Line 5 is simply writing each term as an interpolatory quadrature constructed with n+1