Energy Absorption By Series Resistance During Cap Charging
The energy that the battery supplies is the integral of the \$V_{in}I(t)\$, which is just the total charge that left the battery during the charging time:

\$E_{battery} = V_{in} \cdot \int{I \cdot dt}  = QV_{in}\$

All that charge got to the capacitor (since they share the same current), and the energy in the capacitor can also be written in terms of charge (using Q=CV):

\$E_{capacitor} = \frac{1}{2}CV_{in}^2\ = \frac{1}{2}QV_{in}\$

Subtracting the two will give the amount of energy lost to the resistance during charging:

\$E_{battery} - E_{capacitor} = E_{resistance} = \frac{1}{2}QV_{in}\$ which is the same as the energy in the capacitor.