Exercise 3.4.25. Given over the interval what is the closest line to the parabola formed by ?

Answer: This amounts to finding a least-squares solution to the equation , where the entries 1, , and are understood as functions of over the interval -1 to 1 (as opposed to being scalar values).

Interpreting the traditional least squares equation in this context, here the matrix and we have

where the entries of are the dot products of the functions, i.e., the integrals of their products over the interval -1 to 1.

We then have

so that

Continuing the interpretation of the least squares equation in this context, the role of is played by the function , and we have

where again the entries are dot products of the functions. From above we have

and from previous exercises we have

so that

To get the least squares solution we then have

From the second equation we have . From the first equation we have or .

The line of best fit to the parabola over the interval is therefore the horizontal line with -intercept of .

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fifth Edition and the accompanying free online course, and Dr Strang’s other books.