Functions

Inverse of a Logarithmic Function

The inverse of f(x)=log⁡bxf(x)=\log_b x is the exponential function f−1(x)=bxf^{-1}(x)=b^x, with the same base. To find it for any log function, swap xx and yy, rewrite the logarithm in exponential form, and solve for yy.

f(x)=log⁡bx  ⇒  f−1(x)=bxf(x)=\log_b x \;\Rightarrow\; f^{-1}(x)=b^{x}

A log and its exponential partner undo each other, so every shift, stretch and reflection inside the log comes back in the inverse, in reverse order. Below you will find where the rule comes from, a reliable method for transformed logs such as 2log⁡3(x−1)+42\log_3(x-1)+4, how domain and range swap, how to graph and check the result, and the cases where no inverse exists.

Why is the inverse of a logarithm an exponential function?

A logarithm is an exponent in disguise. By definition, log⁡bx\log_b x is the power you must put on bb to produce xx. That single idea gives the whole result:

y=log⁡bx  ⟺  by=xy=\log_b x \iff b^y=x

Read left to right, the statement takes xx in and returns yy. Read right to left, it takes yy in and returns xx. A function that reverses the inputs and outputs of another is its inverse, so x=byx=b^y is the inverse relation, and renaming the variables gives f−1(x)=bxf^{-1}(x)=b^x. No extra proof is needed beyond the definition.

You can see it in the ordered pairs. In base 2, log⁡28=3\log_2 8=3 puts (8,3)(8,3) on the log graph and (3,8)(3,8) on the exponential graph. Swapping every pair of a function builds the inverse relation (the vocabulary is covered in relations and functions), and that relation is itself a function only when the original is one-to-one. Log functions always are: for b>1b>1 they only climb, and for 0<b<10<b<1 they only fall, so every output has exactly one input.

The two cancellation rules you may have memorised are this inverse relationship in action:

blog⁡bx=x  (x>0),log⁡b ⁣(bx)=xb^{\log_b x}=x\ \ (x>0), \qquad \log_b\!\left(b^x\right)=x

They appear among the logarithm rules, but they are really the statement “these two functions reverse each other.” Notice the condition x>0x>0 on the first one. The log can only accept positive inputs, and that restriction will matter again later.

Quick check

If f(x)=log⁡2xf(x)=\log_2 x, what is f−1(3)f^{-1}(3)?

How to find the inverse of a log function step by step

Steps of a log function and its inverse in reverse order, with the divide by 2 in the exponent
Each step of f(x) = 2log₃(x−1)+4 has an undo partner, and the partners run in reverse order to give 3^((x−4)/2) + 1.

The routine is the same one used for any function:

  1. Replace f(x)f(x) with yy.
  2. Swap xx and yy.
  3. Isolate the logarithm on one side.
  4. Rewrite in exponential form.
  5. Solve for yy and write f−1(x)f^{-1}(x).

Step 3 is where most points are lost. The log must stand alone before you exponentiate, so any coefficient in front of it gets divided out and any added constant gets moved first. A shortcut is to undo operations in reverse order. For f(x)=alog⁡b(x−h)+kf(x)=a\log_b(x-h)+k, the function subtracts hh, takes the log, multiplies by aa, then adds kk. The inverse subtracts kk, divides by aa, exponentiates, then adds hh:

f−1(x)=b(x−k)/a+hf^{-1}(x)=b^{(x-k)/a}+h

The same swap-and-solve idea drives the inverse of a linear function; logs only add the exponential conversion in the middle.

Example 1. Find the inverse of f(x)=2log⁡3(x−1)+4f(x)=2\log_3(x-1)+4.

x=2log⁡3(y−1)+4swapx−4=2log⁡3(y−1)move the constantx−42=log⁡3(y−1)isolate the logy−1=3(x−4)/2exponential formy=3(x−4)/2+1solve for y\begin{aligned} x&=2\log_3(y-1)+4 &&\text{swap}\\ x-4&=2\log_3(y-1) &&\text{move the constant}\\ \frac{x-4}{2}&=\log_3(y-1) &&\text{isolate the log}\\ y-1&=3^{(x-4)/2} &&\text{exponential form}\\ y&=3^{(x-4)/2}+1 &&\text{solve for } y \end{aligned}

