Symmetry of exponential and logarithmic functions

The exponential function y=exy = e^x and the logarithmic function y=lnxy = \ln x are inverse functions, and their graphs are symmetric about the line y=xy = x.

What an inverse function is

An inverse function swaps the roles of xx and yy. The function y=exy = e^x takes xx and returns exe^x; going the other way, recovering xx from the value, is y=lnxy = \ln x. For instance exe^x passes through y=1y = 1 at x=0x = 0, and lnx\ln x passes through y=0y = 0 at x=1x = 1. Points like (0,1)(0, 1) and (1,0)(1, 0), with their xx- and yy-coordinates swapped, correspond to each other.

How to build one

An inverse can be built mechanically. Solving y=exy = e^x for xx gives x=lnyx = \ln y; renaming the letters so that the input is again called xx gives y=lnxy = \ln x. That recipe, solve and then swap the names, is how inverses are made, and the swap of names is exactly what reflecting the graph across y=xy = x does.

Why the symmetry is about y=xy = x

In general the points (a,b)(a, b) and (b,a)(b, a) are symmetric about the line y=xy = x. Since an inverse swaps (x,y)(x, y), for every point (a,b)(a, b) on y=f(x)y = f(x) the inverse has the point (b,a)(b, a). So the two graphs are reflections of each other in y=xy = x as a mirror.

What gets swapped

Itemy=exy = e^xy=lnxy = \ln x
Domainall real numbersx>0x > 0
Rangey>0y > 0all real numbers
Asymptotethe xx-axisthe yy-axis
A point it passes through(0,1)(0, 1)(1,0)(1, 0)

Applying the two in succession returns you to the start: ln(ex)=x\ln(e^x) = x and elnx=xe^{\ln x} = x say that a round trip changes nothing. That exe^x has the xx-axis as an asymptote while lnx\ln x has the yy-axis is likewise the same fact seen in the mirror.

Tangent slopes

Tangent slopes correspond as well. The tangent to exe^x at (0,1)(0, 1) has slope 11, and the tangent to lnx\ln x at (1,0)(1, 0) also has slope 11. Reflection turns a slope into its reciprocal, and the reciprocal of 11 is 11.

When an inverse exists

Only a one-to-one function has an inverse, and exe^x qualifies because it increases monotonically. The symmetry is not special to ee: 2x2^x and log2x\log_2 x stand in exactly the same relation. The large dots on the graph are the symmetric pair (0,1)(0, 1) and (1,0)(1, 0).