$dU = \sum E_i dp_i + \sum dE_i p_i = TdS - PdV \implies \sum dE_i p_i = - PdV$? This is a formula my professor gave in class, but I'm entirely lost how he arrived at the conclusion (I understand the assumption). Could anyone help me?
 A: Not sure about your question. Here are some suggestions:

*

*In thermodynamics we define internal energy as $U = U(S, V)$ (number of particles is constant). Then we write it's differential:$$dU = \frac{\partial U}{\partial S}dS + \frac{\partial U}{\partial V} dV$$ Now we recall 1st law of thermodynamics $dU = \delta Q + dW $ together with 2nd (or it's consequence) $dS = \frac{\delta Q}{T}$ and combine all these formulas together:$$ dU = TdS + dW $$ Now we have formula for an arbitrary reversible process that involves heat exchange ($\delta Q$) and work applied to it ($dW$). When we say that we have a gas we simply say $dW = -pdV$.

*In statistical physics usually we define internal energy as an average energy value for all microstates. For discrete energy levels this results to the sum: $$U = \sum_i p_i E_i$$ where $i$ -- labels the state, $p_i$ -- probability to find a microstate in a state with energy $E_i$. It's simply  a definition of discrete average : $\bar x = \sum_i p_i x_i$.

*Now we are ready to combine (1.) and (2.). We see that in your last equation $TdS$  = ($\delta Q$) is missing, thus equal to zero. Then we conclude that your teacher (most probably) meant adiabatic process.

That's what I understand from your subject.