So f−1(x)=3(x−4)/2+1f^{-1}(x)=3^{(x-4)/2}+1. A quick test: f(4)=2log⁡33+4=6f(4)=2\log_3 3+4=6, and f−1(6)=31+1=4f^{-1}(6)=3^{1}+1=4. The point (4,6)(4,6) lands on (6,4)(6,4), as it should. The classic error is writing 3x−4/23^{x-4}/2, which divides the wrong thing. The 12\frac{1}{2} belongs in the exponent because it was attached to the log.

What is the inverse of ln x and log x?

In US courses, log⁡x\log x with no base means base 10, and ln⁡x\ln x means base e≈2.718e\approx 2.718. Their inverses are therefore 10x10^x and exe^x. Nothing new happens algebraically, but the base is hidden, and forgetting it is a common slip. When the base is invisible, ask which number is raised to a power.

Antilog

"Antilog" is the older name for the inverse of a log: antilogb x=bx\text{antilog}_b\,x=b^x. On a calculator, the 10x10^x and exe^x keys are usually the second functions printed above LOG and LN.

Example 2. Find the inverse of f(x)=3−ln⁡(2x)f(x)=3-\ln(2x).

x=3−ln⁡(2y)ln⁡(2y)=3−x2y=e3−xy=12e3−x\begin{aligned} x&=3-\ln(2y)\\ \ln(2y)&=3-x\\ 2y&=e^{3-x}\\ y&=\tfrac12 e^{3-x} \end{aligned}

So f−1(x)=12e3−xf^{-1}(x)=\tfrac12 e^{3-x}. Test it: f ⁣(12)=3−ln⁡1=3f\!\left(\tfrac12\right)=3-\ln 1=3, and f−1(3)=12e0=12f^{-1}(3)=\tfrac12 e^{0}=\tfrac12. The negative in front of ln⁡\ln flipped the exponent from x−3x-3 to 3−x3-x.

Reflections inside the log deserve one warning. For f(x)=ln⁡(−x)f(x)=\ln(-x), swapping gives x=ln⁡(−y)x=\ln(-y), so −y=ex-y=e^x and y=−exy=-e^x. The inverse is −ex-e^x, not e−xe^{-x}. The minus sign sits on the input of the log, so it ends up on the output of the exponential.

Domain and range of the inverse of a logarithmic function

Graph of 2log₃(x−1)+4 and its inverse mirrored over y = x with swapped asymptotes
Reflecting f(x) = 2log₃(x−1)+4 across y = x turns its vertical asymptote x = 1 into the horizontal asymptote y = 1.

Because inverses swap inputs and outputs, the domain and range trade places. You never need to add a restriction to the inverse by hand: it appears automatically. The range of f−1f^{-1} is the domain of ff, and that is how the inverse “remembers” that the log only accepted positive inputs.

Feature f(x)=log⁡bxf(x)=\log_b x f−1(x)=bxf^{-1}(x)=b^x
Domain x>0x>0 all real numbers
Range all real numbers y>0y>0
Asymptote x=0x=0 (vertical) y=0y=0 (horizontal)
Key points (1,0)(1,0) and (b,1)(b,1) (0,1)(0,1) and (1,b)(1,b)

For a shifted log f(x)=alog⁡b(x−h)+kf(x)=a\log_b(x-h)+k, the domain is x>hx>h and the range is all reals. The inverse then has all reals as its domain and range y>hy>h, with a horizontal asymptote at y=hy=h. In Example 1, h=1h=1, so the inverse 3(x−4)/2+13^{(x-4)/2}+1 levels off at y=1y=1, and you can read that off before doing any algebra. In Example 2, f(x)=3−ln⁡(2x)f(x)=3-\ln(2x) has domain x>0x>0, and the inverse 12e3−x\tfrac12 e^{3-x} is indeed always positive.

This gives a fast mental check: if your proposed inverse has the wrong asymptote, an algebra step went wrong. A horizontal asymptote that does not equal the horizontal shift hh of the original is a red flag.

Quick check

For f(x)=log⁡4(x−5)+2f(x)=\log_4(x-5)+2, state the domain of f−1f^{-1} and its horizontal asymptote.

How do you graph the inverse of a log function?

Reflect the graph across the line y=xy=x. Practically, pick three or four easy points on the log, swap each coordinate pair, and plot. For base bb, the friendly points are (1b,−1)\left(\tfrac1b,-1\right), (1,0)(1,0) and (b,1)(b,1), which become (−1,1b)\left(-1,\tfrac1b\right), (0,1)(0,1) and (1,b)(1,b). Then draw the curve hugging the new asymptote.

