Answer
a. The stored energy decreases.
b. The stored energy increases.
Work Step by Step
Inserting a dielectric increases the capacitance by a factor of $\kappa$.
a. If Q does not change, equation 17-10 shows that PE changes from $\frac{1}{2}\frac{Q^{2}}{C}$ to $ \frac{1}{2}\frac{Q^{2}}{\kappa C}$. The stored energy decreases.
b. If the voltage does not change, equation 17-10 shows that PE changes from $\frac{1}{2} CV^{2}$ to $\frac{1}{2} \kappa CV^{2}$. The stored energy increases.