Explicit Formula for the Integral of the Legendre Polynomial Question: Expand the sign function between $-1$ and $1$ in a series of Legendre polynomials. Obtain an explicit formula for the expansion coefficients. 
Attempt: I found that
$$a_l=(2l+1)\int_0^1 P_l(x)$$
where $a_l$ is the coefficient of degree l. However, I am still confused how to find an explicit formula for this value. Can someone please help me?
 A: Hint: use the recurrence relation:
$$(2 \ell+1) P_{\ell}(x) = \frac{d}{dx} [P_{\ell+1}(x) - P_{\ell-1}(x)]$$
A: Note that,

$$ a_0=1,\, a_{2 l}=0 .$$

For odd $l$, one can have the formula

$$ a_{2l-1}=  {\frac { \left( -1 \right)^{l-1} \left( 4\,l-1 \right) \Gamma 
\left( l-\frac{1}{2} \right) }{2\sqrt {\pi }\,\Gamma  \left( l+1 \right) }}
\quad l \in \mathbb{N}. $$

A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\on{P}_{\ell}:\ Order\mbox{-}\ell\ Polynomial}$.

\begin{align}
a_{\ell} & \equiv \bbox[5px,#ffd]{\left.\pars{2\ell + 1}
\int_{0}^{1}\on{P}_{\ell}\pars{x}\,\dd x
\,\right\vert_{\,\ell\ \in\ \mathbb{N}_{\,\geq\ 0}}}
\\[5mm] & =
\pars{2\ell + 1}
\int_{0}^{1}\braces{\bracks{h^{\ell}}{1 \over
\root{1 - 2xh + h^{2}}}}\,\dd x
\\[5mm] & =
\pars{2\ell + 1}\bracks{h^{\ell}}
\int_{0}^{1}{\dd x \over\root{1 - 2xh + h^{2}}}
\\[5mm] = &\
\pars{2\ell + 1}
\bracks{h^{\ell}}{\root{1 + h^{2}} + h - 1 \over h}
\\[5mm] & =
\pars{2\ell + 1}\bracks{\ell\ odd}
\bracks{h^{\ell + 1}}\root{1 + h^{2}} + \delta_{\ell 0}
\\[5mm] & =
\delta_{\ell 0} +
\pars{2\ell + 1}\bracks{\ell\ odd}
{1/2 \choose \bracks{\ell + 1}/2}
\end{align}