Shifts follow a pattern from function transformations with the roles exchanged. A horizontal shift of hh in the log becomes a vertical shift of hh in the inverse. A vertical shift of kk becomes a horizontal shift. A stretch by aa vertically in the log becomes a stretch by 1a\tfrac1a in the exponent. Starting from the parent functions log⁡bx\log_b x and bxb^x, you can build either graph by applying the same moves in opposite order.

The reflected graph is a function only if the log passes what amounts to a horizontal line test. Flipping across y=xy=x turns horizontal lines into vertical ones, so the vertical line test on the inverse is the horizontal test on the original. Logarithms pass easily.

Try this: Plot f(x)=log⁡2xf(x)=\log_2 x using (14,−2)\left(\tfrac14,-2\right), (12,−1)\left(\tfrac12,-1\right), (1,0)(1,0), (2,1)(2,1) and (4,2)(4,2). Swap every pair, plot the new points, and confirm the curve flattens toward the xx-axis on the left.

How to check the inverse of a log function

The definitive test is composition. If gg is the inverse of ff, then f(g(x))=xf(g(x))=x and g(f(x))=xg(f(x))=x. Both directions matter. Composition of functions is the tool, and with logs the cancellation rules from earlier do the work.

Example 3. Check that g(x)=2x−3g(x)=2^x-3 is the inverse of f(x)=log⁡2(x+3)f(x)=\log_2(x+3).

f(g(x))=log⁡2 ⁣(2x−3+3)=log⁡2 ⁣(2x)=xf(g(x))=\log_2\!\left(2^x-3+3\right)=\log_2\!\left(2^x\right)=x

g(f(x))=2log⁡2(x+3)−3=(x+3)−3=xg(f(x))=2^{\log_2(x+3)}-3=(x+3)-3=x

Both compositions return xx, so the functions are inverses. A point test is faster when the algebra is long: f(5)=log⁡28=3f(5)=\log_2 8=3, and g(3)=8−3=5g(3)=8-3=5. The input comes back.

The second composition carries a condition. 2log⁡2(x+3)2^{\log_2(x+3)} equals x+3x+3 only when x+3>0x+3>0, which is exactly the domain of ff. The identity holds wherever it makes sense, so check it on the original domain, not on all real numbers.

Inverse of a log function vs reciprocal of a log

Two different operations hide behind the same-looking symbols. The inverse f−1(x)f^{-1}(x) undoes ff. The reciprocal 1f(x)\frac{1}{f(x)} divides one by the output. For f(x)=log⁡2xf(x)=\log_2 x, take x=4x=4 in each:

f−1(2)=22=4but1f(2)=1log⁡22=1f^{-1}(2)=2^2=4 \qquad\text{but}\qquad \frac{1}{f(2)}=\frac{1}{\log_2 2}=1

The −1-1 is not a power

In f−1(x)f^{-1}(x), the −1-1 names the inverse function. A reciprocal is written 1f(x)\frac{1}{f(x)} or [f(x)]−1[f(x)]^{-1}, with brackets.

Even the reciprocal of a log is not an exponential. It is another log with the base and argument swapped, because 1log⁡bx=log⁡xb\frac{1}{\log_b x}=\log_x b. That relation comes from the change-of-base formula, and it explains why so many students mix the two: swapping places in a log looks like an inverse but is a reciprocal. The function notation page covers how to read f−1f^{-1} and why log⁡−1\log^{-1} is ambiguous. When a textbook writes log⁡−1(x)\log^{-1}(x), it means 10x10^x.

When a logarithmic function has no inverse

Plain alog⁡b(x−h)+ka\log_b(x-h)+k with a≠0a\neq 0 always has an inverse. The trouble starts when the log wraps something that is not one-to-one. Take g(x)=log⁡(x2)g(x)=\log(x^2). Both g(10)g(10) and g(−10)g(-10) equal 22, so two inputs share an output and nothing can reverse it. This function is even, and even functions cannot be one-to-one on a domain that includes both sides of zero.

The fix is to restrict the domain:

  • On x>0x>0, g(x)=2log⁡xg(x)=2\log x, and the inverse is 10x/210^{x/2}.
  • On x<0x<0, g(x)=2log⁡(−x)g(x)=2\log(-x), and the inverse is −10x/2-10^{x/2}.

Two other situations deserve mention. A base between 0 and 1, such as log⁡1/2x\log_{1/2}x, still has an inverse, namely (12)x\left(\tfrac12\right)^x, because the function is decreasing and still one-to-one. Check: log⁡1/24=−2\log_{1/2}4=-2 and (12)−2=4\left(\tfrac12\right)^{-2}=4.

