26
$\begingroup$

So I have never actually found a good answer or even a good resource which discusses this so I appeal to experts here at stack exchange because this problem came up again today. What happens to the units of a physical quantity after I take its (natural) logarithm. Suppose I am working with some measured data and the units are Volts. Then I want to plot the time series on a log-scale, only the ordinate is on the log scale, not the abscissa. So the x-axis is definitely in time (seconds let's say) but what are the units on the y-axis? Will it be Volts or log(Volts) or something? If I square the quantities, then the units are squared too so what if I take the log? A rationale in addition to the answer will be appreciated as well.

I guess whatever the answer, the same goes for taking the exponential or sine of the data too, right?

$\endgroup$
  • 2
    $\begingroup$ The units remain the same, you are just scaling the axes. As an analogy, plotting a quantity on a polar chart doesn't change the quantities, it just 'warps' the display in some useful way. However, some quantities are 'naturally' expressed as logs (dB, for example), but these are always dimensional quantities (sometimes implicitly referenced to a known quantity). $\endgroup$ – copper.hat Nov 16 '12 at 2:45
  • $\begingroup$ If $x = 0.5$ is measured in some units, say, seconds, then taking the log actually means $\ln (0.5s/1s) = \ln (0.5)$. Hope this helps. $\endgroup$ – glebovg Nov 16 '12 at 2:51
  • 2
    $\begingroup$ Prince Ali, you wrote "same goes for taking the exponential or sine of the data too, right?" - what about taking the square as you mention - the square of length is area, which is not length. $\endgroup$ – alancalvitti Nov 16 '12 at 3:22
15
$\begingroup$

Overall, the argument $x$ of $\ln(x)$ must be unitless, and a log transformed quantity must be unitless. If $x = 0.5$ is measured in some units, say, seconds, then taking the log actually means $\ln(0.5s/1s) = \ln(0.5)$. See this for more information about other transcendental functions. Hope this helps.

$\endgroup$
  • 5
    $\begingroup$ Love the paper, going into the permanent archives. Also explains why classic arguments (like anorton's response below) is wrong. I was surprised to learn that too. $\endgroup$ – Fixed Point Nov 16 '12 at 22:52
  • $\begingroup$ The paper seems interesting, but I can't read it (not willing to pay $35 for it at the moment). Can you give a 25 words or less summary of their main argument? I read the abstract but they don't cover the rationale there. $\endgroup$ – Robert Dodier Mar 11 '14 at 20:04
  • $\begingroup$ @RobertDodier I found the aforementioned article on Matta's (one of the authors) website. $\endgroup$ – glebovg Mar 13 '14 at 0:14
  • 3
    $\begingroup$ @glebovg Thanks for the link. I read the paper, but I have to admit I'm doubtful about their conclusions. They don't have any kind of an argument as to exactly why transcendental functions must have dimensionless arguments; simply repeating the conclusion over and over isn't an argument. Stuff like log(10 meters) = log(10) + log(meters) doesn't make sense, they claim, but that's not a mathematical attitude, right? The mathematical approach would be to find a consistent interpretation of apparently-nonsensical expressions, or prove there cannot be one. Simply giving up isn't proof of anything. $\endgroup$ – Robert Dodier Mar 13 '14 at 1:21
  • $\begingroup$ This agrees with the response to essentially the same question on the physics StackExchange, that the logarithm of a number with units (shown in plots all the time) actually means the logarithm of that number divided by the standard unit for that quantity. $\endgroup$ – Steven C. Howell Oct 22 '18 at 20:22
9
$\begingroup$

Logarithm of a quantity really only makes sense if the quantity is dimensionless, and then the result is also a dimensionless number. So what you really plot is not $\log(y)$ but $\log(y/y_0)$ where $y_0$ is some reference quantity in the same units as $y$ (in this case $y_0 = $1 Volt). Similarly for $\exp$ and $\sin$.

$\endgroup$
  • $\begingroup$ or $p_0=2\times10^{-5}\,\rm Pa$ as in measuring sound-pressure level! $\endgroup$ – gen-z ready to perish May 15 at 4:02
  • $\begingroup$ Fully right, that's how log are used in engineering (Decibel and alike) $\endgroup$ – G Cab May 18 at 22:59
6
$\begingroup$

In the expression $\ln{x}$, $x$ must be unitless.

This is because the log function is a series with x raised to differing powers. For instance:

$$-\sum_{k=1}^{\infty}{\frac{(-1)^k(-1+x)^k}{k}}$$ for $$|-1 + x| < 1$$

Let's say $x$ had units of meters (for example). Then the first term in the series would have units of meters, the second term units of square meters, 3rd term in cubic meters, etc. You can't add quantities with differing powers of units, thus $x$ must be unit-less.

The same argument applies for $|-1+x|\not<1$.

$\endgroup$
-1
$\begingroup$

Apnorton's formula for the Taylor series for Ln(x) is incorrect. That version is an approximation and is only good for the limited case he lists as a restriction. For the most general version see the second equation at https://www.efunda.com/math/taylor_series/logarithmic.cfm . Good for all x>=0.

Note that all the 1's in the series are values on the x-axis, hence they have the same units as x. Note also that all the fractions are unitless since the numerators and denominators all have the same unit.

$\endgroup$
-2
$\begingroup$

Soooo many incorrect answers.

  1. "Overall, the argument x of ln(x) must be unitless" is incorrect. x can have any units. ln(x) is the definite integral from 1 to x of (1/x)dx. There is nothing in calculus that says the argument is unitless. The returned value is unitless only becuase of the defintion of the ln function. It is the area under of the curve of the plot of 1/x vs x. The x-axis can have units. The y-axis has units that are always the reciprocal of the x-axis because that is how the y-axis is defined. The units of the integral (the units of the area under the curve) is the product of the x-axis unit times the y-axis unit, which is always unitless 1. The result of ln(x) is unitless but x does not have to be. Other integrals do not have this property since other integrals don't have y=1/x.

For all integrals the unit of the integral is the product of the x-axis and y-axis units. And, the units always work. For example, if you integrate a plot of velocity versus time the unit of the integral is the product of the axis units; (velocity)(time)=(length/time)(time)=length. So the "area" under the curve has units of length which is correct. That is not an accident, or a special case, or magic, it is basic math.

Calculus would be useless if it didn't handle units correctly.

  1. The Taylor series answer is also incorrect. A Taylor series is an approximation of an integral. Ln(x) is not equal to the Taylor series (or the Maclauren series either) The Taylor series shown is correct only for a very limited range of x. If you look at the full Taylor series for all x>0 you see that all the units cancel and the Taylor series returns a unitless number even if x has units. As it must since that is what ln(x) returns even if x has units. For the full Taylor series of ln(x) with x>0 see the second equation in https://www.efunda.com/math/taylor_series/logarithmic.cfm .

  2. "Since logarithm is the inverse of the exponent, it MUST work for units also." Nope. When you take the log of a number (base e, base 10, base 43.538, base ...) the units cancel and the log is a unitless quantity. If you then use a power function you can not recover the units. If I tell you the log of the distance from the earth to the moon is 11.23 you can not recover the actual distance to the moon. You can use e^x to get the numeric value but the unit is lost forever. You must have additional information to recover the unit.

Calculus is 300 years old. Mathematicians, physics, chemists, engineers etc have been using it for that long. There are no "loop holes" or "secret things that only the Illuminati know" in math. If you have a formula and the units don't work the formula is wrong. The math isn't wrong, your formula is.

Unfortunately, math is generally taught without any consideration for units. The math must work with units but often in formulas it isn't clear what parts have units but they aren't shown, and what parts are unitless. The full Taylor series for ln(x) is a good example. There are a whole bunch of "1"s and there is one "2" and lots of x's. If you look closely at the series and take into account the definition of ln(x) you discover that the "1"s actually have the same units as the x's, whatever that may be. The "2" in the formula is actually unitless.

For trig functions the situation with units is slightly different. By definition trig functions take a ratio as an argument and the unit of both the numerator and denominator are the same. Therefore the argument to a trig function is unitless, though the parts of the ratio absolutely, positively, no question about it, have units. For example, for the sin function the definition of the sin of an angle is the ratio of the y value divided by the length of the hypotenuse. If you are on the unit circle the divisor is 1 and often omitted but it is still there. The units of both the y value and the hypotenuse are the same (e.g., inches, light years, nanometers, ...). So for trig functions the argument always collapses down to a unitless number. That doesn't mean the measurements (like the length of the hypotenuse) don't have units, it means the units always cancel out. If they don't, you've done something wrong.

$\endgroup$
-6
$\begingroup$

These are all incorrect. We teach students at an early age to multiply physical quantities with units as follows: $ 2\,\mathrm{meters} * 2\,\mathrm{meters} = 4 \,\mathrm{meters}^2 $. So, we syntactically multiple both the numeric value ad the units.

So, same also applies to exponents. $ (2\,\mathrm{meters})^3 = 2^3\,\mathrm{meters}^3 $. Right?

Since logarithm is the inverse of the exponent, it MUST work for units also.

So, $\log_{10}(270\,\mathrm{meters}) = \log_{10}(270) \log_{10}(\mathrm{meters}) \approx 2.4314 \log_{10}(\mathrm{meters})$

This then works when the inverse is applied $ 10^{2.4314 \log_{10}(\mathrm{meters})} = 270\,\mathrm{meters}$

To do anything else with the representation of log-units would make the exponent not work as the inverse function and we all know that 3 meters cubed is 27 cubic meters.

$\endgroup$
  • 4
    $\begingroup$ You reasoning is flawed. Different units can be multiplied/divided but they cannot be added/subtracted. For example, you can divide meters by seconds and get meters per seconds but you cannot add seconds+meters. That is why taking the log of a unit doesn't make sense because log(1+x) = x-x^2/2+x^3/3... So how can you add sec-sec^2+sec^3...? $\endgroup$ – Fixed Point Jul 2 '14 at 7:04
  • 3
    $\begingroup$ -1 - This reasoning does not work - $(a b)^c$ distributes to $a^c b^c$, but $log(a*b)$ does not distribute to $\log(a) \log(b)$ $\endgroup$ – Eric Oct 30 '14 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.