Approximation of f(x) on the interval [a,b] according to least square minimization.
The method is based upon Gram-Schmidt orthonormalization process and Cholesky decomposition of the Gram Matrix.
a,b,n and f are free parameters (as far as a matrix is non-singular).