Skip to content

Logarithmic Functions

By the end of this section, you will be able to:

  • Convert from logarithmic to exponential form
  • Convert from exponential to logarithmic form
  • Evaluate logarithms
  • Use common logarithms
  • Use natural logarithms

In 2010, a major earthquake struck Haiti, destroying or damaging over 285,000 homes. One year later, another, stronger earthquake devastated Honshu, Japan, destroying or damaging over 332,000 buildings. Even though both caused substantial damage, the earthquake in 2011 was 100 times stronger than the earthquake in Haiti. How do we know? The magnitudes of earthquakes are measured on a scale known as the Richter Scale. The Haitian earthquake registered a 7.0 on the Richter Scale, whereas the Japanese earthquake registered a 9.0.

The Richter Scale is a base-ten logarithmic scale. In other words, an earthquake of magnitude 8 is not twice as great as an earthquake of magnitude 4. It is 1084=104=10,00010^{8-4}=10^4=10{,}000 times as great! In this lesson, we will investigate the nature of the Richter Scale and the base-ten function upon which it depends.

Converting from Logarithmic to Exponential Form

In order to analyze the magnitude of earthquakes or compare the magnitudes of two different earthquakes, we need to be able to convert between logarithmic and exponential form. For example, suppose the amount of energy released from one earthquake were 500 times greater than the amount of energy released from another. We want to calculate the difference in magnitude. The equation that represents this problem is 10x=50010^x=500, where xx represents the difference in magnitudes on the Richter Scale. How would we solve for xx?

We have not yet learned a method for solving exponential equations. None of the algebraic tools discussed so far is sufficient to solve 10x=50010^x=500. We know that 102=10010^2=100 and 103=100010^3=1000, so it is clear that xx must be some value between 2 and 3, since y=10xy=10^x is increasing. We can examine a graph to better estimate the solution.

Estimating from a graph, however, is imprecise. To find an algebraic solution, we must introduce a new function. Observe that the graph passes the horizontal line test. The exponential function y=bxy=b^x is one-to-one, so its inverse, x=byx=b^y, is also a function. As is the case with all inverse functions, we simply interchange xx and yy and solve for yy to find the inverse function. To represent yy as a function of xx, we use a logarithmic function of the form y=logb(x)y=\log_b(x). The base bb logarithm of a number is the exponent by which we must raise bb to get that number.

We read a logarithmic expression as, “The logarithm with base bb of xx is equal to yy,” or, simplified, “log base bb of xx is yy.” We can also say, “bb raised to the power of yy is xx,” because logs are exponents. For example, the base 2 logarithm of 32 is 5, because 5 is the exponent we must apply to 2 to get 32. Since 25=322^5=32, we can write log232=5\log_2 32=5. We read this as “log base 2 of 32 is 5.”

We can express the relationship between logarithmic form and its corresponding exponential form as follows:

logb(x)=y    by=x,b>0, b1\log_b(x)=y\iff b^y=x,\quad b>0,\ b\ne1

Note that the base bb is always positive. To help with converting back and forth, take a close look at the equations: in both forms, yy is the exponent and bb is the base — a quick way to remember the relationship is to think “bb to the yy equals xx.”

Because logarithm is a function, it is most correctly written as logb(x)\log_b(x), using parentheses to denote function evaluation, just as we would with f(x)f(x). However, when the input is a single variable or number, it is common to see the parentheses dropped and the expression written without parentheses, as logbx\log_b x. Note that many calculators require parentheses around the xx. For example, logb(c)=a\log_b(c)=a means ba=cb^a=c.

Notice that, comparing the logarithm function and the exponential function, the input and the output are switched. This means y=logb(x)y=\log_b(x) and y=bxy=b^x are inverse functions.

Definition of the Logarithmic Function. A logarithm base bb of a positive number xx satisfies the following definition.

For x>0x>0, b>0b>0, b1b\ne1,

y=logb(x) is equivalent to by=xy=\log_b(x)\ \text{is equivalent to}\ b^y=x

where,

  • we read logb(x)\log_b(x) as, “the logarithm with base bb of xx” or the “log base bb of xx.”
  • the logarithm yy is the exponent to which bb must be raised to get xx.

