[Physics] Dimensional analysis – application to logarithms

dimensional analysis

I read some nice threads about this topic:
physics StackExchange
maths StackExchange
stats StackExchange

However, it still puzzles me that logarithm of some physical quantity has no units.
Example, let's assume we have a collection of values of the distance between two cities.
In set A, distances are expressed in km, while in set B distances are expressed in m.

If I apply a logarithmic transformation to both sets and compute the average and standard deviation I get two different values for the first parameter and the same for the latter.

The latter makes sense because I'm subracting logarithms and that is equal to a division operation so I get dimensionless values for the standard deviation.

For the average value I get different values. Assuming that the logarithmic transformation returns dimensionless values in principle I could sum the average values of sets A and B and get a number, however this doesn't make sense since sets A and B are not expressed in the same scale of length unit. Therefore one can argue that you must still somehow keep track of dimensions when you do logarithmic transformations or you might end up summing apples and oranges.

What is your take on the above?

Best Answer

The reason a logarithmic function, or an exponential function can't have dimensions is easy to see if you consider what the expression for a logarithm is in terms of a power series.

$$ \begin{align} \ln x &= (x-1) - \frac{(x-1)^2}{2} + \frac{(x-1)^3}{3} + \cdots\\ &= \sum\limits_{n=1}^\infty \left((-1)^{n-1}\frac{(x-1)^n}{n}\right) \end{align} $$

If $x$ has dimensions (say of length), then it's clear that $\ln x$ is just a nonsensical physical quantity because its dimensions make no sense at all. So $x$, and hence $\ln x$, must be pure numbers.

A similar argument applies to exponentials:

$$\exp x = \sum\limits_{n=0}^\infty \frac{x^n}{n!}$$

So $x$, and $e^x$ must be dimensionless. This also applies to trig functions of course.

In particular this means you can't take the logarithm or exponential of any physical quantity: you can only ever take logarithms or exponentials or ratios of physical quantities, which are pure numbers.

Here's an example of taking logarithms in a legitimate way. If we have some quantity with a dimension, $q$, we can express it as $q = xu$ where $x$ is a pure number and $u$ is a unit of the same dimension as $q$. So if we want a quantity with the dimension of length we can express it as $d\,\mathrm{mi}$, where $\mathrm{mi}$ is a mile. So for any quantity with a dimension we can construct a pure number by dividing by the unit:

$$\frac{d\,\mathrm{mi}}{1\,\mathrm{mi}} = d$$

And it's fine to take logs of this. And using this technique we can do things like combining logarithms of quantities with different units:

$$\ln\left(\frac{x\,\mathrm{chain}}{1\,\mathrm{chain}}\right) + \ln\left(\frac{y\,\mathrm{furlong}}{1\,\mathrm{furlong}}\right) = \ln \left(xy \frac{\mathrm{chain}\,\mathrm{furlong}}{\mathrm{chain}\,\mathrm{furlong}}\right) $$

(A $\mathrm{chain}\,\mathrm{furlong}$ is an acre.)

The units don't have to be dimensionally the same even in cases like this

$$\ln\left(\frac{A\,\mathrm{acre}}{1\,\mathrm{acre}}\right) + \ln\left(\frac{m\,\mathrm{month}}{1\,\mathrm{month}}\right) = \ln \left(Am \frac{\mathrm{acre}\,\mathrm{month}}{\mathrm{acre}\,\mathrm{month}}\right) $$

Acre months might be a useful unit for computing rent on land, say.