Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Precalculus

Logarithms Explained: Definition, Laws and Solving Equations

By MathSolver Pro Editorial Team · Published

A logarithm answers one question: what power do I raise the base to in order to get this number? Every rule and technique in this guide follows from that single idea.

What a logarithm is

Exponents and logarithms are two ways of describing the same relationship. The statement 23=82^3 = 8 says that raising 2 to the power 3 gives 8. The logarithm turns the question around: to what power must 2 be raised to give 8? The answer is 3, written log⁡28=3\log_2 8 = 3.

log⁡bx=y  ⟺  by=x,b>0,  b≠1,  x>0\log_b x = y \iff b^y = x, \qquad b > 0,\; b \neq 1,\; x > 0

The number bb is the base, xx is the argument, and yy is the exponent you are looking for. The conditions matter. The base must be positive and not equal to 1, because powers of 1 are always 1 and powers of negative numbers are not defined for every real exponent. The argument must be positive, because a positive base raised to any real power is positive.

  • log⁡101000=3\log_{10} 1000 = 3, because 103=100010^3 = 1000.
  • log⁡5125=−2\log_5 \frac{1}{25} = -2, because 5−2=1255^{-2} = \frac{1}{25}.
  • log⁡93=12\log_9 3 = \frac{1}{2}, because 91/2=9=39^{1/2} = \sqrt{9} = 3.
  • log⁡71=0\log_7 1 = 0 for every allowed base, because b0=1b^0 = 1, and log⁡bb=1\log_b b = 1 because b1=bb^1 = b.

Two bases have their own notation. The common logarithm log⁡x\log x uses base 10, which suits measurements in powers of ten. The natural logarithm ln⁡x\ln x uses base e≈2.71828e \approx 2.71828, which appears naturally in growth, decay and calculus. Some textbooks and programming languages write log⁡\log for the natural log, so check the convention in your course.

The three laws of logarithms

Because logarithms are exponents, the exponent rules translate directly into logarithm rules. For positive MM and NN and any allowed base:

log⁡b(MN)=log⁡bM+log⁡bN,log⁡bMN=log⁡bM−log⁡bN,log⁡b(Mk)=klog⁡bM\log_b(MN) = \log_b M + \log_b N, \qquad \log_b\frac{M}{N} = \log_b M - \log_b N, \qquad \log_b(M^k) = k\log_b M

The product law comes from bmbn=bm+nb^m b^n = b^{m+n}: multiplying numbers adds their exponents, so it adds their logarithms. The quotient law comes from dividing powers, and the power law from (bm)k=bmk(b^m)^k = b^{mk}. Before calculators, this is exactly why logarithm tables were used: they turned difficult multiplications into additions.

  • log⁡2(32⋅4)=log⁡232+log⁡24=5+2=7\log_2(32 \cdot 4) = \log_2 32 + \log_2 4 = 5 + 2 = 7, and indeed 128=27128 = 2^7.
  • log⁡50+log⁡2=log⁡100=2\log 50 + \log 2 = \log 100 = 2.
  • log⁡354−log⁡32=log⁡327=3\log_3 54 - \log_3 2 = \log_3 27 = 3.
  • ln⁡(e5)=5ln⁡e=5\ln(e^5) = 5\ln e = 5.

Expanding and condensing expressions

Expanding uses the laws to split one logarithm into simpler pieces; condensing combines several into one. Both are common exam tasks and both are needed when solving equations.

Expand log⁡x2yz3\log\dfrac{x^2 y}{z^3}

  1. Quotient law: log⁡(x2y)−log⁡(z3)\log(x^2y) - \log(z^3).
  2. Product law on the first part: log⁡x2+log⁡y−log⁡z3\log x^2 + \log y - \log z^3.
  3. Power law: 2log⁡x+log⁡y−3log⁡z2\log x + \log y - 3\log z, valid for positive xx, yy and zz.

Condense 2ln⁡x−ln⁡(x+1)+ln⁡32\ln x - \ln(x + 1) + \ln 3

  1. Move coefficients inside as powers: ln⁡x2−ln⁡(x+1)+ln⁡3\ln x^2 - \ln(x + 1) + \ln 3.
  2. Combine additions as products and subtractions as quotients: ln⁡3x2x+1\ln\dfrac{3x^2}{x + 1}.

