Approximating the function $ f(x) = \frac{1}{1+a^2x^2} \text{with } a=4 \text{ in the interval }[-1,1]$ with Legendre Polynomials

76 Views Asked by At

Given:

$$ f(x) = \frac{1}{1+a^2x^2} \text{with } a=4 \text{ in the interval }[-1,1]$$

Approximate the function $f(x)$ in the least squares sense using legendre polynomials up to order 2.

The approximation is:

$$ \tilde f(x) = \sum_{k=1}^2c_kP_k(x)\tag1$$

And the coefficients are:

$$c_k=\frac{1}{\|P_k(x)\|^2} \int_{-1}^{1}f(x)P_k(x)dx\tag2$$

where:

$$\|P_k(x)\|^2 = \frac{2}{2k+1}\tag3$$

I am ok up to this point. Next, my notes say that from the above expressions we can see that the calculation involves the integrals:

$$ I_m = \int_{-1}^{1}\frac{x^m}{1+a^2x^2}dx \tag4$$

and that they satisfy the recurrence relation:

$$ I_m = \frac{2}{(m-1)a^2}-\frac{1}{a^2}I_{m-2} \text{ with }I_o=\frac{2}{a}\tan^{-1}(a)\tag5$$ and that:

$$\forall{m\equiv 1 \pmod{2}}: I_m=0 \tag6 $$

Could someone explain 4, 5, and 6 to me please?

1

There are 1 best solutions below

0
On BEST ANSWER

$P_k$ is a polynomial (of degree $k$) so obviously, $\int_{-1}^1 f(x)P_k(x)dx$ is a sum of terms $I_m$ times some number. This covers (4). As $P_0 = 1$, $$I_0 = \int_{-1}^1 \frac{1}{1+a^2x^2}dx = \left[ \frac{arctan(ax)}{a}\right]_{-1}^{+1} = \frac{2}{a}arctan(a)$$ The recurrence relation can be derived as follows: \begin{equation} \begin{split} I_m &= \int_{-1}^1 \frac{x^m}{1+a^2x^2}dx \\ &= \int_{-1}^1 x^{m-2}\frac{x^2}{1+a^2x^2}dx \\ &= \int_{-1}^1 \frac{x^{m-2}}{a^2}\left(1-\frac{1}{1+a^2x^2}\right)dx \\ &= \left[\frac{x^{m-1}}{(m-1)a^2}\right]_{-1}^{+1} - \frac{1}{a^2}\int_{-1}^1 \frac{x^{m-2}}{1+a^2x^2}dx \\ &= \frac{1 - (-1)^{m-1}}{(m-1)a^2} - \frac{1}{a^2}I_{m-2} \end{split} \end{equation} For even $m$, this results in $$I_m = \frac{2}{(m-1)a^2} - \frac{1}{a^2}I_{m-2}$$ while for odd m this gives $$I_m = - \frac{1}{a^2}I_{m-2}$$ This covers (5) and also (6), as $$I_1 = \int_{-1}^1 \frac{x}{1+a^2x^2}dx = \left[ \frac{ln(1+a^2x^2)}{2a^2}\right]_{-1}^{+1} = 0$$