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

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.


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.


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.