Kugelfunktion, Legendresches Polynom