SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 1.4.1 Exponents and their rulesConcept · 25 min
      2. 1.4.2 Exponential functions and the number eConcept · 25 min
      3. 1.4.3 Logarithms and their rulesConcept · 25 min
      4. 1.4.4 Solving exponential and logarithmic equationsConcept · 25 min
      5. 1.4.5 Practice set: exponents and logarithmsPractice set · 25 min
      6. 1.4.6 Case study: compounding and continuous ratesCase study · 35 min
      7. 1.4.7 Case study: simple returns and log returnsCase study · 30 min

Level 1, Precalculus 1.4 Exponents and logarithms Lesson 4 of 7

ConceptLesson 1.4.4 in Level 1, Precalculus. About 25 minutes.

Solving exponential and logarithmic equations

When both sides share a base

To solve 2x=322^x = 32, notice that 32=2532 = 2^5. Then 2x=252^x = 2^5, and equal powers of the same base have equal exponents, so x=5x = 5.

The answer need not be a positive whole number. 2x=182^x = \frac{1}{8} is 2x=2−32^x = 2^{-3}, so x=−3x = -3 (lesson 1.4.1). And 4x=84^x = 8 becomes 22x=232^{2x} = 2^3 once both sides are written in base 2, so 2x=32x = 3 and x=32x = \frac{3}{2}.

That works when you can spot the base. Usually you cannot: try writing 20 as a power of 3. For that you need logarithms.

A solution is a crossing point

Solving 3x=c3^x = c means finding where the curve y=3xy = 3^x meets the horizontal line y=cy = c.

3x=203^x = 20 has one solution, where the line y=20y = 20 crosses the curve. 3x=−43^x = -4 has none: the curve stays above the xx-axis.

A table brackets the crossing. 32=93^2 = 9 and 33=273^3 = 27, so xx is between 2 and 3. Narrowing the bracket, as bisection does in lesson 1.3.2, closes in on it:

xx22.72.722.732.83
3x3^x919.41919.850420.069721.67427

So the solution lies between 2.72 and 2.73. The next section finds it exactly.

The picture also shows when there is no solution. 3x3^x is always positive (lesson 1.4.2), so it never equals 0 or a negative number. And it always rises, so it meets each line above the axis exactly once.

Rule: How many solutions

bx=c has one solution if c>0and none if c≤0\begin{gathered} b^x = c \text{ has one solution if } c > 0 \\ \text{and none if } c \le 0 \end{gathered}

This holds for any base b>0b > 0 with b≠1b \neq 1, growth or decay. Check the sign of cc before you reach for logs.

The general method: take logs

Here is 3x=203^x = 20 solved step by step. Before you press Why?, try to say which rule each step uses.

  1. 1
    3x=203^x = 20
  2. 2
    ln⁡(3x)=ln⁡20\ln\left(3^x\right) = \ln 20
  3. 3
    xln⁡3=ln⁡20x \ln 3 = \ln 20
  4. 4
    x=ln⁡20ln⁡3≈2.7268x = \frac{\ln 20}{\ln 3} \approx 2.7268

That matches the table: between 2.72 and 2.73.

Rule: Solving for an unknown exponent

bx=c⟹x=ln⁡cln⁡b(b,c>0, b≠1)\begin{gathered} b^x = c \quad\Longrightarrow\quad x = \frac{\ln c}{\ln b} \\ (b, c > 0,\ b \neq 1) \end{gathered}

First get the power on its own on one side. Then take ln⁡\ln of both sides, bring the exponent down with the power rule, and solve.

The signs take care of themselves. For 0.5x=0.10.5^x = 0.1, both logs are negative: x=ln⁡0.1ln⁡0.5≈3.3219x = \frac{\ln 0.1}{\ln 0.5} \approx 3.3219, a positive answer. For 2x=0.32^x = 0.3, the target is below 1, so x=ln⁡0.3ln⁡2≈−1.7370x = \frac{\ln 0.3}{\ln 2} \approx -1.7370 is negative.

Try it

Compute each answer, then check it by putting it back into the original equation.

The first check prints 19.999999999999993 rather than 20. That tiny gap is rounding inside the computer, not a mistake in the method.

⌘/Ctrl + Enter runs the cell

Isolate the power first

