Capacitor and Slab

You are given a capacitor with the surface area $S$ having distance between the armatures $d$. The capacitor is charged with surface densities $\pm\sigma$ and the the voltage source is disconnected. A neutral conducting slab, of thickness $d/2$ is released from outside. Please find the kinetic energy of the slab when it is completely inside the capacitor. What if the voltage source remains connected to the capacitor?

Initial capacitance is $C_0=\epsilon_0S/d$. No matter how you insert the conducting slab between the armatures, the final capacitance obtained will be $C=2C_0$. Extreme cases:

-You insert the slab exactly at the position of one armature. You will have one final $C$ with distance between armatures $d/2$.

$C=\frac{\epsilon_0S}{d/2}=2C_0$

-You insert the slab exactly at the middle disatnce between armatures. You will have two final capacitors connected in series and having a distance between armatures $d/4$.

$1/C=\frac{s/4}{\epsilon_0S}+\frac{s/4}{\epsilon_0S}$  that is $C=2C_0$

Initial and final energy of the capacitor is

$W_0=Q^2/(2C_0)$   and  $W=Q^2/4C_0$
the kinetic energy of the slab is just

$E_k=W_0-W=Q^2/(4C_0)=\frac{(\sigma S)^2}{4\epsilon_0S/d}=\frac{\sigma^2Sd}{4\epsilon_0}$

If there is a battery connected, the potential on the plates remains the same.

The initial and final energy of the capacitor is   $W_0=(C_0U^2/2)$   and $W=C_0U^2$
Initial and final charge on capacitor is $Q_0=C_0U$  and $Q=2C_0U$

Work done by the battery is  $W_b=\frac{(Q-Q_0)U}{2}=C_0U^2/2$

Kinetic energy of slab is

$E_k=W-W_0+W_b=C_0U^2=C_0*(Q_0/C_0)^2=Q_0^2/C_0=\frac{(\sigma S)^2}{\epsilon_0 S/d}=\frac{\sigma^2 Sd}{\epsilon_0}$