Solution:
Key idea: The energy stored in a capacitor is the work done in charging it, U=2CQ2. With the battery disconnected the charge cannot change, so a dielectric changes only C, V and U.
(i) Energy stored in a charged condenser

Step 1 — Look at the condenser part-way through charging.
Let a condenser of capacitance C be charged slowly. At an instant when it holds a charge q, the potential difference across it is
v=Cq
Step 2 — Find the work for a small extra charge.
To move a further small charge dq from the negative plate to the positive plate, work must be done against this potential difference.
dW=vdq
dW=Cqdq
Step 3 — Add up the work for the whole charging.
Integrate from zero charge up to the final charge Q.
W=∫0QCqdq
W=2CQ2
The potential difference grows in proportion to the charge, so on a graph of charge against potential difference this work is the area of a right triangle with sides Q and V: half of QV.
Step 4 — Write the stored energy.
This work is stored as electrostatic energy in the field between the plates. Using Q=CV, it can be written in three equivalent forms.
U=2CQ2
U=21CV2
U=21QV
(ii) Effect of the dielectric slab
Step 5 — Write the values before the slab goes in.
Let the slab have dielectric constant K. Its thickness is d, so it fills the whole gap. Before it goes in, the capacitance is
C0=dε0A
The charge is
Q0=C0V0
The stored energy is
U0=21C0V02
Step 6 — Find the change in charge.
The battery has been disconnected, so the charge has nowhere to go. The charge stays Q0: there is no change.
Step 7 — Find the change in capacitance.
The slab fills the gap, so the capacitance becomes
C=dKε0A
C=KC0
The capacitance increases K times, a rise of (K−1)C0.
Step 8 — Find the change in potential difference.
With the charge fixed, the new potential difference is
V=CQ0
V=KV0
The potential difference falls K times. The decrease is
ΔV=V0(1−K1)
Step 9 — Find the change in stored energy.
With the charge fixed, the energy is best found from 2CQ2.
U=2KC0Q02
U=KU0
The stored energy falls K times. The decrease is
ΔU=U0(1−K1)
In terms of the given quantities,
ΔU=2dε0AV02(1−K1)
Step 10 — Explain what happens to the energy difference.
The energy difference is not destroyed. The fringing field at the edges of the plates pulls the polarised slab into the gap, so the field does work on the slab equal to this energy difference. If the slab is let go it gains kinetic energy. If it is held and eased in, the work is done on the hand holding it, and any damped motion ends up as heat.
Therefore, with the battery disconnected the charge is unchanged, C becomes KC0, V becomes V0/K and U becomes U0/K; the energy difference U0(1−1/K) is the work done by the field in pulling the slab in.