Solve 5⋅2x+3=435 \cdot 2^x + 3 = 43. Taking logs straight away gets you stuck: ln⁡(5⋅2x+3)\ln(5 \cdot 2^x + 3) has no rule, because of the + 3+\,3. Undo the arithmetic around the power first.

5⋅2x+3=435⋅2x=402x=8x=3\begin{aligned} 5 \cdot 2^x + 3 &= 43 \\ 5 \cdot 2^x &= 40 \\ 2^x &= 8 \\ x &= 3 \end{aligned}

With base ee, ln⁡\ln undoes the power directly. Solve 4e2x=1004e^{2x} = 100:

e2x=252x=ln⁡25x=ln⁡252≈1.6094\begin{aligned} e^{2x} &= 25 \\ 2x &= \ln 25 \\ x &= \frac{\ln 25}{2} \approx 1.6094 \end{aligned}

Isolating can also reveal that there is no solution. 2⋅5x+9=32 \cdot 5^x + 9 = 3 becomes 5x=−35^x = -3, and no power of 5 is negative.

Try it

Check both answers by substituting them back.

The second line prints 99.99999999999999: rounding again.

⌘/Ctrl + Enter runs the cell

The unknown in two exponents

Solve 2x+1=5x2^{x+1} = 5^x. Taking logs works here too, and then it becomes an ordinary linear equation.

  1. 1
    ln⁡(2x+1)=ln⁡(5x)\ln\left(2^{x+1}\right) = \ln\left(5^x\right)
  2. 2
    (x+1)ln⁡2=xln⁡5(x + 1)\ln 2 = x \ln 5
  3. 3
    ln⁡2=xln⁡5−xln⁡2=x(ln⁡5−ln⁡2)\begin{aligned} \ln 2 &= x \ln 5 - x \ln 2 \\ &= x(\ln 5 - \ln 2) \end{aligned}
  4. 4
    x=ln⁡2ln⁡5−ln⁡2≈0.7565x = \frac{\ln 2}{\ln 5 - \ln 2} \approx 0.7565

Try it

Both sides should print the same value when we substitute the answer.

⌘/Ctrl + Enter runs the cell

Equations that hide a quadratic

Solve e2x−5ex+6=0e^{2x} - 5e^x + 6 = 0. Taking logs would get stuck on the sums. Instead, notice that e2x=(ex)2e^{2x} = (e^x)^2 by the power-of-a-power rule, and give exe^x a name.

let u=ex:u2−5u+6=0(u−2)(u−3)=0u=2 or u=3\begin{gathered} \text{let } u = e^x: \quad u^2 - 5u + 6 = 0 \\ (u - 2)(u - 3) = 0 \\ u = 2 \text{ or } u = 3 \end{gathered}

Now undo the substitution. ex=2e^x = 2 gives x=ln⁡2≈0.6931x = \ln 2 \approx 0.6931, and ex=3e^x = 3 gives x=ln⁡3≈1.0986x = \ln 3 \approx 1.0986. Two solutions.

Change one sign and a root disappears. e2x−ex−6=0e^{2x} - e^x - 6 = 0 factors as (u−3)(u+2)=0(u - 3)(u + 2) = 0, so u=3u = 3 or u=−2u = -2. But u=exu = e^x is never negative, so only x=ln⁡3x = \ln 3 survives.

Try it

The cell puts each answer back into its equation. Both lines of the first equation print 0.0.

The second prints about 1.8×10−151.8 \times 10^{-15}, rounding again. Writing math.log(-2) would fail, which is the second root refusing to exist.

⌘/Ctrl + Enter runs the cell

Solving log equations

To free an unknown from inside a log, apply the matching power to both sides. This undoes the log.

ln⁡x=3  ⟹  x=e3≈20.09log⁡3(2x−1)=2  ⟹  2x−1=32⟹  x=5\begin{gathered} \ln x = 3 \;\Longrightarrow\; x = e^3 \approx 20.09 \\[8pt] \log_3(2x - 1) = 2 \;\Longrightarrow\; 2x - 1 = 3^2 \\ \Longrightarrow\; x = 5 \end{gathered}

A negative log is no obstacle: ln⁡x=−2\ln x = -2 gives x=e−2≈0.1353x = e^{-2} \approx 0.1353, a positive number below 1 (lesson 1.4.3).

