(a)

The energy stored in a capacitor is given by:

where
C is the capacitance
V is the potential difference between the plates
For the capacitor in this problem,
is the capacitance
V = 12.0 V is the potential difference across the plate
Substituting into the equation, we find

(b)

For this part, we have to calculate the charge stored on the capacitor first. This is given by

And substituting the values of C and V from the previous part, we find

Now, in this second part, the battery is disconnected and the charge does not change. However, the capacitance of the capacitor changes; in fact, it is given by

where
is the vacuum permittivity, A the area of the plates, d their separation. Here the distance between the plates is increased from 5.00 mm to 10.0 mm, so it is doubled: since C is inversely proportional to d, this means that the new capacitance is half of its original value:

And now we can find the new energy stored with the equation:
