d
Battery is removed. Therefore, charge stored in the plates
will remain constant.
$Q=C V=\frac{\varepsilon_{0} A}{d} V \text { or } Q=\text { constant }$
Now, dielectric slab is inserted. Therefore, $C$ will increase.
New capacity will be,
$C^{\prime}=K C=\frac{\varepsilon _{0} K A}{d} \Rightarrow V^{\prime}=\frac{Q}{C^{\prime}}=\frac{V}{K}$
and new electric field $E=\frac{V^{\prime}}{d}=\frac{V}{K . d}$
Potential energy stored in the capacitor,
Initially, $U_{i}=\frac{1}{2} C V^{2}=\frac{\varepsilon _{0} A V^{2}}{2 d}$
Finally, $U_{f}=\frac{1}{2} C^{\prime} V^{\prime 2}=\frac{1}{2}\left(\frac{K \varepsilon_{0} A}{d}\right)\left(\frac{V}{K}\right)^{2}=\frac{\varepsilon_{0} A V^{2}}{2 K d}$
Work done on the system will be
$|\Delta U|=\frac{\varepsilon_{0} A V^{2}}{2 d}\left(1-\frac{1}{K}\right)$