# Using Legendre polynomial to approximate any polynomial

How can I show that any polynomial can be approximated by using linear combination of Legendre polynomial?

## 1 Answer

It's not a matter of approximation - any polynomial can be exactly decomposed into a linear combination of Legendre polynomials.

One way to see this is that $P_n$ has degree $n$. The highest order term can be seen to be equal to $\frac{(2n)!}{2^nn!^2}x^n$ (by looking at Rodrigues' formula). The decomposition of a polynomial $F(x) = \sum_{j=0}^n a_jx^j$ of degree $n$ thus can be started with a term $G_n(x) = a_n\frac{2^nn!^2}{(2n)!}P_n(x)$. Next, the remaining highest term in $F(x)-G_n(x)$ is considered, and the appropriate $P_m$ is used (often this is $P_{n-1}$ because a reamining term with degree $n-1$ has to be tackled). And so forth, until $P_0 = 1$ is used to correct for the remaining constant term.

Another, more elegant way, is to recognize that $(f,g) = \int_{-1}^1 f(x)g(x)dx$ is a proper inproduct on the universe of squared integrable functions on $[-1, +1]$, and that all $P_n$ are mutually orthogonal, that is, $\int_{-1}^1 P_nP_mdx = 0$ if $n \not=m$.

This implies that $F$ can be uniquely decomposed as $$F= \sum_{j=0}^n \frac{(F, P_j)}{(P_j, P_j)}P_j$$