Solution (source code)

= Solution

The grounded conducting plane supplies the induced charge needed for a uniform field between the plates and zero field above the upper plate. <Gauss's law> gives $E_z=-\sigma/\epsilon_0$ in the gap. With <electric potential> zero at the grounded plate,
$$
\boxed{\phi(z)=\frac{\sigma z}{\epsilon_0},\qquad V=\frac{\sigma d}{\epsilon_0}.}
$$
Integrating the <electrostatic energy> density $\epsilon_0|\mathbf E|^2/2$ across the gap gives the <capacitor energy> per unit area
$$
u=\frac{\sigma^2d}{2\epsilon_0}=\frac{\epsilon_0V^2}{2d}=\frac12\sigma V.
$$
For an isolated upper plate, charge is fixed, so increasing $d$ to $(1+\alpha)d$ gives exactly \b[$\Delta u=\tfrac12\sigma V\alpha$], with $V$ its initial value. The positive increase equals the mechanical work done against attraction.

At fixed voltage, the new charge density is $\sigma/(1+\alpha)$, and the energy becomes $u/(1+\alpha)$. Consequently \b[$\Delta u=-\tfrac12\sigma V\alpha+O(\alpha^2)$]. Charge $\sigma\alpha+O(\alpha^2)$ per unit area flows back to the voltage source, which receives energy $\sigma V\alpha+O(\alpha^2)$. The externally supplied mechanical work is still $\tfrac12\sigma V\alpha+O(\alpha^2)$: the field loses half this returned electrical energy and the mechanical work supplies the other half. Thus the <fixed-voltage capacitor energy balance> includes both field and source energy.