# Finding the inverse of a function

In my notes, I have an example of finding the inverse to a function defined as follows:

$$f:\{x\in\mathbb{R}\mid x\neq 0\}\to\{x\in\mathbb{R}\mid x\neq 2\}, f(x)\mapsto\frac{2x-1}{x}$$

The prof went on to prove that the function was bijective before finding the inverse. By solving for x, he got the range:

$$x=\frac{1}{2-y}=\{x\in\mathbb{R}\mid x\neq 2\}$$

which matches the codomain above.

Now, he found the inverse by swapping the x and y and then solving for y again, and then he got

$$y=\frac{1}{2-x}$$

So... my question is: Is it necessarily true (or are there cases that prove otherwise) that the inverse of a function (if it exists) takes the same form as the range, but with the x and y variables swapped?

-
The inverse of a function is a function. The range of a function is a set. So the inverse of a function isn't even the same kind of thing as the range, and it doesn't make sense to ask whether it has the same form. – Gerry Myerson Mar 20 '13 at 1:47
I'd write either $f(x)=\dfrac{2x-1}{x}$ or $x\overset{f}{\mapsto}\dfrac{2x-1}{x}$, but never $f(x)\mapsto\dfrac{2x-1}{x}$. – Michael Hardy Mar 20 '13 at 1:51

If a function's inverse exists, then the range of $f$ is the domain of $f^{-1}$, and vice-versa:

...because if a function's inverse exists, the function is then bijective: a one-to-one and onto function. Then the domain of the function is the "image" of it's inverse, and the range is the image of the domain.

NOTE: I'm not clear what you mean by the inverse function having the same form as the range. If you mean that to ask if domain of the inverse function is the range of the function, then yes, that's true, and that's what I'm addressing above. Otherwise, please clarify.

The procedure your professor used is a good tool for finding both the inverse function, if it exists, and for defining the inverse of the image of a function.

In your case, if you are asking if a function and its inverse (if it exists) have the same "form", you need to be clear about what you mean. The fact that both your $f(x)$ and $f^{-1}(x)$ are represented as the quotient of polynomials, and that meaning: "same form", then know, that will not always be the case. If we want to find the inverse of the image of $f(x) = x^2$, then $$y = x^2 \iff \pm\sqrt y = x \implies f^{-1}(x) = \pm\sqrt x$$

Here, we have $f(x) = x^2,\,$ and $\,f^{-1}(x) = \pm\sqrt x$

which hardly appear to be of the same "form" as far as functions go.

Consider the functions $f: \mathbb R^+ \to \mathbb R^+: $$f(x) = e^x, \;\;f^{-1}(x) = \ln x$$ Would these functions be considered of the same "form"? Feel free to give further clarification if your question is other than what's been addressed. - The point is, what your prof got,$x=\cfrac{1}{2-y}$, is not the range. It is the inverse fucntion, although formally, it is better written as$f^{-1}(y)=\cfrac{1}{2-y}$. Then, it matches with the other result, which is$f^{-1}(x)=\cfrac{1}{2-x}$. The choice of notation for variable, i.e. the$x$in$f(x)$or$y$in$f(y)\$ does not matter.

-