Linear regression with polynomials

In my previous two stories “Linear regression with straight lines” and “Linear regression with quadratic equations”, I explained how to find the optimum parameters of specific functions so as to minimize the sum squared error between a fit function y(x) and a data set S(x), using the method of least squares analysis (LSA). Now, I will extend these methods to a polynomial of any degree.

Mathematical Derivation

Suppose we have a polynomial of order n, meaning that the highest power of x is n as in the equation