Also, since the logarithmic and exponential functions switch the xx and yy values, the domain and range of the exponential function are interchanged for the logarithmic function. Therefore,

  • the domain of the logarithm function with base bb is (0,)(0,\infty).
  • the range of the logarithm function with base bb is (,)(-\infty,\infty).

Q&A. Can we take the logarithm of a negative number?

No. Because the base of an exponential function is always positive, no power of that base can ever be negative. We can never take the logarithm of a negative number. Also, we cannot take the logarithm of zero. Calculators may output a log of a negative number when in complex mode, but the log of a negative number is not a real number.

How to: given an equation in logarithmic form logb(x)=y\log_b(x)=y, convert it to exponential form.

  1. Examine the equation y=logb(x)y=\log_b(x) and identify bb, yy, and xx.
  2. Rewrite logb(x)=y\log_b(x)=y as by=xb^y=x.

Example. Write the following logarithmic equations in exponential form.

(a) log6(6)=12\log_6(\sqrt6)=\tfrac{1}{2}

(b) log3(9)=2\log_3(9)=2

Solution. First, identify the values of bb, yy, and xx. Then, write the equation in the form by=xb^y=x.

(a) Here, b=6b=6, y=12y=\tfrac{1}{2}, and x=6x=\sqrt6. Therefore, the equation log6(6)=12\log_6(\sqrt6)=\tfrac{1}{2} is equivalent to 61/2=66^{1/2}=\sqrt6.

(b) Here, b=3b=3, y=2y=2, and x=9x=9. Therefore, the equation log3(9)=2\log_3(9)=2 is equivalent to 32=93^2=9.

Writelog10(1,000,000)=6\log_{10}(1{,}000{,}000)=6in exponential form.

Writelog5(25)=2\log_5(25)=2in exponential form.

Converting from Exponential to Logarithmic Form

To convert from exponents to logarithms, we follow the same steps in reverse. We identify the base bb, exponent xx, and output yy. Then we write x=logb(y)x=\log_b(y).

Example. Write the following exponential equations in logarithmic form.

(a) 23=82^3=8

(b) 52=255^2=25

(c) 104=110,00010^{-4}=\tfrac{1}{10{,}000}

Solution. First, identify the values of bb, yy, and xx. Then, write the equation in the form x=logb(y)x=\log_b(y).

(a) Here, b=2b=2, x=3x=3, and y=8y=8. Therefore, the equation 23=82^3=8 is equivalent to log2(8)=3\log_2(8)=3.

(b) Here, b=5b=5, x=2x=2, and y=25y=25. Therefore, the equation 52=255^2=25 is equivalent to log5(25)=2\log_5(25)=2.

(c) Here, b=10b=10, x=4x=-4, and y=110,000y=\tfrac{1}{10{,}000}. Therefore, the equation 104=110,00010^{-4}=\tfrac{1}{10{,}000} is equivalent to log10(110,000)=4\log_{10}\left(\tfrac{1}{10{,}000}\right)=-4.

Which equation is32=93^2=9written in logarithmic form?

Which equation is53=1255^3=125written in logarithmic form?

Which equation is21=122^{-1}=\tfrac{1}{2}written in logarithmic form?

Evaluating Logarithms

Knowing the squares, cubes, and roots of numbers allows us to evaluate many logarithms mentally. For example, consider log28\log_2 8. We ask, “To what exponent must 22 be raised in order to get 8?” Because we already know 23=82^3=8, it follows that log28=3\log_2 8=3.

Now consider solving log749\log_7 49 and log327\log_3 27 mentally.

  • We ask, “To what exponent must 7 be raised in order to get 49?” We know 72=497^2=49. Therefore, log749=2\log_7 49=2.
  • We ask, “To what exponent must 3 be raised in order to get 27?” We know 33=273^3=27. Therefore, log327=3\log_3 27=3.

Even some seemingly more complicated logarithms can be evaluated without a calculator. For example, let’s evaluate log2/349\log_{2/3}\tfrac{4}{9} mentally.

  • We ask, “To what exponent must 23\tfrac{2}{3} be raised in order to get 49\tfrac{4}{9}?” We know 22=42^2=4 and 32=93^2=9, so (23)2=49\left(\tfrac{2}{3}\right)^2=\tfrac{4}{9}. Therefore, log2/3(49)=2\log_{2/3}\left(\tfrac{4}{9}\right)=2.

