TITLE: Is there an explanation why the reflection of $f(x)$ through y = x is its inverse?
QUESTION [13 upvotes]: e.g. The function $e^x$ reflected through $y=x$ is $\ln x$. Is this always true OR just in some cases?

REPLY [10 votes]: Suppose that $D(a,b)$ is a point on the graph of a one-to-one function defined by $y=f(x)$.
Then $b=f(a)$ This means that $a=f^{-1}(b)$, so $D_{1}(b,a)$ is a point on the
graph of the inverse function $f^{-1}$. Now, two points are said to be symmetric with respect to any line if the line is perpendicular to the segment that links both points in its midpoint. 
Therefore, the demonstration reduces to prove that $y=x$ is perpendicular to the segment $DD_{1}$ in its midpoint $M$. The midpoint of $DD_{1}$ is $M$($\frac{a+b}{2}$,$\frac{a+b}{2}$), which also belongs to $y=x$. Then the line $y=x$ intersects the segment $DD_1$ at its midpoint $M$. Now, two nonvertical lines are perpendicular if and only if the product of their slopes is $-1$.The slope $m$ of $y=x$ is $m=1$. The slope $m_1$ of the line $DD_1$ is $m_1=\frac{b-a}{a-b}=\frac{-(a-b)}{a-b}=-1$. It follows that the line $y=x$ is perpendicular to the segment $DD_1$in its midpoint $M$. 
Q.E.D.