Coefficients must become exponents before you combine. 2ln⁡x+ln⁡y2\ln x + \ln y is ln⁡(x2y)\ln(x^2 y), not ln⁡(2xy)\ln(2xy).

Change of base

Calculators usually have keys only for log⁡\log and ln⁡\ln. Any other base is handled with the change of base formula, which works with any new base cc:

log⁡bx=log⁡cxlog⁡cb=ln⁡xln⁡b\log_b x = \frac{\log_c x}{\log_c b} = \frac{\ln x}{\ln b}

For example, log⁡210=ln⁡10ln⁡2≈2.3025850.693147≈3.3219\log_2 10 = \frac{\ln 10}{\ln 2} \approx \frac{2.302585}{0.693147} \approx 3.3219. A sanity check helps: 23=82^3 = 8 and 24=162^4 = 16, so the answer must lie between 3 and 4. The formula also shows that log⁡ba=1log⁡ab\log_b a = \frac{1}{\log_a b}, so log⁡82=13\log_8 2 = \frac{1}{3} because log⁡28=3\log_2 8 = 3.

Solving exponential equations

When the unknown is in an exponent, isolate the power, then take a logarithm of both sides so the power law can bring the exponent down.

Example 1: 3x=203^x = 20

  1. Take natural logs of both sides: ln⁡3x=ln⁡20\ln 3^x = \ln 20.
  2. Power law: xln⁡3=ln⁡20x\ln 3 = \ln 20.
  3. Divide: x=ln⁡20ln⁡3≈2.9957321.098612≈2.7268x = \frac{\ln 20}{\ln 3} \approx \frac{2.995732}{1.098612} \approx 2.7268.
  4. Check: 32.7268≈20.03^{2.7268} \approx 20.0, and the answer lies between 2 and 3 as expected since 32=93^2 = 9 and 33=273^3 = 27.

Example 2: 5⋅2x−1=405 \cdot 2^{x - 1} = 40

  1. Isolate the power first: 2x−1=82^{x - 1} = 8.
  2. Since 8=238 = 2^3, the exponents must match: x−1=3x - 1 = 3, so x=4x = 4.
  3. Check: 5⋅23=405 \cdot 2^3 = 40.

A frequent error in Example 2 is taking the logarithm before dividing by 5. That is not wrong, but it produces ln⁡5+(x−1)ln⁡2=ln⁡40\ln 5 + (x - 1)\ln 2 = \ln 40, which takes longer to solve. Isolating the power first keeps the work short.

Solving logarithmic equations

When the unknown is inside a logarithm, combine the logarithms into one, then rewrite the equation in exponential form. Because logarithms of zero and negative numbers are undefined, every candidate solution must be checked in the original equation.

Example 3: log⁡2x+log⁡2(x−2)=3\log_2 x + \log_2(x - 2) = 3

  1. Product law: log⁡2[x(x−2)]=3\log_2[x(x - 2)] = 3.
  2. Exponential form: x(x−2)=23=8x(x - 2) = 2^3 = 8.
  3. Rearrange and factor: x2−2x−8=0x^2 - 2x - 8 = 0, so (x−4)(x+2)=0(x - 4)(x + 2) = 0 and x=4x = 4 or x=−2x = -2.
  4. Check: x=4x = 4 gives log⁡24+log⁡22=2+1=3\log_2 4 + \log_2 2 = 2 + 1 = 3. The value x=−2x = -2 makes log⁡2x\log_2 x undefined, so it is rejected.
  5. Solution: x=4x = 4.

Example 4: ln⁡(2x+1)=3\ln(2x + 1) = 3

  1. Exponential form with base ee: 2x+1=e32x + 1 = e^3.
  2. Solve: x=e3−12≈20.0855−12≈9.5428x = \frac{e^3 - 1}{2} \approx \frac{20.0855 - 1}{2} \approx 9.5428.
  3. Check that the argument is positive: 2x+1=e3>02x + 1 = e^3 > 0.

The algebra in Example 3 produced a quadratic. If you need a reminder of how to solve one, see how to solve quadratic equations.

The graph of a logarithm

The function y=log⁡bxy = \log_b x is the inverse of y=bxy = b^x, so its graph is the reflection of the exponential graph in the line y=xy = x. For b>1b > 1 it passes through (1,0)(1, 0) and (b,1)(b, 1), rises slowly without bound, and approaches the y-axis as a vertical asymptote. Its domain is (0,∞)(0, \infty) and its range is all real numbers, exactly the reverse of the exponential function's domain and range.

