Use the weighted inner product . A monic quadratic orthogonal polynomial , orthogonal to 1 and , satisfies
Thus , , and its two zeros are and . Matching the first two weighted moments gives
so and . The two-node Gaussian quadrature with linear weight is therefore
For completeness, a polynomial of degree at most three can be divided as , where both and have degree at most one. Orthogonality makes the weighted integral of zero, and this term vanishes at both nodes. The two moment equations integrate exactly. Thus the Gaussian quadrature is exact for every cubic polynomial. No two-node rule can integrate every quartic: the square of its nodal polynomial has quadrature value zero and strictly positive weighted integral.
For two-node Gaussian quadrature with linear weight, the monic node polynomial must be orthogonal to and for weight . Indeed, exactness through degree three makes the quadrature of and vanish at its nodes. The moment equations are
so and . Thus the Gaussian quadrature nodes, labelled in increasing order, are
Integrating the linear Lagrange interpolation cardinal functions gives the weights
They are positive, sum to , and reproduce the first moment . Any cubic polynomial has remainder of degree at most one after division by ; orthogonality annihilates the other part both in the integral and at the nodes. This proves degree-three exactness, not merely the two moment conditions for the weights.