DEV Community

Calcrio
Calcrio

Posted on

Exponential Equations, Explained: The Math Behind the Harvard 3^x = x^9 Question

An exponential equation is an equation where the unknown sits in the exponent: 2^x = 32, 5^x = 125, e^x = 20. The equation 3^x = x^9 went viral as a "Harvard question" because it looks impossible and then resolves into a 13-digit exact match. Here is the math — the general method, the famous answer, and the second solution most explanations skip.

The One Idea That Solves a^x = b

Logarithms undo exponents. That is the whole method.
Take the natural log of both sides of a^x = b:
ln(a^x) = ln(b)
Apply the power rule, ln(a^x) = x · ln(a):
x · ln(a) = ln(b)
Divide by ln(a):
x = ln(b) / ln(a)
That single formula solves every equation of the form a^x = b (for a > 0, a ≠ 1, b > 0). Two examples:

  • 2^x = 32 → x = ln 32 / ln 2 = 5. Exact, because 32 = 2^5.
  • 2^x = 3 → x = ln 3 / ln 2 ≈ 1.5850. Not a whole number — and that is normal. Check: 2^1.5850 ≈ 3.0001. If both sides can be written as powers of the same base, there is a faster route: rewrite and set the exponents equal. 5^x = 125 becomes 5^x = 5^3, so x = 3. 4^(x+1) = 64 becomes 4^(x+1) = 4^3, so x = 2. But the logarithm formula works even when the same-base trick does not, which is why it is the method worth learning first. If you want the steps and the check done for you, a free exponential equation solver runs this formula and shows the substitution check for every answer.

The Harvard Question: 3^x = x^9

This equation is harder because x appears twice — once as an exponent on the left, once as the base on the right. Logarithms alone do not finish it: taking logs gives x · ln 3 = 9 · ln x, which still has x on both sides.
The way in is the structure of the numbers. Notice that 9 = 3^2, and try a value of x that is a power of 3. The candidate is 27, because 27 = 3^3:

  • Left side: 3^27 = 7,625,597,484,987.
  • Right side: 27^9 = (3^3)^9 = 3^(3 × 9) = 3^27 = 7,625,597,484,987. Both sides are exactly equal — a 13-digit number matching digit for digit. So x = 27 is a solution, and it is the answer the puzzle is famous for.

The Second Solution Nobody Mentions

Most explanations stop at 27. But the equation has a second real solution, and the logarithm equation finds it. Define f(x) = x · ln 3 − 9 · ln x. A solution is a value where f(x) = 0. The function crosses zero twice: once at x = 27, and once at x ≈ 1.1508.
Check it: 3^1.1508 ≈ 3.5406, and 1.1508^9 ≈ 3.5400. The two sides agree to three decimal places. The solver finds both roots by scanning for sign changes in f(x) and refining each one by bisection — the same technique any numerical root-finder uses.
This is a good general lesson for developers: equations of the form a^x = x^b can have zero, one, or two real solutions, and the dividing line is governed by the Lambert W function. If you ever implement a solver, always search for the second root — the "obvious" answer is not always the only one.

Where This Shows Up in Real Code and Real Life

Exponential equations are the equations behind anything that grows or shrinks by a fixed percentage per step:

  • Compound interest: $1,000 at 5% for 10 years is 1000 × 1.05^10 = $1,628.89.
  • Half-life: 100 g of a substance with a 5-year half-life becomes 25 g after 10 years.
  • Doubling time: a population growing at 2% per year doubles in ln 2 / ln 1.02 ≈ 35.0 years — the origin of the "rule of 70." The same logarithm step solves all of them. If you are solving one by hand, the full walkthrough of how to solve exponential equations covers the same-base method, the log method, and the substitution check in detail.

The Bottom Line

Logarithms undo exponents: x = ln(b) / ln(a) solves a^x = b every time. The viral 3^x = x^9 question is solved by noticing that 27 = 3^3, which makes both sides equal to 7,625,597,484,987 — and the equation quietly has a second solution, x ≈ 1.1508, that logarithms reveal. Always verify by substitution: compute both sides, and trust the numbers, not the guess.

Top comments (0)