# Expressing associated Legendre polynomials in terms of unassociated Legendre polynomials

The associate Legendre equation is given as:

$(1-x^2)\frac{d^2}{dx^2}y-2x\frac{d}{dx}y+\left[n(n+1)-\frac{m^2}{1-x^2}\right] y=0$

This becomes the standard unassociated Legendre equation for $m=0$. For positive m, the solutions to this equation can be expressed in terms of unassociated Legendre polynomials ($P_n(x)$) as:

$P_n^m(x)=(1-x^2)^{m/2}\frac{d^m}{dx^m}P_n(x)$

I would therefore expect that if I use this relationship as a solution to the associated Legendre equation that I should recover the unassociated Legendre equation.

I find the first and second derivative to be:

$\frac{d}{dx}P_n^m=(1-x^2)^{m/2}\left[\frac{d^{m+1}}{dx^{m+1}}P_n -\frac{mx}{1-x^2}\frac{d^m}{dx^m}P_n \right]$

$\frac{d^2}{dx^2}P_n^m=(1-x^2)^{m/2}\left[\frac{d^{m+2}}{dx^{m+2}}P_n-\frac{2mx}{1-x^2}\frac{d^{m+1}}{dx^{m+1}}P_n+\frac{m(m-1)x^2-m}{(1-x^2)^2}\frac{d^m}{dx^m}P_n \right]$

Using these two results with the associated Legendre equation and simplifying I find:

$(1-x^2)\frac{d^2}{dx^2}P_n-2x\frac{d}{dx}P_n+n(n+1)P_n-m(2x\frac{d}{dx}P_n+m(m+1)P_n)=0$

Clearly this is the unassociated Legendre equation with a little bit of extra stuff that didn't cancel. I am not seeing any way to make these terms vanish though--so what am I doing wrong here?

First of all, the result you achieve is wrong - somewhere along the line you have replaced $P_n^{(m)}$ (I use the shortcut notation $f^{(m)}$ for the $m^{th}$ derivative of $f$) by $P_n$.
The equation you should get is (in my notation): $$(1-x^2)P_n^{(m+2)}-2(m+1)xP_n^{(m+1)}+\{ n(n+1)-m(m+1)\} P_n^{(m)} = 0$$
Now this is not the unassociated Legendre equation, obviously, but it can be derived from that equation by differentiating it $m$ times.