1

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?

scribu
  • 185
  • 1
    You might ask yourself what is the natural metric for functions in the context of this question, and minimise distance between functions in that metric. – Mark Bennet May 24 '12 at 17:36
  • Each will give you the "best" result in a certain sense of the word "best". Are you trying to minimize the $L^2$ norm between $\cos$ and its approximation over $[a,b]$? – Alex Becker May 24 '12 at 17:38
  • @AlexBecker I updated the answer with a definition for what is meant by "best approximation". – scribu May 24 '12 at 19:59

2 Answers2

4

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.

Robert Israel
  • 448,999
  • That seems to make sense, except I don't understand how I could "directly compute" that, given that I don't know a, b and c yet. (Obviously, more study is needed.) – scribu May 24 '12 at 23:37
  • I mean, compute it as a function of $a$, $b$ and $c$. Expand out the square and do each of the integrals. They're not that hard. – Robert Israel May 25 '12 at 02:28
  • Oh, I see. Well, supposing I calculate it, I'm pretty sure minimizing multivariate polynomials is not how I'm supposed to solve this. :) Thanks anyway. – scribu May 25 '12 at 03:28
  • Yeah, I found out that minimizing the integral result is just a matter of demanding that d/da ... = 0, d/db ... = 0, d/dc ... = 0, so to find a, b, c I just have to solve a 3x3 first-degree system. Thanks! – scribu May 25 '12 at 15:36
  • And by d/da I mean $\frac{\partial}{\partial a}$ etc. – scribu May 25 '12 at 15:44
  • I did get the correct results, but it turns out that I was supposed to make use of the orthogonality of the Laguerre polynomials. – scribu May 26 '12 at 12:03
3

In your $L^2$ space the Laguerre polynomials form an orthonormal family, so if you use the polynomial $$ P(x)=\sum_{i=0}^n a_i L_i(x), $$ you will get the approximation error $$ ||P(x)-\cos x||^2=\sum_{i=0}^n(a_i-b_i)^2+\sum_{i>n}b_i^2, $$ (Possibly you need to add a constant to account for the squared norm of the component of cosine, if any, that is orthogonal to all the polynomials. If the Laguerre polynomials form a complete orthonormal family, then this extra term is not needed. Anyway, having that extra term will not affect the solution of this problem.) where $$ b_k=\langle L_k(x)|\cos x\rangle=\int_0^{\infty}L_k(x)\cos x e^{-x}\,dx. $$ I recommend that you calculate $b_0$, $b_1$ and $b_2$, and then try and figure out how you should select the numbers $a_i$ to minimize the error and meet your degree constraint.

Jyrki Lahtonen
  • 133,153
  • My course says that the generalized Laguerre polynomials, having $w(x) = x^\alpha e^{-x}, \alpha > 1$, are orthogonal over $[0, \infty)$. It says nothing about normal Laguerre polynomials. – scribu May 25 '12 at 02:32
  • @scribu: Well, they are orthogonal w.r.t $w(x)=e^{-x}$. That's what the wikipedia page is saying. You can find that bit also from e.g. Schaum's outline series Mathematical Handbook. Most likely also in most books dealing with orthogonal polynomials, e.g. Szegö. If you are in doubt, you can just orthogonalize the basis ${1,x,x^2}$ of the space of polynomials of degree $\le2$ using the Gram-Schmidt orthogonalization algorithm! That is one way of constructing the orthogonal families of polynomials. – Jyrki Lahtonen May 25 '12 at 04:13
  • You're right. There was a typo in my course. Laguerre polynomials are orthogonal for all $\alpha > -1$, not +1. Thanks. – scribu May 25 '12 at 15:11