# [SOLVED]Legendre Polynomials

#### dwsmith

##### Well-known member
Consider
$f(x) = \begin{cases} 1, & 0\leq x\leq 1\\ -1, & -1\leq x\leq 0 \end{cases}$
Then
$c_n = \frac{2n + 1}{2}\int_{0}^1\mathcal{P}_n(x)dx - \frac{2n + 1}{2}\int_{-1}^0\mathcal{P}_n(x)dx$
where $$\mathcal{P}_n(x)$$ is the Legendre Polynomial of order n.
Our first few $$c_n$$ are $$0, 3/2, 0, -7/8, 0, 11/16, 0, -75/128, 0, ...$$.
Is there a pattern to this? I know $$n$$ even is 0 but can I obtain a nice solution?

By this I mean, if I had a Fourier series, I could get a solution of the form
$A_n = \begin{cases} 0, & \text{if n is even}\\ \frac{4}{n\pi}, & \text{if n is odd} \end{cases}$

If I can obtain such a solution, how? Is it by simply noticing a geometric pattern in the terms or can I integrate $$\mathcal{P}_n(x)$$?

Does the Rodrigues's formula need to be used in the integral?

#### DreamWeaver

##### Well-known member
For reference - sorry! - but I think you should define Legendre polynimials... #### topsquark

##### Well-known member
MHB Math Helper
@ Dreamweaver: Here's everything you want to know about Legendre polynomials, and more.

I'm kinda curious about the series solution myself.

-Dan

#### dwsmith

##### Well-known member
Consider
$f(x) = \begin{cases} 1, & 0\leq x\leq 1\\ -1, & -1\leq x\leq 0 \end{cases}$
Then
$c_n = \frac{2n + 1}{2}\int_{0}^1\mathcal{P}_n(x)dx - \frac{2n + 1}{2}\int_{-1}^0\mathcal{P}_n(x)dx$
where $$\mathcal{P}_n(x)$$ is the Legendre Polynomial of order n.
Our first few $$c_n$$ are $$0, 3/2, 0, -7/8, 0, 11/16, 0, -75/128, 0, ...$$.
Is there a pattern to this? I know $$n$$ even is 0 but can I obtain a nice solution?

By this I mean, if I had a Fourier series, I could get a solution of the form
$A_n = \begin{cases} 0, & \text{if n is even}\\ \frac{4}{n\pi}, & \text{if n is odd} \end{cases}$

If I can obtain such a solution, how? Is it by simply noticing a geometric pattern in the terms or can I integrate $$\mathcal{P}_n(x)$$?

Does the Rodrigues's formula need to be used in the integral?
\begin{align}
c_n &= \frac{2n + 1}{2}\int_{0}^1\mathcal{P}_n(x)dx -
\frac{2n + 1}{2}\int_{-1}^0\mathcal{P}_n(x)dx\\
&= \frac{2n + 1}{2}\left[\int_{0}^1\mathcal{P}_n(x)dx +
\int_{0}^1\mathcal{P}_n(-x)dx\right]
\end{align}
Since $$\mathcal{P}_{\ell}(-x) = (-1)^{\ell}\mathcal{P}_{\ell}(x)$$, we now have
$c_n = \frac{2n + 1}{2}\int_{0}^1\mathcal{P}_n(x)(1 - (-1)^{\ell})dx\\$
If $$\ell$$ is even, then the integral is 0, but if $$\ell$$ is odd, we gain a factor of 2.
$c_n = \begin{cases} (2n + 1)\int_{0}^1\mathcal{P}_n(x), & \text{$$\ell$$ odd}\\ 0, & \text{if $$\ell$$ is even} \end{cases}$
We can now use the recursive relation
$\mathcal{P}_{\ell}(x) = \frac{1}{2\ell + 1}\left(\frac{d\mathcal{P}_{\ell + 1}(x)}{dx} - \frac{\mathcal{P}_{\ell - 1}(x)}{dx}\right).$
Then
\begin{align}
I_{\ell} &= \frac{1}{2\ell + 1}\int_0^1\left(\frac{d\mathcal{P}_{\ell + 1}(x)}{dx} - \frac{\mathcal{P}_{\ell - 1}(x)}{dx}\right)dx\\
&= \frac{1}{2\ell + 1}\left[\mathcal{P}_{\ell + 1}(1) - \mathcal{P}_{\ell + 1}(0) - \mathcal{P}_{\ell - 1}(1) + \mathcal{P}_{\ell - 1}(0)\right]\\
&= \frac{1}{2\ell + 1}\left[\mathcal{P}_{\ell - 1}(0) - \mathcal{P}_{\ell + 1}(0)\right]\quad\text{for }\ell\geq 1
\end{align}
We have that Rodrigues's formula is
$\mathcal{P}_{\ell}(x) = \frac{1}{2^{\ell}\ell !}\frac{d^{\ell}}{dx^{\ell}}(x^2 - 1)^{\ell}$
so
$\mathcal{P}_{\ell}(0) = \left.\frac{1}{2^{\ell}\ell !}\frac{d^{\ell}}{dx^{\ell}} \sum_{n=0}^{\ell}\binom{\ell}{n}(x^2)^n(-1)^{\ell - n}\right|_{x=0}$
Since we need even terms, we now have
$\mathcal{P}_{\ell}(0) = \frac{1}{2^{\ell}\ell !}\binom{\ell}{\frac{\ell}{2}} \ell!(-1)^{\ell/2}$
Then
\begin{align}
I_{\ell} &= \frac{1}{2\ell + 1}\left[\frac{1}{2^{\ell - 1}}\binom{\ell - 1}{\frac{\ell - 1}{2}}(-1)^{(\ell - 1)/2} - \frac{1}{2^{\ell + 1}}\binom{\ell + 1}{\frac{\ell + 1}{2}}(-1)^{(\ell + 1)/2}\right]\\
&= \frac{(-1)^{(\ell - 1)/2}}{2^{\ell - 1}}\frac{(\ell - 1)!}{\left(\frac{\ell - 1}{2}\right)!\left(\frac{\ell - 1}{2}\right)!}\frac{1}{\ell + 1}
\end{align}
Thus,
$c_n = \begin{cases} \frac{2n + 1}{n + 1}\frac{(-1)^{(n - 1)/2}}{2^{n - 1}}\frac{(n - 1)!}{\left[\left(\frac{n - 1}{2}\right)!\right]^2}, & \text{for } n \text{ odd}\\ 0, & \text{for } n \text{ even} \end{cases}$

Last edited: