14

Find $x$ for $4^{x-4} = 7$.

Answer I got, using log, was ${\log(7)\over 2\log(2)} + 4$

but the actual answer was ${\ln(7)\over2\ln(2)} + 4$

I plugged both in my calculator and turns out both are the equivalent value.

Anyways, is using either one of ln or log appropriate for this question? Obviously ln is when log has the base e, and log is when it has the base 10.

Final question: How do I know when to use which? that is which of ln or log is used when solving a question??

For example, if a question asks to find $x$ for $e^x = 100$, I will use $\ln$ since $\ln(e)$ cancels out.

If a question asks to find $2^x = 64$, i will use log since "$e$" isn't present in the question.

So is using either $\log$ or $\ln$ the same?

harold232
  • 444
  • 12
    $$\log_{10}x=\frac{\ln x}{\ln 10}$$ – Angina Seng Sep 20 '19 at 06:52
  • 5
    As an aside, to make matters worse, some authors will write $\log$ without a subscript and mean different things than one another. In texts on combinatorics for instance it is not uncommon to see $\log$ without a subscript be meant to be interpreted as being the base 2 logarithm $\log_2$ while other authors might intend it to be the base 10 logarithm $\log_{10}$. Others still may use $\log$ as the natural logarithm rather than writing it as $\ln$. The nice thing is, regardless which base it is you always have $\log_n(a)/\log_n(b)=\log_b(a)$ – JMoravitz Sep 20 '19 at 14:55
  • 1
    "In order to kill an exponential, you have to hit it with a log". Which raises the question "which log". The answer is -- it doesn't matter. – John Coleman Sep 20 '19 at 16:11
  • You can always contrive that there are $e$'s around. Note $2^x=(e^{\text{ln}(2)})^x = e^{x\text{ln}2}$ – jacob1729 Sep 20 '19 at 18:00
  • 4
    @JohnColeman: Just don't use base 1. https://math.stackexchange.com/questions/413713/log-base-1-of-1 – Joshua Sep 20 '19 at 19:10
  • Why not eliminate the vexing question and simplify the answer to $$\frac{1}{2}\log_2(7) + 4$$? – Jeff Y Sep 20 '19 at 21:04
  • some authors use lg to denote a base-2 logarithm, which is nice as it helps remove some ambiguity: $\lg=\log_{2}$, $\ln=\log_{e}$, and $\log=\log_{10}$. – Z4-tier Sep 21 '19 at 01:48
  • @Z4-tier The truth is that some authors use $\operatorname{lg}$ to denote $\log_{10}$ (sigh) – L. F. Sep 21 '19 at 02:02

6 Answers6

22

You can use any logarithm you want.

As a result of the base change formula $$\log_2(7) = \frac{\log(7)}{\log(2)} = \frac{\ln(7)}{\ln(2)} = \frac{\log_b(7)}{\log_b(2)}$$ so as long as both logs have the same base, their ratio will be the same, regardless of the chosen base (as long as $b > 0, b\neq 1$).

  • Thank you. Out of curiosity, why would one prefer to use natural log in the question 4^(x-4) = 7, when it does not contain "e" – harold232 Sep 20 '19 at 06:56
  • 1
    @harold232 Since they're equivalent, the choice is harmless, but you still have to make a choice. The only reason I can think of to default to the natural log is that it is in some ways computationally easier than other logarithms (coming from formulas of calculus). – Brian Moehring Sep 20 '19 at 07:01
  • 16
    @harold232 for mathematicians, $e$ is the default base for logarithms which they would use unless there is a particular reason for choosing something else. (This is largely because it has nice properties for calculus.) After base $e$, the next most common in maths is base $2$. $10$, as Michael Palin might say, is right out. – Especially Lime Sep 20 '19 at 07:05
  • 5
    $10$ was popular in the days before calculators. In those days, it was the easiest one to work with as we had tables for it. I agree that its utility in pure maths is low today but it lives in a few cases where log scales are used e.g. pH in chemistry and the decibels. – badjohn Sep 20 '19 at 08:43
  • 2
    @EspeciallyLime: 10 is used by "scientists". See my answer below. – JonathanZ Sep 20 '19 at 17:15
  • @EspeciallyLime Exclusively 10 is still used in chemistry. – yo' Sep 20 '19 at 20:23
  • @harold232 When doing work by hand, ln is one less letter to write compared to log. – user45266 Sep 21 '19 at 01:18
  • @JonathanZ absolutely. I wasn't trying to suggest that 10 wasn't used by anyone, but the answer to Harold's question is probably "because the book was written by a mathematician, and mathematicians essentially never use base 10". – Especially Lime Sep 21 '19 at 08:36
  • @EspeciallyLime: Ah, I read too quickly and missed that you were talking about just mathematicians. Interestingly(??), when I learned how to find logarithms using a table in high school math class, we used base 10. But I skew a little older than the average MSE user. I think if you want to actually evaluate a logarithm, base 10 is the easiest. Non-math people might be surprised just how infrequently mathematicians actually want to compute the value of a log (or sin, or exp) -- usually we just care about their overall behavior. – JonathanZ Sep 21 '19 at 20:32
  • @JonathanZsupportsMonicaC Not necessarily. There exist many more algorithms for precisely and efficiently computing natural logarithms than other logarithms. – Angel Nov 08 '21 at 13:47
  • Every algorithm for computing logs base $e$ can be converted to an algorithm for computing logs base $10$ by tacking on a final step of "Now multiply by 0.4342944819....". I can't see how that materially affects precision or efficiency. – JonathanZ Nov 08 '21 at 20:45
