A dielectric has an equation of state $P=\chi E V$, where $\chi$ is a function of temperature only. Show that the work done in an isothermal, quasi-static change of state is given by
$$
W=\frac{1}{2 V_{\chi}}\left(\mathcal{O}_{f}^{2}-\boldsymbol{P}_{i}^{2}\right)=\frac{V_{\chi}}{2}\left(E_{f}^{2}-E_{i}^{2}\right)
$$