When there are two logs, combine them first. For log⁡2x+log⁡2(x−2)=3\log_2 x + \log_2(x - 2) = 3, the product rule gives one log, and undoing it leaves a quadratic:

log⁡2(x(x−2))=3x2−2x=8(x−4)(x+2)=0\begin{gathered} \log_2\big(x(x - 2)\big) = 3 \\ x^2 - 2x = 8 \\ (x - 4)(x + 2) = 0 \end{gathered}

So x=4x = 4 or x=−2x = -2. Check both in the original equation. x=4x = 4 gives log⁡24+log⁡22=2+1=3\log_2 4 + \log_2 2 = 2 + 1 = 3. But x=−2x = -2 would need log⁡2(−2)\log_2(-2), which does not exist, so the only solution is x=4x = 4.

Sometimes nothing survives. Solve ln⁡(x−5)=ln⁡(2x)\ln(x - 5) = \ln(2x). Equal logs mean equal inputs, so x−5=2xx - 5 = 2x, which gives x=−5x = -5. But then x−5=−10x - 5 = -10, and ln⁡(−10)\ln(-10) does not exist. The equation has no solution.

Rule: Always check log answers

ln⁡(input) exists only wheninput>0\begin{gathered} \ln(\text{input}) \text{ exists only when} \\ \text{input} > 0 \end{gathered}

Put each answer back into the original equation. Throw away any answer that makes the input to a log zero or negative.

Try it

Python can do the checking. math.log raises an error for an input of zero or less, which is how you spot an answer that does not work.

The cell checks e3e^3, the answer 5, the answer 4, then the two rejected values.

⌘/Ctrl + Enter runs the cell
Check yourself
Which of these equations has no solution?

Let SymPy check your algebra

Try it

SymPy solves equations exactly, which makes it a good answer-checker. It writes ln⁡\ln as log.

Declare the unknown real=True, or SymPy also reports complex answers. Then 2x=−82^x = -8 gives the empty list []: no solution.

The first run takes a few seconds while SymPy loads.

⌘/Ctrl + Enter runs the cell

The last line is a warning. SymPy returns −5-5 for ln⁡(x−5)=ln⁡(2x)\ln(x - 5) = \ln(2x), because it allows logs of negative numbers as complex numbers. So check every answer yourself, even one from SymPy.

Common mistakes

  1. Taking logs before isolating the power. ln⁡(5⋅2x+3)\ln(5 \cdot 2^x + 3) has no rule. Undo the + 3+\,3 and the 55 first.
  2. Simplifying the answer wrongly. ln⁡20ln⁡3\frac{\ln 20}{\ln 3} is not ln⁡203\ln\frac{20}{3}, and not ln⁡20−ln⁡3\ln 20 - \ln 3.
  3. Expecting a solution for every target. bx=cb^x = c has none when c≤0c \le 0.
  4. Rejecting a negative log. ln⁡x=−2\ln x = -2 is fine: x=e−2x = e^{-2}.
  5. Keeping every root of the quadratic. ex=−2e^x = -2 and log⁡2(−2)\log_2(-2) both fail; check each root.
  6. Dropping brackets. ln⁡2x+1\ln 2^{x+1} is (x+1)ln⁡2(x + 1)\ln 2, not x+1⋅ln⁡2x + 1 \cdot \ln 2.

Solve for x

0 of 12 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
  12. 12.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Summary card

  • bx=cb^x = c has one solution when c>0c > 0 and none when c≤0c \le 0: it is where y=bxy = b^x crosses y=cy = c.
  • Unknown exponent: isolate the power, take ln⁡\ln of both sides, bring the exponent down with the power rule. bx=cb^x = c gives x=ln⁡c/ln⁡bx = \ln c / \ln b.
  • e2xe^{2x} is (ex)2(e^x)^2: substitute u=exu = e^x, solve the quadratic, and drop any u≤0u \le 0.
  • Unknown inside a log: combine logs, then undo with the matching power, so log⁡b(…)=k\log_b(\ldots) = k gives …=bk\ldots = b^k.
  • Check every answer in the original equation; inputs to logs must be positive. SymPy does not do this check for you.

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.