[Math] Finding the second-degree polynomial that is the best approximation for cos(x)

approximation

So, I need to find the second-degree polynomial that is the best approximation for $f(x) = cos(x)$ in $L^2_w[a, b]$, where $w(x) = e^{-x}$, $a=0$, $b=\infty$.

"Best approximation" for f is a function $\hat{\varphi} \in \Phi$ such that:

$||f – \hat{\varphi}|| \le ||f – \varphi||,\; \forall \varphi \in \Phi$

I have several methods available:

  • Lagrange interpolation
  • Hermite interpolation

Which would be the most appropriate?

Best Answer

You can directly compute $\| f - g\|^2 = \int_0^\infty (\cos(x) - (a + b x + c x^2))^2 e^{-x}\ dx$, giving you a quadratic function of $a$, $b$, $c$, and then minimize that.