# Why is it “bad taste” to have a dimensional quantity in the argument of a logarithm or exponential function?

I've been told it is never seen in physics, and "bad taste" to have it in cases of being the argument of a logarithmic function or the function raised to $e$. I can't seem to understand why, although I suppose it would be weird to raise a dimensionless number to the power of something with a dimension.

• – Qmechanic Oct 24 '17 at 16:18
• – user121330 Oct 26 '17 at 19:43
• Comments are not for extended discussion; the additional conversation has been moved to chat, and I would ask everyone to please refrain from posting any comments that aren't targeted at improving the question (including by requesting clarification). – David Z Oct 30 '17 at 18:26

## 6 Answers

It's not "bad taste", it's uncalculable to the point of meaninglessness.

The whole point of dimensional analysis is that there are some quantities that are not comparable to each other: you can't decide whether one meter is bigger or smaller than ten amperes, and trying to add five volts to ten kelvin will only yield inoperable nonsense. (For details on why, see What justifies dimensional analysis? and its many linked duplicates on the sidebar on the right.)

This is precisely what goes on with, say, the exponential function: if you wanted the exponential of one meter, then you'd need to be able to make sense of $$\exp(1\:\rm m) = 1 + (1\:\rm m) + \frac12(1\:\rm m)^2 + \frac{1}{3!}(1\:\rm m)^3 + \cdots,$$ and that requires you to be able to add and compare lengths with areas, volumes, and other powers of position. You can try to just trim out the units and deal with it, but keep in mind that it needs to match, exactly, the equivalent $$\exp(100\:\rm cm) = 1 + (100\:\rm cm) + \frac12(100\:\rm cm)^2 + \frac{1}{3!}(100\:\rm cm)^3 + \cdots,$$ and there's just no invariant way to do it.

Now, to be clear, the issue is much deeper than that: the real problem with $\exp(1\:\rm m)$ is that there's simply no meaningful way to define it a way that will (i) be independent of the system of units, and (ii) keep a set of properties that will really earn it the name of an exponential. If what one wants is a simple clear-cut way to see it, a good angle is noting that, if one were to define $\exp(x)$ for $x$ with nontrivial dimension, then among other things you'd ask it to obey the property $$\frac{\mathrm d}{\mathrm dx}\exp(x)=\exp(x),$$ which is dimensionally inconsistent if $x$ (and therefore $\mathrm d/\mathrm dx$) is not dimensionless.

It's also been noted in the comments, and indeed in a published paper, that you can indeed have Taylor series over dimensional quantities, by simply setting $f(x) = \sum_{n=0}^\infty \frac{1}{n!} \frac{\mathrm d^nf}{\mathrm dx^n}(0)x^n$, and that's true enough. However, for the transcendental functions we don't want any old Taylor series, we want the canonical ones: they're often the definition of the functions to begin with, and if someone were to propose a definition of, say $\sin(x)$ for dimensionful $x$, then unless it can link back to the canonical Taylor series, it's simply not worth the name. And, as explained above, the canonical Taylor series have fundamental scaling problems that render them dead in the water.

That said, for logarithms you can on certain very specific occasions talk about the logarithm of a dimensional quantity $q$, but there you're essentially taking some representative $q_0$ and calculating $$\log(q/q_0)=\log(q)-\log(q_0),$$ where in making sense of the latter you require that the two numerical values be in the same units ─ in which case the final answer is independent of the unit itself. If the situation also allows you to drop additive constants, or incorporate them into something else (such as when solving ODEs, for example, with a representative case being the electrostatic potential of an infinite line charge, or when doing plots in log scale) then you might get rid of the $\log(q_0)$ in the understanding that it will come out in the wash when you come back to dot the i's.

However, just because it can be done in the specific case of the logarithm, which is unique in turning multiplicative constants into additive ones, doesn't mean you can use it in other contexts ─ and you can't.

