Ideal chain / entropic spring - what is the *microscopic* force? The ideal chain is the classic example of an entropic force. Usually one derives this force from the fundamental relation describing forces in the canonical ensemble:
$$
\tag 1
F = (\partial \langle E \rangle / \partial x)_T - T (\partial S / \partial x)_T
$$
where $x$ is the length of the chain.
The first term is identified as ordinary force, and the second as entropic force. The definition of the ideal chain makes the energy $E$ constant for all configurations, and so there is no ordinary force. Yet, the entropy $S$ for a given $x$ varies (see the wikipedia article for why this is so), so there is an entropic force and we are told this is found to agree reasonably well with experiments.
There is an important connection with ideal gases. If we apply (1) to an ideal gas, with volume in place of $x$, the pressure of an ideal gas is seen to also be an entropic force, since its $\langle E \rangle$ is proportional to $T$ but independent of volume. So there is a strong analogy between stretching a rubber band (made of polymers sort of like ideal chains), and compressing an gas (made of molecules sort of like ideal gas particles).
However I have a doubt about the ideal chain model, that there is no apparent microscopic force acting in the ideal chain. Afer all, the same thermodynamic force can be written equivalently as:
$$
\tag 2
F = (\partial \langle E \rangle / \partial x)_S
$$
In an ideal gas, this expression of the force corresponds to to the microscopic picture of adiabatically changing the volume under the influence of molecules randomly pounding on its surface. Each time the boundary is moved inwards, there is a chance that a molecule is in the process of colliding with the wall and so the moving wall gives energy to the molecule. In this way when entropy is held constant, the energy of an ideal gas does change with volume.
The problem is that in an ideal chain, it seems impossible to understand the force using (2). We are told the energy is supposed to be constant which lets is ignore the first term in (1) but this would produce zero force in (2)! Analogizing to the ideal gas, there must be a microscopic force in a chain that is randomly pulling against the end of the chain, such that (2) agrees with (1), but what is it?
I have a strong suspicion about the solution, which I will add as an Answer below.
 A: The missing piece is the inertia of the chain links. In other words, the ideal chain model only examines possibilities over the configurational coordinates of the chain's phase space, and completely neglects the momentum coordinates. In this sense the ideal chain model is not a real statistical mechanical calculation, since it does not integrate over the real mechanical phase space.
We would face the same situation with the ideal gas if we calculated entropy of the ideal gas based only on where the atoms could be, and not how fast they could be moving. It would give an incorrect expression for entropy, like $k \ln V$ per molecule, missing several additive terms also dependent on mass and temperature. Using (1) this would lead to the correct expression for pressure ($kT/V$ per molecule), but we would fail to see in (2) where the force comes from microscopically.
In the same way, the reason the ideal chain gets away with neglecting the chain links' momentum is that it cheats and produces the wrong entropy missing many terms, yet this entropy does have the correct value of $(\partial S/\partial x)_T$. Anyway, this answers where the force comes from in the microscopic picture: it is caused by the inertia of the chain links wiggling around randomly, but on average pulling the chain ends together. When the chain ends are moved inwards, on average the chain at that time will be moving in such a way that its motion is accelerated by the changing end positions.
(An aside: If this what is going on, why is this not mentioned in the many articles I've seen that discuss the entropic spring? I think it's good to have both micro and macro pictures.)
I wonder though, whether it's true that including inertia would produce the exact same force. After all, the chain links are rigidly fixed and so all of their speeds are somehow correlated with each other.
