Interesting problem, but it too me about two days to figure what I had to do. That and reviewing linear least squares fitting. I found the best example from Linear Least Squares by Postcard Professor on YT.
Once you figure out how to get each f{_}(x) and display each basis function, you are good to go. The originator of the problem already did the leg work of squaring, cubing, yada, yada, yada, making less work for you.