• This discussion should continue in chat, rather than in this comment thread. – rob Oct 25 '17 at 15:08
• As an addendum, while all of the terms $1$, $(1 \ \mathrm{m})$, $(1 \ \mathrm{m}^2)$, $\ldots$ all basically live in different vector spaces, there is occasionally reason to consider all of these spaces together (e.g. as their product, or as the completion of a tensor algebra), and then $\exp(1\ \mathrm{m})$ becomes a meaningful element. I've only seen this sort of thing used fruitfully in pure math contexts, though. – user5174 Oct 26 '17 at 16:22
• I can make sense of "1+(1m)...", it means that you have one point, a length of 1m, an area of ½m², a volume of ⅙m³ and a bunch of hypervolumes. The two issues are that it is not clear what you are measuring if your answer is the addition of different units, and one cannot in general simplify the sum of different units. Arguably in the case of meters you could round off all terms other than the one of highest dimension, but in this case there is no highest dimension. – gmatht Oct 30 '17 at 3:59
• @gmatht Sure, that's the formal power series in AFT's answer. It is consistent enough as a definition, but you're not really bending the exponential to fit it into dimensional analysis - you're getting rid of dimensional analysis entirely. – Emilio Pisanty Oct 30 '17 at 7:01

# Orthodox view

A bit of a formal take at it: $\exp x$ can be expressed as a series:

$$\exp x=1 + x +\frac{x^2}{2!} + \frac{x^3}{3!} + \cdots + \frac{x^n}{n!} + \cdots$$

So if $x$ has unit $X$, then the terms of this series have respective units

$$\text{None}, X, X^2, X^3, \cdots X^n, \cdots$$

which is not dimensionally consistent. The same argument for $\ln$ or for any analytical function (i.e. a function which can be expanded in such a series). This would apply as well to something as simple as

$$\frac{1}{1-x}=1+x+x^2+\cdots.$$

Actually, one does not even need the whole series. Just two terms of a Taylor expansion is enough to force the variable to be dimensionless. For example if a function $f(x)$ goes like

$$f(x) = x - x^2 + O(x^3),$$

as $x$ goes to 0 e.g., then $x$ can't have a dimension $X$, otherwise one would end up adding $X$ and $X^2$. This applies of course to asymptotic series too, like

$$f(x) = \frac{1}{x^2} + \frac{2}{x^3} + O\left(\frac{1}{x^4}\right),$$

as $x\to+\infty$.

# Gaming around the orthodoxy

What about the following argument. I will take a very simple example, involving no series at all,

$$f(x) = x + x^2.$$

The orthodox argument above implies that $x$ shall be dimensionless. But I am going to argue that the coefficients 1 of $x$ and $x^2$ do actually have dimension $X^{-1}Y$ and $X^{-2}Y$, where $X$ is the unit of $x$, and $Y$ would then become the unit of $f(x)$. It makes everything consistent, doesn't it? Yes, but it is a travesty because it means that instead of $f(x)$ we actually deal with

$$f_\text{pseudo}(x) = a\left(\frac{x}{x_0}+\left(\frac{x}{x_0}\right)^2\right),$$

where $x_0$ has unit $X$ and $a$ has unit $Y$, that is to say

$$f_\text{pseudo}(x) = af\left(\frac{x}{x_0}\right).$$

And here it is: the argument of $f$ is indeed dimensionless! The argument generalises to any series. Let's look at exponential as an illustration:

$$\exp x = \sum_{i=0}^n \frac{1}{n!}x^n.$$

So the argument would then be that $1/n!$ has unit $X^{-n}$ actually. Fair enough, but then instead of $\exp$, it means we deal with

$$\exp_\text{pseudo}(x) = a\sum_{i=0}^n \frac{1}{n!}\left(\frac{x}{x_0}\right)^n,$$

where $x_0$ has the dimension $X$, and where now $1/n!$ is dimensionless, and as above $a$ has some dimension $Y$. That is to say that

$$\exp_\text{pseudo}(x) = a\exp\frac{x}{x_0}.$$

So we end up with the argument of $\exp$ being dimensionless.

My visceral opinion about this little game: well, duh! All that for that, really? Moreover, as pointed out by Emilio Pisanty's in the comments, it requires that we pluck a scale $x_0$ (and yet another scale $a$ potentially) from the sky: the whole point of dimensional analysis is that we have taken into account all possible dimensioned quantities beforehand. Here we introduce another one after the fact and it does not make sense to either Emilio or myself.

• Comments are not for extended discussion; this conversation has been moved to chat. – ACuriousMind Oct 27 '17 at 10:42

