Explicit Solution for the Wavefunction and Energy in Degenerate Rayleigh–Schrödinger Perturbation Theory