Wolfram Alpha:

```Kinetic Theory of Gases
-----------------------

An ideal gas is defined as one in which all collisions between atoms or molecules are
perfectly eleastic and in which there are no intermolecular attractive forces. One can
visualize it as a collection of perfectly hard spheres which collide but which otherwise
do not interact with each other. In such a gas, all the internal energy is in the form
of kinetic energy and any change in internal energy is accompanied by a change in
temperature.

Consider a molecule striking the wall of a box.  Assume the collision
with the wall is perfectly elastic so that the change in the x momentum
is given by:

mvx - (-mvx) = 2mvx

Now Fx = max = 2mvx/Δt

Now, if we assume the molecule makes a 'round trip' we get:

Δt = 2L/vx

So,

Fx = 2mvx/(2L/vx) = mvx2/L

The force due to N molecules is Nmvx2/L

Now v2 = vx2 + vy2 + vz2 = 3vx2

∴ vx2 = v2/3

P = F/A =  Nmv2/3LA = Nmv2/3V

∴ PV = Nmv2/3 = nRT ... the Ideal Gas Law

Now,

n = N/NA where NA is Avogadro's Number

∴ Nmv2/3 = NRT/NA

mv2/3 = RT/NA

mv2 = 3kBT where kB =  R/NA = BOLTZMANN'S CONSTANT

∴ (1/2)mv2 = 3kBT/2

The total INTERNAL ENERGY of the gas is thus:

U =  3NkBT/2 = 3nRT/2
```