The method also fails differently when a log is added to a plain term. The function f(x)=x+ln⁡xf(x)=x+\ln x is increasing, so it has an inverse, but algebra cannot isolate yy in x=y+ln⁡yx=y+\ln y using ordinary functions. Solving it requires the Lambert W function, giving y=W(ex)y=W(e^x). In practice, textbook problems avoid this, so a problem with ”xx and ln⁡x\ln x together” usually signals a numerical or graphical question instead.

Quick check

Show that h(x)=ln⁡(x2)h(x)=\ln(x^2) has no inverse on its natural domain by finding two inputs with the same output.

Where is the inverse of a log function used in real life?

Logarithmic scales compress huge ranges into small numbers: acidity, sound, earthquakes. The inverse converts back to the raw quantity, which is what a person actually wants to know. The step from a pH reading to a concentration is the inverse of a log, and understanding that link to the inverse of an exponential function shows both directions are one idea.

Example 4. Rainwater has a pH of 5.6. Find the hydrogen ion concentration, using pH=−log⁡[H+]\text{pH}=-\log[\text{H}^+].

5.6=−log⁡[H+]log⁡[H+]=−5.6[H+]=10−5.6≈2.5×10−6 mol/L\begin{aligned} 5.6&=-\log[\text{H}^+]\\ \log[\text{H}^+]&=-5.6\\ [\text{H}^+]&=10^{-5.6}\approx 2.5\times10^{-6}\ \text{mol/L} \end{aligned}

Because a drop of one pH unit multiplies the concentration by 10, a sample at pH 4.6 would be ten times as concentrated, about 2.5×10−52.5\times10^{-5}.

Sound works the same way. The decibel level is L=10log⁡ ⁣(II0)L=10\log\!\left(\frac{I}{I_0}\right), so the intensity is I=I0⋅10L/10I=I_0\cdot10^{L/10}. With the standard reference I0=10−12I_0=10^{-12} W/m², an 80 dB sound has I=10−12⋅108=10−4I=10^{-12}\cdot10^{8}=10^{-4} W/m². Earthquake magnitude follows suit: each whole number on the Richter scale means roughly ten times the measured amplitude.

Practice problems

0 of 5 solved

  1. Find the inverse of f(x)=log⁡5xf(x)=\log_5 x.

  2. Find the inverse of f(x)=log⁡2x+3f(x)=\log_2 x+3.

  3. Find the inverse of f(x)=4log⁡3(x+2)f(x)=4\log_3(x+2).

  4. Find the inverse of f(x)=5−2log⁡xf(x)=5-2\log x (base 10).

  5. Find the inverse of f(x)=ln⁡(3−x)+1f(x)=\ln(3-x)+1 and state its range.

Common questions

What is the inverse of a logarithmic function?

The inverse of f(x)=log⁡bxf(x)=\log_b x is the exponential function f−1(x)=bxf^{-1}(x)=b^x, with the same base. The two functions undo each other, and their graphs are mirror images across the line y=xy=x.

What is the inverse of ln x?

The inverse of ln⁡x\ln x is exe^x, because ln⁡\ln is the logarithm with base ee. Likewise the inverse of log⁡x\log x (base 10) is 10x10^x.

How do you find the inverse of log⁡2(x+3)\log_2(x+3)?

Swap the variables to get x=log⁡2(y+3)x=\log_2(y+3), rewrite as y+3=2xy+3=2^x, and solve to get f−1(x)=2x−3f^{-1}(x)=2^x-3. Check with a point: f(5)=3f(5)=3 and f−1(3)=5f^{-1}(3)=5.

What are the domain and range of the inverse of a log function?

For f(x)=log⁡bxf(x)=\log_b x, the inverse bxb^x has domain all real numbers and range y>0y>0. Domain and range always swap between a function and its inverse.

Is the inverse of a log function the same as its reciprocal?

No. The inverse f−1(x)f^{-1}(x) undoes ff, while the reciprocal 1f(x)\frac{1}{f(x)} is a different function. For f(x)=log⁡2xf(x)=\log_2 x, f−1(2)=4f^{-1}(2)=4 but 1f(2)=1\frac{1}{f(2)}=1.

Does every logarithmic function have an inverse?

Any function of the form alog⁡b(x−h)+ka\log_b(x-h)+k with a≠0a\neq 0 has an inverse, because it is one-to-one. A function such as ln⁡(x2)\ln(x^2) does not, until its domain is restricted.

Up next