How to: given a logarithm of the form y=logb(x)y=\log_b(x), evaluate it mentally.

  1. Rewrite the argument xx as a power of bb: by=xb^y=x.
  2. Use previous knowledge of powers of bb to identify yy by asking, “To what exponent should bb be raised in order to get xx?”

Example. Solve y=log4(64)y=\log_4(64) without using a calculator.

Solution. First we rewrite the logarithm in exponential form: 4y=644^y=64. Next, we ask, “To what exponent must 4 be raised in order to get 64?”

We know

43=644^3=64

Therefore,

log4(64)=3\log_4(64)=3

Solvey=log121(11)y=\log_{121}(11)without using a calculator.

Example. Evaluate y=log3(127)y=\log_3\left(\tfrac{1}{27}\right) without using a calculator.

Solution. First we rewrite the logarithm in exponential form: 3y=1273^y=\tfrac{1}{27}. Next, we ask, “To what exponent must 3 be raised in order to get 127\tfrac{1}{27}?”

We know 33=273^3=27, but what must we do to get the reciprocal, 127\tfrac{1}{27}? Recall from working with exponents that ba=1bab^{-a}=\tfrac{1}{b^a}. We use this information to write

33=133=127 \begin{array}{lrcl} & 3^{-3} &=& \tfrac{1}{3^3} \\[4pt] & &=& \tfrac{1}{27} \end{array}

Therefore, log3(127)=3\log_3\left(\tfrac{1}{27}\right)=-3.

Evaluatey=log2(132)y=\log_2\left(\tfrac{1}{32}\right)without using a calculator.

Using Common Logarithms

Sometimes you may see a logarithm written without a base. When you see one written this way, you need to look at the expression before evaluating it. It may be that the base you use doesn’t matter. If you find it in computer science, it often means log2(x)\log_2(x). However, in mathematics it almost always means the common logarithm of 10. In other words, the expression log(x)\log(x) often means log10(x)\log_{10}(x).

Definition of the Common Logarithm. A common logarithm is a logarithm with base 1010. We can also write log10(x)\log_{10}(x) simply as log(x)\log(x). The common logarithm of a positive number xx satisfies the following definition.

For x>0x>0,

y=log(x) is equivalent to 10y=xy=\log(x)\ \text{is equivalent to}\ 10^y=x

We read log(x)\log(x) as, “the logarithm with base 1010 of xx” or “log base 10 of xx.”

The logarithm yy is the exponent to which 1010 must be raised to get xx.

Currently, we use log(x)\log(x) or lg(x)\text{lg}(x) as the common logarithm, lb(x)\text{lb}(x) as the binary logarithm, and ln(x)\ln(x) as the natural logarithm. Writing log(x)\log(x) without specifying a base is now considered bad form, despite being frequently found in older materials.

Source note. The source module (m49363) gets this sentence wrong twice. It prints “logb(x)\log_b(x), lg(x)\text{lg}(x) as the common logarithm”, but a base-bb logarithm is not the common (base-10) logarithm the paragraph above defines; and it then deprecates the wrong notation, “Writing lg(x)\text{lg}(x) without specifying a base is now considered bad form”, when ISO 80000-2 fixes lg\text{lg} at base 10 and it is bare log(x)\log(x) that is ambiguous — exactly as the paragraph above explains. This page writes “log(x)\log(x) or lg(x)\text{lg}(x)” and “Writing log(x)\log(x)”.

How to: given a common logarithm of the form y=log(x)y=\log(x), evaluate it mentally.

  1. Rewrite the argument xx as a power of 1010: 10y=x10^y=x.
  2. Use previous knowledge of powers of 1010 to identify yy by asking, “To what exponent must 1010 be raised in order to get xx?”

Example. Evaluate y=log(1000)y=\log(1000) without using a calculator.

Solution. First we rewrite the logarithm in exponential form: 10y=100010^y=1000. Next, we ask, “To what exponent must 1010 be raised in order to get 1000?” We know

