Answer
See the detailed answer below.
Work Step by Step
$$\color{blue}{\bf [a]}$$
We know that the electric field between two parallel plates [inside a capcitor] is given by
$$E=\dfrac{\eta}{\epsilon_0}=\dfrac{q}{A\epsilon_0}\tag 1$$
And we know that the electric potential between the two plates is given by
$$\Delta V_C=Ed $$
where $d$ is the separation distance between the two plates.
Plug $E$ from (1),
$$\Delta V_C=\dfrac{qd}{A\epsilon_0}\tag 2$$
Recalling that $U=qV$, so
$$dU=dq \Delta V_C$$
Plug $\Delta V_C$ from (2),
$$\boxed{dU= \dfrac{qd}{A\epsilon_0}dq}$$
This is the infinitesimal increase in electric potential energy.
$$\color{blue}{\bf [b]}$$
We just need to integrate the boxed formula above.
$$\int_0^UdU=\int_0^Q \dfrac{qd}{A\epsilon_0}dq$$
$$U= \dfrac{d}{2A\epsilon_0}\int_0^Qq dq= \dfrac{d}{A\epsilon_0} q^2\bigg|_0^Q$$
$$U= \dfrac{Q^2d}{A\epsilon_0} $$
And from (2),
$$U= \dfrac{Qd}{A\epsilon_0}\dfrac{Q}{2}=\frac{1}{2}Q\Delta V_C $$
$$\boxed{U=\frac{1}{2}Q\Delta V_C =U_{\rm cap}}$$