The mathematical link between them comes from the formula of the price elasticity of demand:

where
stands for Price,
for quantity demanded,
for change in quantity demanded, and
for change in price.[1] Here the minus sign converts the result to a non-negative number, as is conventional but not universal.
Using the idea of limits for infinitesimal changes in price and therefore in quantity, the formula becomes

Total revenue is given by
.
Since quantity demanded Q is a function of price P,
total revenue can be rewritten as

The derivative of total revenue with respect to P is thus:

But
, so
.
After both multiplying and dividing by
, the equation can be rewritten as:

The last step is to substitute the elasticity of demand for
to obtain:
.
To find the elasticity of demand using the mathematical explanation of the total revenue test, it's necessary to use the following rule:
If demand is elastic,
, then
: price and total revenue move in opposite directions.
If demand is inelastic,
, then
: price and total revenue change in the same direction.
If demand is unit elastic,
, then
: an increase in price has no influence on the total revenue.