Step 1: Analyze the initial state (with dielectric, connected to battery).
Capacitance with air, $C_{air} = 4 \mu$F.
Dielectric constant, $K=5$.
Capacitance with dielectric, $C_{diel} = K \cdot C_{air} = 5 \times 4 \mu\text{F} = 20 \mu$F.
The capacitor is charged to a potential $V_1 = 100$ V.
The charge stored on the capacitor is $Q = C_{diel} \cdot V_1 = (20 \times 10^{-6} \text{ F})(100 \text{ V}) = 2000 \times 10^{-6} \text{ C} = 2 \times 10^{-3}$ C.
The energy stored initially is $U_1 = \frac{1}{2} C_{diel} V_1^2 = \frac{1}{2} (20 \times 10^{-6})(100)^2 = 10 \times 10^{-6} \times 10^4 = 0.1$ J.
Step 2: Analyze the final state (dielectric removed, battery disconnected).
The battery is disconnected, so the charge $Q$ on the plates remains constant. $Q = 2 \times 10^{-3}$ C.
The dielectric is removed, so the capacitance reverts to the capacitance with air, $C_{final} = C_{air} = 4 \mu$F.
The energy stored in this final state is $U_2 = \frac{Q^2}{2C_{final}}$.
$U_2 = \frac{(2 \times 10^{-3})^2}{2 \times (4 \times 10^{-6})} = \frac{4 \times 10^{-6}}{8 \times 10^{-6}} = \frac{1}{2} = 0.5$ J.
Step 3: Calculate the work done.
The work done by an external agent to remove the dielectric is equal to the change in the potential energy stored in the capacitor.
Work Done = $U_2 - U_1$.
Work Done = $0.5 \text{ J} - 0.1 \text{ J} = 0.4$ J.
Positive work is done because the electric field pulls the dielectric in, so an external agent must do work to pull it out against this force.