5. (4 points) An electrical circuit consists of a resistor with resistance $R$ and a capacitor with capacitance $C$ connected in series. A galvanic cell with electromotive force (emf) $\mathcal{E}$ and internal resistance $r$ is connected to the ends of the circuit. Determine the amount of heat released in the resistor with resistance $R$ during the charging of the capacitor.

## Possible solution.

During the charging of the capacitor, the electric charge passing through the circuit is

$$
q=C \varepsilon
$$

In this process, the capacitor acquires potential energy

$$
W=\frac{C \varepsilon^{2}}{2}
$$

The work done by the galvanic cell to transfer the charge through the circuit is

$$
A=q \varepsilon=C \varepsilon^{2}
$$

The amount of heat released on the resistor and the internal resistance of the source in total is

$$
\begin{gathered}
Q=A-W=\frac{C \varepsilon^{2}}{2} . \text { The circuit is in series, therefore } \\
Q_{R}=\frac{C \varepsilon^{2} R}{2(R+r)} .
\end{gathered}
$$