How does the energy stored in a capacitor change if (a) the potential difference is

doubled, and (b) the charge on each plate is doubled, as the capacitor remains connected to a battery?