H = i 2 rt
The reason behind the heat produced is the collision of the free electrons with the lattice ions or atoms while accelerating in presence of the external electric field.
Now,
we know that
volt= work done/ total charge or v = w/q
from this, we get,
w= vq
and, we know that
current i = q / t
so,
q = it
And, We know, from ohms law
v = ir
putting this in the previous equation (i.e. w =vq)
we get w = (ir)(it)
w = irit = i2rt joule
as work is stored as heat
so,
H = I2RT Joules
Regards