Wolfram Alpha:

```The Ideal Gas
-------------

The basic equations:

Pi = (1/Z)exp(-βEi)

Z = Σie-βEi

E  = -∂lnZ/∂β

KBT = 1/β

S = βE + lnZ

A = -KBTlnZ

Consider a box with volume, V, and N identical non-interacting
particles.  The states are the continous collection of the position
and momentum states for each particle.  Compute the partition
function.

Z = ∫dx3Ndp3Nexp(-βΣn(pn2/2m))

= (VN/N!)[∫exp(-βp2/2m)dp]3N

The N! is to compensate for the fact that the states in classical
mechanics are distinguishable.

Let u2 = βp2/2m ∴ p = u√(2m/β) and dp = √(2m/β)du. The ∫
becomes:

Z = (VN/N!)[√(2m/β)∫exp(-u2)du]3N

= (VN/N!)(2mπ/β)3N/2

Now,

lnZ = -(3/2)Nlnβ + constant

E = ∂lnZ/∂β

= (3/2)NKBT where β = 1/KBT

This is the familiar term associated with the energy of an ideal
gas.

Pressure
--------

Consider a piston of area, A that is moved a distance, dx, by
the gas (the gas is doing work on the piston).

dE = -PAdx   (work = force x distance)

= PdV

∴ P = -∂E/∂V

Consider an adiabatic process.  The change in entropy associated with
an adiabatic process is 0 (ΔS = 0).  Thus, we can write:

P = -∂E/∂V|S

Theorem:

∂E/∂V|S = ∂E/∂V|T - (∂E/∂S|V)(∂S/∂V|T)

Proof:

Consider following diagram:

T
|  \
|   \
|    \
|     \
|      \
|
------------------------------ V

How does E change along a line of constant S?

ΔE/ΔV|T = (∂E/∂V|T)ΔV + (∂E/∂V|V)ΔT

ΔE = (∂E/∂V|T)ΔV + (∂E/∂V|V)ΔT

ΔE/ΔV = ∂E/∂V|T + (∂E/∂V|V)(ΔT/ΔV)

= ∂E/∂V|T + (∂S/∂T|V)(∂E/∂S|V)(ΔT/ΔV)

Along the S curve dS = 0.  Therefore,

dS = (∂S/∂V|T)ΔV + (∂S/∂T|V)ΔT = 0

Therefore,

ΔT/ΔV = -(∂S/∂V|T)/(∂S/∂T|V)

Substituting back into the ΔE/ΔV equation gives:

ΔE/ΔV ≡ ∂E/∂V|S = ∂E/∂V|T - (∂S/∂T|V)(∂E/∂S|V)(∂S/∂V|T)/(∂S/∂T|V)

= ∂E/∂V|T - (∂E/∂S|V)(∂S/∂V|T) Q.E.D.

Now T = ∂E/∂S|V.  Therefore,

∂E/∂V|S = ∂E/∂V|T - T∂S/∂V|T

= ∂(E - TS)/∂V|T

= ∂A/∂V|T where A is the Helmholtz Free energy

P = -∂E/∂V|S

= -∂E/∂V|T + (∂E/∂S|V)(∂S/∂V|T)

= -∂(E - TS)/∂V|T

= -∂A/∂V|T

= KBT∂lnZ/∂V|T since A = -KBTlnZ

From the ideal gas we found:

Z = (VN/N!)(2mπ/β)3N/2

Therefore,

lnZ = NlnV + (3N/2)ln(2mπ/β) - lnN!