For part (b) the energy change through the resistor as your capacitor reduced its voltage from ##V## to ##V-dV## is:
$$ dQ_{rev} = \frac{1}{2}CV^2 - \frac{1}{2}C(V-dV)^2 $$
$$ dQ_{rev} = \frac{1}{2}CV^2 - \frac{1}{2}CV^2 - CVdV - \frac{1}{2}(dV)^2$$
To first order in ##dV##:
$$dQ_{rev} =...