Orthogonal bases and Gram–Schmidt

50 Views Asked by At

What is the closest function $a \cos(x) + b \sin(x)$ to the function $ f(x) = \sin(2x)$ on the interval from $-\pi$ to $\pi$? What is the closest straight line $c + dx$?

This is a problem in linear algebra from the book “Linear Algebra and its applications” by Gilbert Strang. The problem is in chapter 3, section “Orthogonal bases and Gram-Schmidt”. I am not able to model this into vectors so that I can project it onto another vector to get the “closest function”. Any hints on how to look at these as vectors would help me.