# Finding the inverse of a function/algebraic manipulation

Sorry in advance if this is a little basic. It's just some simple algebra, but I'm repeatedly getting an answer that differs from the one in my textbook. I can see that the answer is incorrect, but I can't see where I'm going wrong in my working - even though it must be something pretty elementary. I have that:

$$f(x) = \frac{x-3}{x+2}$$

i.e.

$$y = \frac{x-3}{x+2}$$

So:

\begin{align*} y(x+2) & = x - 3\\ y(x+2) + 3 & = x \end{align*}

Multiplying those brackets out, I get:

$$x = yx + 2y + 3$$

$$f^{-1}(x) = x^2 + 2x + 3$$

But clearly $f^{-1}(f(x)) \neq x$.

The answer in my textbook (which I know to be correct) is $f^{-1}(x) = \frac{3+2x}{1-x}$. I can follow how they've arrived at this answer, but I can't see what I did incorrectly. Can someone point out my error?

• Did you mean $f^{-1}(f(x)) \neq x$? – N. F. Taussig Feb 24 '18 at 22:36
• You skipped an important step. Solve for $x = \dfrac{2y+3}{1-y}$ before doing your final step! – Ted Shifrin Feb 24 '18 at 22:37
• Never tell you are sorry when you have shown that you have tried, even if it may seem easy. – Mehrdad Zandigohar Feb 24 '18 at 22:38
• I did mean "not equal to x", post edited. – kevidigi Feb 24 '18 at 22:39

Let's start from here:

You concluded that: $x = yx + 2y + 3$, you should continue simplification:

$x = yx + 2y + 3 \to x-xy=2y+3 \to x(1-y)=2y+3 \to x=\dfrac{2y+3}{1-y}$

$\to f^{-1}(x)=\dfrac{2x+3}{1-x}$

• If $x = yx + 2y + 3$ AND $x = \frac{2y+3}{1-y}$ then how can it be that (substituting x for y): $x^2 + 2x + 3 \neq \frac{2x+3}{1-x}$? – kevidigi Feb 24 '18 at 22:44
• You first need to completely assign all $x$s to the left hand and all $y$s to the right hand then make x in only one term like: $x=...y/...y$ and then substitute. You hurried for substituting. @kevidigi – Mehrdad Zandigohar Feb 24 '18 at 22:48
• Of course. I'm looking for an equation where x only appears on the LHS. Thank you very much! – kevidigi Feb 24 '18 at 22:50
• Just one $x$ should be left side and no $x$ to the right side. – Mehrdad Zandigohar Feb 24 '18 at 22:50

HINT: At this point $x = yx + 2y + 3$, we have $$x-yx = 2y+3 \implies x(1-y) = 2y+3 \implies x = \frac{2y+3}{1-y}$$

Note that

$$y=\frac{x-3}{x+2}\iff xy+2y-x+3=0\iff x(y-1)=-2y-3\iff x=\frac{-2y-3}{y-1}$$

and thus

$$f^{-1}(x)=\frac{2x+3}{1-x}$$

Your mistake was in the following step

$$x = y\color{red}x + 2y + 3 \not \Rightarrow f^{-1}(x) = x^2 + 2x + 3$$

since you still had an $x$ term on the RHS.

• Yes, I can now see that I had lost sight of the objective - to remove all x terms from the RHS! Thank you. – kevidigi Feb 24 '18 at 22:52

How did you go from $$x = yx + 2y + 3$$ to

$$f^{−1}(x) = x^2 + 2x + 3?$$

There should not be an $x^2$.

Note that from $$x = yx + 2y + 3$$ we get $$x(1-y)=2y+3$$

Thus $$x= \frac {2y+3}{1-y}$$ which implies $$f^{-1}(x)=\frac {2x+3}{1-x}$$

• If you substitute x in for y, as you do when you write the expression as an inverse function, you have $$xx + 2x + 3$$ Which of course is $$x^2 + 2x + 3$$ No? – kevidigi Feb 24 '18 at 22:48
• I can see now that my error was jumping to the answer before removing all x terms from the RHS. Thanks! – kevidigi Feb 24 '18 at 22:53
• Correct. Thanks for the attention. – Mohammad Riazi-Kermani Feb 24 '18 at 23:01

$$f(x) = \frac{x-3}{x+2} = \left(1 - \frac{5}{2 + x}\right) =y$$ So: $$f(x)=y = \left(1 - \frac{5}{2 + x}\right)\implies f^{-1}(y) = \frac{5}{1-y}-2 = x$$
For more detail: \begin{align} y = 1 - \frac{5}{2 + x}\\ y + 1 = - \frac{5}{2 + x}\\ 1- y = \frac{5}{2 + x}\\ (2 + x)(1- y) = 5\\ 2 + x = \frac{5}{(1- y)}\\ x = \frac{5}{(1- y)}-2\\ \end{align} \begin{align} \tag*{$\Box$} \end{align}