We must now derive an expression for the mean molecular weight, , for use in the equation of state that we have just formulated.

An exact calculation of is very complicated as it depends on the fractional ionisation of all the elements in all parts of a star. Fortunately, we can simplify things enormously and only introduce a small error in the calculation of by assuming that all of the material in a star is fully ionised. This is a valid assumption because hydrogen and helium are very much more abundant than all of the other elements and they are certainly fully ionised in stellar interiors. Near the cool stellar surface, however, where hydrogen and helium are not fully ionised, the assumption breaks down.

If all the stellar material is assumed to be fully ionised, the calculation of proceeds as follows. Let us define:

X = fraction of material by mass in form of hydrogen,
Y = fraction of material by mass in form of helium, and
Z = fraction of material by mass in form of heavier elements.

Hence,

X + Y + Z = 1.

This means that in a cubic metre of stellar material of density , there is a mass

X of hydrogen,

Y of helium, and

Z of heavier elements.

Now, in a fully ionised gas,

 hydrogen gives 2 particles per mH (a proton and an electron), helium gives 3/4 particle per mH (a nucleus containing 2 protons and 2 neutrons = 4mH and two electrons), and heavier elements give ~1/2 particle per mH (e.g. Carbon gives a nucleus containing 6 protons and 6 neutrons = 12mH and six electrons = 7/12, Oxygen gives a nucleus containing 8 protons and 8 neutrons = 16mH and eight electrons = 9/16, etc.)

Thus the number of particles per cubic metre due to

hydrogen = 2X / mH,

helium = 3Y / 4mH, and

heavier elements = Z / 2mH.

The total number of particles per cubic metre is then given by the sum of the above, i.e.

n = (2X / mH) + (3Y / 4mH) + (Z / 2mH).

Rearranging, we obtain:

n = ( / 4mH) (8X + 3Y + 2Z).

Now, X + Y + Z = 1, and hence Z = 1 - X - Y, giving:

n = ( / 4mH) (6X + Y + 2).

Recalling that = nmH , we can write: = 4 / (6X + Y + 2),

which is a good approximation to except in the cool outer regions of stars. For solar composition, X =0.747, Y =0.236 and Z =0.017, resulting in ~ 0.6, i.e. the mean mass of the particles in the Sun is a little over half the mass of a proton.