The reason your instructor called it 'bad taste' rather than just outright wrong is because people will do this all the time with the logarithm. The logarithm is unique because it lets you split out multiplicative factors into additive terms, so people will write something like $$\log(r/r_0) = \log(r) - \log(r_0) = \log(r) + C.$$ The most common way to do this accidentally is through an integral, $$\int \frac{\mathrm dr}{r} "=" \log r + C.$$ This is technically wrong but almost everybody writes it this way. At the end of the day, you can always combine the constants back into the logarithm so the arguments have the right dimensions.

The other answers are correct that when you think of it in terms of unit analysis you cannot add quantities that have different units to each other. Even so, formally you can always do something like $$f\left(\frac{x}{1\operatorname{m}}\right)$$ to get something that works, mathematically.

Where it becomes bad taste/bad practice is that you introduced that denominator, yourself, by hand. In any physical problem that requires you to evaluate some complicated function, like $\sin$, $\ln$, or $\exp$, there will always be some physically relevant quantity with the same units that will allow you to form a unitless quantity. For example, when working with the simple harmonic oscillator we can combine the spring constant, $k$, and the mass, $m$, to produce a quantity with the units of inverse time, $\omega \equiv \sqrt{k/m}$. It is that $\omega$ that allows us to sensibly write $x=A\sin(\omega t)$ to describe the motion of the oscillator.

• The extra factor for the trigonometric and rotational functions is the problem of the "Angle" dimension. As you will know, mathematicians always have to say "Of course angles are in radians", yet the actual right angle is pi/2 rads. The pseudo dimension of "Angle" is an indicator that two independent Length dimensions (i.e. in a 2d/3d space) have been cancelled out when, if they were other dimensions, they (arguably) should not have been. E,g. Torque is in N.m/rad, and dimensionally Work/Angle. It was unfortunate that SI lost the plot regarding supplementary units. – Philip Oakley Oct 25 '17 at 9:28
• Rather like radians and angles with trigonometric functions, it can make sense to apply exponential functions to measurements of things in bels or decibels since they are related to logarithms of ratios. – Henry Oct 25 '17 at 11:27
• @Henry, that's OK unless it's dBm and the like which also (implicitly) embody the log of a unit. Plus you still need the scaling correction (is that 10 log, or 20 log?), and even then it's log vs ln, relative to simply putting the number into the exponential. The Neper may be a compromise for the SI base unit ... – Philip Oakley Oct 26 '17 at 12:50
• There's also the problem of radians and steradians. These are supposedly dimensionless constants, but steradians do not equal radians * radians independently of the angles of the two dimensional object being considered. There's also a dimensionless function (sin(theta) or cos (theta) depending on the representation) involved. – ttw Oct 28 '17 at 2:27

I deliberately set up something that read like so:

f lbs = bridge mV / 2x log2mV / lbs

Yeah that works. The 2 is an obviously dimensionless constant* so the unit really has to go on the x.

It's kind of bad form as really small changes in x correspond to really big changes in the result or otherwise hard to get a feel for what the numbers are going to do.

*When the formula is presented in its native form the 2 does not exist; it only appears when rewriting it in standard form.

• This site uses LaTeX notation for mathematics, which if properly implemented would make this answer at least marginally readable. – Emilio Pisanty Oct 30 '17 at 11:19

The way I look at is is that most units act like multiplicative unknowns. That is we can imagine there is a (possiblly unknown) natural unit for the quantity and the unit is a (possiblly unknown) scale factor that converts our human unit to the natural unit. To make a consistent formula we want all those unknowns to cancel out. Physisits consider units that don't act like multiplicative unknowns (for example Celsius and Fahrenheit) to be bad taste.

So the question becomes what do different functions do to a multiplicative unknown. Lets consider the simple function of raising the number to a power.

$F(x) = x^n -> F(xu) = F(x)F(u)$

Great, we had a good taste unit go in and a good taste unit come out.

Now lets look at the logarithm.

$F(x) = log_n(x) -> F(xu) = F(x) + F(u)$

This result is not a "good taste unit" since it's an additive unknown rather than a multiplicative unknown but it's not terrible to work with. In many circumstances we can cancel the F(u) and arrive at a consistent forumula. Indeed engineers often use the logarithm in this way.

Now lets look at the exponential.

$F(x) = n^x -> F(xu) = (F(x))^u$

ick, I guess in some cases it may be possible to cancel the power but it's pretty horrible to deal with.

## protected by Qmechanic♦Oct 24 '17 at 16:39

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?