Before the switch is closed, current flows in the branch having
4μF capacitor, charge q=
20×4μF=80μCWhen the switch is closed, a decaying current flows in all the three loops. That is (left, right and bottom)
So the potential at the top most junction ie; between the two capacitors and 2Ω resistors is x volt (let's assume)
Assuming the node connected on the left that connected 20V and resistance R and 4Ω is 0 volt.
So, from the nodal equation at x, is
=>(x−20)4+(x−0)5=0
x= 809V
Work done by cell= q.V
= Final charge on left plate of 4μF - initial potential on left plate of 4μF
= 4(20-809)
= 4×11.11= 44.44μJ (negative)
Energy absorbed by the capacitor= 12×4×(20−809)2+12×5×(809)2=246.91+197.53=444.44μJ(negative)
Heat produced= Work done by batteries- energy absorbed by capacitors
= −44.44−(−444.44)
= −44.44+444.44
= 400.00μJ