When using an mth degree polynomial
to approximate the given set of data, , , ..., , where , the best fitting curve has the least square error, i.e.,
Please note that , , , ..., and are unknown coefficients while all and are given. To obtain the least square error, the unknown coefficients , , , ..., and must yield zero first derivatives.
Expanding the above equations, we have
The unknown coefficients , , , ..., and can hence be obtained by solving the above linear equations.