For an integral ∫−11f(x)dx, show that the two-point Gauss quadrature rule is given by ∫−11f(x)dx=f(31)+f(−31). Using this rule, estimate ∫242xexdx.
Technique
Derive Gauss–Legendre 2-point rule by enforcing exactness on 1,x,x2,x3 (⇒ weights 1,1, nodes ±1/3 = roots of P2); rescale [2,4]→[−1,1] via x=3+t (Jacobian =1); evaluate at the two nodes.
Solution
Setup. A two-point rule ∫−11fdx≈w1f(x1)+w2f(x2) has four free parameters w1,w2,x1,x2; choosing them to integrate 1,x,x2,x3 exactly gives a rule exact for all cubics (degree 2n−1=3).
By symmetry take w1=w2=w and x2=−x1. Then equation 1 gives w=1; equations 2 and 4 are satisfied automatically; equation 3 gives 2x12=32, so x12=31, i.e. x1=31,x2=−31. Hence