Show that the power dissipated in a resistor over infinite time is equal to the energy stored in a discharging capacitor
The voltage across a capacitor discharging (exponentially) through a resistor is: -

\$V = V_0\times e^{\dfrac{-t}{CR}}\$ where Vo is the voltage at t = 0

The current is the above voltage divided by R

So, power is \$\dfrac{V_0^2}{R}\times e^{\dfrac{-2t}{CR}}\$

Note that the exponential term now has a 2 in it because it became squared.

Now if you integrate power you accumulate the energy: -

\$\dfrac{V_0^2}{R}\times \dfrac{CR}{-2}\left[e^{\dfrac{-2t}{CR}}\right]_0^\infty\$

If you resolved the integral between 0 and infinity it comes to -1 hence energy taken by resistor is simply: - 

\$\dfrac{CV_0^2}{2}\$