In Zemansky and Dittman's Heat and Thermodynamics (7th ed., p. 208) change of entropy is computed along a reversible path connecting an initial non-equilibrium state and a final equilibrium state. The example quoted is of a rod heated at one end, with a final equilibrium state having a constant temperature profile.
Details: The rod is initially kept in touch with a high and low temperature reservoir at the two ends, assuming a linear temperature distribution. This is not an equilibrium state. The rod is then removed from the reservoirs, and the final equilibrium state is the average of the temperature of the high and low temperature reservoirs. The authors consider the rod to be composed of thin slices each of which has a (different) initial temperature and the same final temperature. They assume a reversible isobaric process for each slice and find the change in entropy by integrating over one volume element (in contact with a series of reservoirs from initial to final temperature) and then a second integration over the whole volume to get the net change in entropy for the system.
Can we use the same technique for a problem wherein both the initial and final states are not in equilibrium, by replacing the process with a reversible path ?
An earlier query, does not address this issue: Entropy and reversible paths