103=100010^3=1000

Therefore, log(1000)=3\log(1000)=3.

Evaluatey=log(1,000,000)y=\log(1{,}000{,}000).

How to: given a common logarithm with the form y=log(x)y=\log(x), evaluate it using a calculator.

  1. Press [LOG].
  2. Enter the value given for xx, followed by [)].
  3. Press [ENTER].

Example. Evaluate y=log(321)y=\log(321) to four decimal places using a calculator.

Solution.

  1. Press [LOG].
  2. Enter 321, followed by [)].
  3. Press [ENTER].

Rounding to four decimal places, log(321)2.5065\log(321)\approx2.5065.

Analysis. Note that 102=10010^2=100 and that 103=100010^3=1000. Since 321 is between 100 and 1000, we know that log(321)\log(321) must be between log(100)\log(100) and log(1000)\log(1000). This gives us the following:

100<321<10002<2.5065<3 \begin{array}{lcccl} 100 &<& 321 &<& 1000 \\[4pt] 2 &<& 2.5065 &<& 3 \end{array}

Evaluatey=log(123)y=\log(123)to four decimal places using a calculator.

Example. The amount of energy released from one earthquake was 500 times greater than the amount of energy released from another. The equation 10x=50010^x=500 represents this situation, where xx is the difference in magnitudes on the Richter Scale. To the nearest thousandth, what was the difference in magnitudes?

Solution. We begin by rewriting the exponential equation in logarithmic form.

10x=500Use the definition of the common log.log(500)=x \begin{array}{lrcl} & 10^x &=& 500 \\[4pt] \text{Use the definition of the common log.} & \log(500) &=& x \end{array}

Next we evaluate the logarithm using a calculator: to the nearest thousandth, log(500)2.699\log(500)\approx2.699.

The difference in magnitudes was about 2.6992.699.

The amount of energy released from one earthquake was 8,500 times greater than the amount of energy released from another. The equation10x=8,50010^x=8{,}500represents this situation, wherexxis the difference in magnitudes on the Richter Scale. To the nearest thousandth, what was the difference in magnitudes?

Using Natural Logarithms

The most frequently used base for logarithms is ee, the value of which is approximately 2.718282.71828. Base ee logarithms are important in calculus and some scientific applications; they are called natural logarithms. The base ee logarithm, loge(x)\log_e(x), has its own notation, ln(x)\ln(x).

Most values of ln(x)\ln(x) can be found only using a calculator. The major exception is that, because the logarithm of 1 is always 0 in any base, ln1=0\ln1=0. For other natural logarithms, we can use the ln\ln key that can be found on most scientific calculators. We can also find the natural logarithm of any power of ee using the inverse property of logarithms.

Definition of the Natural Logarithm. A natural logarithm is a logarithm with base ee. We write loge(x)\log_e(x) simply as ln(x)\ln(x). The natural logarithm of a positive number xx satisfies the following definition.

For x>0x>0,

y=ln(x) is equivalent to ey=xy=\ln(x)\ \text{is equivalent to}\ e^y=x

We read ln(x)\ln(x) as, “the logarithm with base ee of xx” or “the natural logarithm of xx.”

The logarithm yy is the exponent to which ee must be raised to get xx.

Since the functions y=exy=e^x and y=ln(x)y=\ln(x) are inverse functions, ln(ex)=x\ln(e^x)=x for all xx and eln(x)=xe^{\ln(x)}=x for x>0x>0.

How to: given a natural logarithm with the form y=ln(x)y=\ln(x), evaluate it using a calculator.

  1. Press [LN].
  2. Enter the value given for xx, followed by [)].
  3. Press [ENTER].

Example. Evaluate y=ln(500)y=\ln(500) to four decimal places using a calculator.

Solution.

  1. Press [LN].
  2. Enter 500, followed by [)].
  3. Press [ENTER].

Rounding to four decimal places, ln(500)6.2146\ln(500)\approx6.2146.

Evaluateln(500)\ln(-500).

Key equations

