Mathematical calculations of the mean lifetime

If we add up the ages of all the people who die in a determined year and we divide by the number of deaths we have the average life span of this population
Q media= 70 + 75 +82+ 23+12+ 56+ 72+ 74+..... / total nº

If the sample is large, the ages of several individuals coincide, so that, instead of repeating them in the addition, each age is multiplied by the number of persons who live to the said age.
Qmedia = n1·t1+ n2·t2+ n3·t3 +... / N
Being N = n1+ n2+n3+....

Some more exact mathematical calculations lead us to the following expressions:

The integral represents the sum of the infinite terms of the sample with each one multipled by their time of existence before transmuting:

We have substituted dN for its value deriving from the expression::

The integral of the expression leads to: