Derivations of recurrence relation in Legendre functions