A summation formula over the zeros of a combination of the associated Legendre functions with a physical application