Definition of the logarithmic functionFor x>0,b>0,b1x>0,b>0,b\ne1, y=logb(x)y=\log_b(x) if and only if by=xb^y=x.
Definition of the common logarithmFor x>0x>0, y=log(x)y=\log(x) if and only if 10y=x10^y=x.
Definition of the natural logarithmFor x>0x>0, y=ln(x)y=\ln(x) if and only if ey=xe^y=x.

Key concepts

  • The inverse of an exponential function is a logarithmic function, and the inverse of a logarithmic function is an exponential function.
  • Logarithmic equations can be written in an equivalent exponential form, using the definition of a logarithm.
  • Exponential equations can be written in their equivalent logarithmic form using the definition of a logarithm.
  • Logarithmic functions with base bb can be evaluated mentally using previous knowledge of powers of bb.
  • Common logarithms can be evaluated mentally using previous knowledge of powers of 1010.
  • When common logarithms cannot be evaluated mentally, a calculator can be used.
  • Real-world exponential problems with base 1010 can be rewritten as a common logarithm and then evaluated using a calculator.
  • Natural logarithms can be evaluated using a calculator.

Practice

Convert from logarithmic to exponential form

Rewriteloga(b)=c\log_a(b)=cin exponential form.

Rewriteln(w)=n\ln(w)=nin exponential form.

Convert from exponential to logarithmic form

Rewritecd=kc^d=kin logarithmic form.

Rewriteek=he^k=hin logarithmic form.

Evaluate logarithms

Evaluatelog6(6)\log_6(\sqrt6)without using a calculator.

Evaluate6log8(4)6\log_8(4)without using a calculator.

Use common logarithms

Evaluatelog(0.001)\log(0.001)without using a calculator.

Evaluatelog(2)\log(\sqrt2)using a calculator. Round to the nearest thousandth.

Use natural logarithms

Evaluateln(1)\ln(1)without using a calculator.

Evaluate25ln(e2/5)25\ln\left(e^{2/5}\right)without using a calculator.


This section is adapted from Precalculus 2e, Section 4.3: Logarithmic Functions by Jay Abramson and OpenStax, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: omitted the decorative photograph of earthquake damage in Honshu, Japan, which carries no mathematics, and reworded the sentence that pointed at it; omitted three purely typographic arrow/mnemonic illustrations (a figure showing the positions of the exponent and base in loga(x)=y\log_a(x)=y and x=ayx=a^y; a circular-arrow “Think bb to the y=xy=x” mnemonic; and a circular-arrow illustration of logb(c)=a\log_b(c)=a meaning ba=cb^a=c), folding each one’s content directly into the surrounding prose instead; recreated the graph of y=10xy=10^x and y=500y=500 as an accessible inline SVG built from the exact curve equation; corrected the sentence introducing common-logarithm notation, which the pinned CNXML gets wrong twice: it prints “logb(x),lg(x)\log_b(x), \text{lg}(x) as the common logarithm” — a base-bb logarithm is not the common (base-10) logarithm the surrounding paragraph defines — and then deprecates the wrong notation, “Writing lg(x)\text{lg}(x) without specifying a base is now considered bad form”, when lg\text{lg} is fixed at base 10 by ISO 80000-2 and it is bare log(x)\log(x) that is ambiguous, exactly as the paragraph above this one explains; this page writes “log(x)\log(x) or lg(x)\text{lg}(x) as the common logarithm” and “Writing log(x)\log(x) without specifying a base”; converted the “write the following exponential equations in logarithmic form” Try It’s three numeric parts (32=93^2=9, 53=1255^3=125, 21=122^{-1}=\tfrac{1}{2}) from fill-ins into multiple-choice questions, because the pinned compute-engine build grades any two true, fully numeric equations as equal to each other regardless of content (for example 1+1=21+1=2 grades correct against 3+3=63+3=6), which would let a learner pass by retyping the printed exponential equation with no available answer-shape guard against it; converted the “Evaluate ln(500)\ln(-500)” Try It into a multiple-choice question, since its answer is that the expression is undefined rather than a number; omitted the “Access this online resource” media link; and adapted ten selected end-of-section exercises — two logarithmic-to-exponential rewrites, two exponential-to-logarithmic rewrites, two mental base-bb evaluations, two common-logarithm evaluations, and two natural-logarithm evaluations — into interactive components in a closing Practice block, one group per objective.