Because the Legendre polynomials form a complete orthogonal system over the interval [-1, 1] with respect to the weighting function w(x) = 1, any function f(x) may be expanded in terms of them as f(x) = sum_(n = 0)^∞ a_n P_n(x). To obtain the coefficients a_n in the expansion, multiply both sides by P_m(x) and integrate integral_(-1)^1 P_m(x) f(x) d x = sum_(n = 0)^∞ a_n integral_(-1)^1 P_n(x) P_m(x) d x.