For steady state heat conduction in the slab between the source and sink, we have $$\frac{d}{d x}\left(k\frac{d T}{d x}\right)=0$$where k is the thermal conductivity. If we divide this equation by absolute temperature T, we obtain$$\frac{1}{T}\frac{d}{d x}\left(k\frac{d T}{d x}\right)=0$$Next, making use of the product rule for differentiation, we have:$$\frac{1}{T}\frac{d}{d x}\left(k\frac{d T}{d x}\right)=\frac{d}{d x}\left(\frac{k}{T}\frac{dT}{dx}\right)+\frac{k}{T^2}\left(\frac{dT}{dx}\right)^2=0$$Assuming that the source is at x = 0 and the sink is at x = L, if we integrate this equation between x = 0 and x + L, we obtain: $$-\frac{q}{T_C}+\frac{q}{T_H}+\int_0^L{\frac{q^2}{k}dx}=0\tag{1}$$ where the heat flux q is given by $$q=-k\frac{dT}{dx}$$If we rearrange Eqn. 1 slightly, we obtain:$$\frac{q}{T_C}=\frac{q}{T_H}+\int_0^L{\frac{q^2}{k}dx}\tag{2}$$The quantity $\frac{q}{T_H}$ is the rate at which entropy enters the slab per unit area, and the quantity $\frac{q}{T_C}$ is the rate at which entropy exits the slab per unit area of slab. Eqn. 2 tells us that the rate at which entropy exits the slab is equal to the rate at which entropy exits the slab plus the rate at which entropy is generated within the slab. According to Eqn.2, the rate of entropy generation within the slab per unit volume is $q^/k$. This entropy generation rate is, of course, positive definite.