R= 2+4=6Ω
in series connection, same current and different voltage
total voltage= total current × total resistance
6=I×6
I=6/6= 1A
voltage across 4Ω resistor= 1×4=4v
Therefore, heat dissipated by the 4Ω resistor in 5s= (v²/R)×t= (4²/4)× 5 = 16/4 × 5 = 20J