Consider a resistor with current running through it for some time in a constant temperature bath. I understand that the change in entropy of the resistor is zero because there is no change between the initial and final thermodynamic state. However, I am trying to come up with a reversible process in which to calculate explicitly the change in entropy as zero. First I initially consider the work performed on the resistor and no heat is added. TdS = dU - dW = 0, since the change in the energy is due solely to the work. Then the resistor is brought into contact with the bath and heat flows from the resistor to the bath TdS = -dW = -I^2*R*t. So I'd get a negative change in entropy for the entire process (for the resistor). Where in teh cycle have I made a mistake?