What is the purpose of a capacitor in a power supply circuit, and how do you diagnose a failing capacitor?