# Does taking the $\log$ of a quantity change the unit of the quantity?

\begin{align} &= c [P - b \ln(P+b)]_1^{500} \\ &= 0.125 \frac{\text{cm}^3}{\text{g}} \times \left[\begin{aligned}&500 \text{ bar} - 2700 \text{ bar} \times \ln(500 \text{ bar} + 2700 \text{ bar}) - \\ &\big(1 \text{ bar} - 2700 \text{ bar} \times \ln(1 \text{ bar} + 2700 \text{ bar})\big)\end{aligned}\right] \end{align} Solve the above calculation and get, $$W = 5.16 \frac{\text{cm}^3 \cdot \text{bar}}{\text{g}}$$

Not sure if this is the right place to post this but doing this question I thought that the $$b\ln(P+b)$$ portion would result in units of $$\text{bar}^2$$ given both $$b$$ and $$P$$ have the unit bar. I fail to see how that's not the case unless $$\ln$$ alters the units.

In the calculation you posted, the author meant to say $$\log\left(3200 \text{ bar}\right) - \log\left(2701 \text{ bar}\right) = \log\left(\frac{3200}{2701}\right),$$ where the right-hand side actually defines what is meant in the left-hand side. Hence, the logarithm has a dimensionless argument and also returns a dimensionless value.

Remark: I'm keeping the following paragraphs because the comment by Chemomechanics pointed out to an interesting reference (DOI: 10.1021/ed1000476) that exhibits a problem with the argument I presented using a Taylor series. John Davis also pointed out that a similar argument for the function $$\frac{1}{x}$$ expanded about $$x=1$$ would lead to an inconsistency. While my argument is wrong, I think that keeping these opposite views in here is interesting.

It doesn't really make sense to take the logarithm of a quantity with units. Both the argument and the result should be dimensionless numbers. The reason can be seen by expanding it in a Taylor series. We get $$\log(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} + \cdots$$ Each of these terms has a different power. Hence, if $$x$$ has units, we'd run into trouble with attempting to compute a quantity that is given by a sum of a meter, with meter squared, with meter cubed, and so on. It is inconsistent.

Due to the same argument, any function that can be written as a Taylor series and it not just a monomial only receives dimensionless arguments.

• I skipped a few lines in the calculation, but you can rewrite the expression in terms of the combination I wrote explicitly. Jun 26 at 0:58
• I don't quite buy this argument. For example the reciprocal of quanity with dimension is a quanitity with different dimension, but the Taylor series of $1/x$ at $1$ is $1 - (x-1) +(x-1)^2 - (x-1)^3+...$ Jun 26 at 9:24
• The problem with this Taylor-series argument is discussed in Matta et al.'s "Can One Take the Logarithm or the Sine of a Dimensioned Quantity or a Unit? Dimensional Analysis Involving Transcendental Functions". Briefly, you forgot to include the units of the partial derivatives in your expansion (e.g., $\frac{(dx)^n}{n!}\frac{\partial^nf(x)}{\partial x^n}$. If you had, you would have found that all the terms have the same units after all. In other words, the Taylor series is not the reason that we can't take logarithms of unitfull quantities. Jun 27 at 0:59
• Anyone have a sense of deja vu? Jun 27 at 18:51
• Jun 27 at 19:37

Actually your expression only involves taking the logarithm of a unit-less quantity.

To see this remember $$\ln x - \ln y = \ln \frac{x}{y}$$ and rewrite the expression:

\begin{align} & c\left[P - b\ln(P+b)\right]_{P_1}^{P_2} \\ =& c\left[P_2 - b\ln(P_2+b)-P_1+\ln(P_1+b)\right] \\ =& c\left[P_2 - P_1 + \ln\frac{P_1+b}{P_2+b} \right] \end{align}

Now we can see that we have the logarithm of a unit-less quantity. And therefore the unit of $$P$$ and $$b$$ doesn't matter.

• In fact I suppose you can always divide out the units inside the logarithm. Given quanitity $a>0$ which is in units where $\alpha$ is the unit quantity: $\log{a} = \log{a} - 0 = \log{a} - \log{\alpha} = log{\frac{a}{\alpha}}$ Jun 27 at 1:30