Shifts change the domain. For y=ln⁡(x−3)y = \ln(x - 3), the argument must be positive, so the domain is (3,∞)(3, \infty) and the asymptote moves to x=3x = 3. Working out such domains is covered in the guide to domain and range, and the relationship with exponentials is explained further in inverse functions. You can plot several bases together with the graphing calculator.

Where logarithms are used

  • Compound growth: an amount growing 5 percent a year doubles when 1.05t=21.05^t = 2, so t=ln⁡2ln⁡1.05≈14.21t = \frac{\ln 2}{\ln 1.05} \approx 14.21 years.
  • Chemistry: pH is −log⁡[H+]-\log[\mathrm{H}^+], so a hydrogen ion concentration of 10−310^{-3} moles per litre gives pH 3, and each pH step is a factor of ten.
  • Sound: decibel levels are 10log⁡10II010\log_{10}\frac{I}{I_0}, so a sound 100 times as intense is 20 decibels louder.
  • Computer science: binary search on nn items needs about log⁡2n\log_2 n steps, so a million items need only about 20.

All four share the same feature: logarithms compress quantities that span many powers of ten into a manageable scale, and they turn multiplicative change into additive change.

Common mistakes

  • Writing log⁡(a+b)=log⁡a+log⁡b\log(a + b) = \log a + \log b. The product law is about products, and there is no rule for the log of a sum.
  • Writing log⁡alog⁡b=log⁡ab\frac{\log a}{\log b} = \log\frac{a}{b}. The left side is a change of base, log⁡ba\log_b a.
  • Confusing (log⁡x)2(\log x)^2 with log⁡x2=2log⁡x\log x^2 = 2\log x.
  • Forgetting to check solutions of log equations, so an answer that makes an argument negative slips through.
  • Mixing up log⁡\log and ln⁡\ln on a calculator.

The logarithm calculator evaluates any base and shows the change of base step, which makes it a quick way to check the examples above.

A study plan for logarithms

Logarithms feel abstract mainly because the notation hides a simple question. A good way to build fluency is to practise translating in both directions until it is automatic. Take ten powers you already know, such as 25=322^5 = 32 or 10−2=0.0110^{-2} = 0.01, and rewrite each as a logarithm. Then take ten logarithms and rewrite each as a power. After a short session, evaluating log⁡381\log_3 81 or log⁡100.001\log_{10} 0.001 becomes a quick mental step instead of a puzzle.

Next, practise the laws on numbers before using them on variables. Checking that log⁡28+log⁡24\log_2 8 + \log_2 4 equals log⁡232\log_2 32 by computing both sides makes the product law believable, and it trains you to spot the false versions listed in the next section. Only then move on to expanding and condensing algebraic expressions.

Finally, solve equations in two families: those with the unknown in an exponent and those with the unknown inside a logarithm. The first family is solved by taking a logarithm, the second by rewriting in exponential form. Recognising which family a problem belongs to is half the work, and checking the domain at the end is the other habit that separates correct answers from nearly correct ones.

Frequently asked questions

Why can't you take the logarithm of a negative number?

Because log⁡bx=y\log_b x = y means by=xb^y = x, and a positive base raised to any real power is positive. No real exponent produces a negative number or zero, so those logarithms are undefined in the real numbers.

Do log and ln mean the same thing?

In most school courses log⁡\log means base 10 and ln⁡\ln means base ee. They are related by ln⁡x=log⁡x⋅ln⁡10\ln x = \log x \cdot \ln 10, roughly 2.3026log⁡x2.3026\log x. In many programming languages, however, log means the natural logarithm.

How do I evaluate a logarithm without a calculator?

Rewrite it as a power question. For log⁡464\log_4 64, ask what power of 4 is 64; since 43=644^3 = 64, the answer is 3. This works whenever the argument is a recognisable power of the base.

Do I always have to check answers to log equations?

Yes. Combining logarithms can introduce values that make an original argument zero or negative. Substitute each candidate into the original equation and reject any that give an undefined logarithm.

MathSolver Pro Editorial Team

Math content and review

Our editorial team writes every guide to explain the reasoning behind each method, not just the answer. Each worked example is checked against the site's own solver engines and automated tests before it is published, and articles are revised whenever a method or an exam format changes.