# Average force and pressure in a 3D box due to quantum non-interacting particles

A gas of non-interacting quantum particles occupies a box with lengths $L_1, L_2, L_3$. Calculate its energy and thus the average force and pressure exerted by the gas on the walls of the box.

I have this as a solved example but the steps aren't explained and I'm confused. I tried looking online for a similar derivation but couldn't find anything. The idea is to express the energy and calculate the force as its gradient but it does so taking the derivatives with respect to the lengths $L_1, L_2, L_3$ which I find puzzling. I mean if we had an expression for a potential at any points in the space in the box than I would understand this approach but as it is, I don't see it!

Here's the expression for energy which is then differentiated w.r.t to the $L$'s to get the force:

$$E = \frac{\hbar ^2}{2m} \left( \left( \frac{n_1}{L_1} \right) ^2 + \left( \frac{n_2}{L_2} \right) ^2 + \left( \frac{n_3}{L_3} \right) ^2 \right)$$

-
A very similar derivation is given in the first chapter or two of Introduction to Physical Gas Dynamics by Vincenti and Kruger (amazon.com/Introduction-Physical-Gas-Dynamics-Vincenti/dp/…) where it's explained very well how to go from the motion of particles in a box to pressure. – tpg2114 Jun 11 '13 at 19:49

Energy is conserved, so in order to lift the weight, the energy in the piston must go down. The gain in the weight's energy is the work done on it, which is the pressure times the area times the distance moved. Since this gain in the weight's energy is the same as the energy lost by the piston, changes in the piston's energy tell us the work done by pressure. For a piston of length $l$
$$\Delta(\text{piston's energy}) = F\Delta l$$
taking derivatives with respect to $l$ gives
$$\frac{\text{d(energy)}}{\text{d}l} = F = P*A$$