10

Either is fine. You can write logarithms in terms of any base that you like with the change of base formula $$\log_ba=\frac{\log_ca}{\log_cb}$$

One thing learned from secondary school is that exponential equations can be solved be rewriting the relationship in logarithmic form. As such, your equation can be rewritten as follows: \begin{align} 4^{x-4}&=7\\ x-4&=\log_47\\ x&=4+\log_47 \end{align}

And since $\log_47$ can be rewritten as $\frac{\log7}{\log4}$ or $\frac{\ln7}{\ln4}$ or $\frac{\log_{999876}7}{\log_{999876}4}$ it does not matter which base of logarithm you use.

Andrew Chin
  • 7,389
  • By the way I noticed that you left the denominator as log(4), shouldn't it be 2log(2) by power rule, since it is more simplified. Or does it not matter? – harold232 Sep 20 '19 at 07:00
  • 1
    @harold232 As you say, $\log(4)=2\log(2)$. So it does not really matter – Henry Sep 20 '19 at 07:09
  • 1
    If you want to input the logarithm into a calculator that does not have a log function that accepts a base parameter, then you can simply type in $\log\ 7 \div \log\ 4$. If you want to show your work or write a final solution as its exact value, I tend to accept $\log_47$ or $\frac{\ln7}{2\ln2}$ or its variants. – Andrew Chin Sep 20 '19 at 07:10
  • In terms of having that written on a test would it matter? Because I feel like leaving it as log4 is like leaving the fraction 1/2 as 2/4, since log4 can be simplified – harold232 Sep 20 '19 at 07:17
  • 2
    No educator worth his salt is going to be that pedantic. To you, is $\frac12\log_27$ more acceptable compared to $\log_47$? – Andrew Chin Sep 20 '19 at 07:20
  • They are both the same to me, but I notice that on every online log calculator they leave it as the more simplified form, that is 2log2 – harold232 Sep 20 '19 at 07:27
  • 1
8

Culturally

  • Computer science / programming people tend to use log base $2$
  • Mathematicians tend to use log base $e$
  • Engineers / physicist / chemists etc. tend to use log base $10$

Writers really should make it explicit the first time they use "$\log$", but they don't always. As others have pointed out, the only difference is a constant factor, and in your case the factors in the numerator and denominator cancelled each other out. So the answer to your question is "If it's in a math context you'll probably see $\ln()$ used."

Heck, even if you were asked to solve $10^{x - 3} = 6$ you'd still see $\ln()$ used, even though it looks like $\log_{10}$ might seem more "natural" for that particular problem. It's just what math people tend to do.

JonathanZ
  • 10,615
  • 3
    It is called the "natural logarithm", after all. (: – Andrew Chin Sep 20 '19 at 17:38
  • 2
    :) We've learned that what different groups of people consider to be "natural" can vary greatly, and even contradict each other. Hence my starting off with the word "culturally". – JonathanZ Sep 20 '19 at 17:52
  • 1
    @JonathanZ you made me laugh out loud in a library! @@ It was a natural reaction of course. – uhoh Sep 21 '19 at 05:43
3

There's an interesting unstated question here: what counts as an answer?

You can clearly argue that using either $\ln$ or $\log_{10}$ should be acceptable. But in that case $$ x = \log_4(7) + 4 $$ should be just as correct. As @BrianMoehring says in his answer, you can use any logarithm you want.

As for

If a question asks to find $2^x=64$, i will use log since "e" isn't present in the question.

I would just say $x=6$. That's really using $\log_2$, by inspection.

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199
2

In this case the other two answers are technically correct of course, in that the base doesn't really matter. But I want to point out that when you see $\log(x)$, it can either mean base $10$, base $2$ or base $e$, with the latter two (especially base $e$) being much more common as you move up the math ladder. The notation $\ln(x)$ is still used for base $e$, but whenever you see $\log(x)$ you should always assume it is also base $e$ unless context implies otherwise (if it's supposed to mean base $2$, it should be clear from context).

Part of the reason is exactly because of the reason mentioned by the two other answers: for any $a,b$ we have $$\log_a(b)=\frac{\log(b)}{\log(a)},$$ So we can express logarithms of any base using the natural logarithm anyway and there's no need to designate a special symbol for it. And indeed you will see that base $e$ is much more useful than base $10$ most of the time.

YiFan Tey
  • 17,431
  • 4
  • 28
  • 66
1

Use the change of base formula if you suspect that the answer is irrational, otherwise take the logarithm to both sides of the equation of a base that seems reasonable.

There's nothing magical about the change of base formula. $$\begin{align} \log_c b &= \log_c b\\ \log_c a^{\log_a b} &= \log_c b\\ \log_a b \cdot\log_c a &= \log_c b\\ \log_a b &= \frac{\log_c b}{\log_c a}\\ \end{align}$$

Even if the solution is integral or rational, using the change of base formula will get you to an answer, for example:

$$\begin{align} 2^x &= 64\\ \log_{10}2^x &= \log_{10} 64\\ x\log_{10}2 &= \log_{10} 64\\ x &= \frac{\log_{10} 64}{\log_{10}2}\\ x &= \log_{2} 64\\ x &= \log_{2} 2^6\\ x &= 6\log_{2} 2\\ x &= 6\\ \end{align}$$ although, it does insert a lot of extra [unnecessary] steps.

John Joy
  • 7,790