Finding values of $a$, $b$, $c$, $d$ such that a $f(x)=\frac{ax+d}{cx+b}$ is self inverse I am trying to solve the following problem:
(screenshot)

For which numbers $a$, $b$, $c$, and $d$ will the function$$f(x)=\frac{ax+b}{cx+d}$$ satisfy $f(f(x))=x$ for all $x$?

I have a solution, but I'm not sure if it's right, because it seems overly complex. Could someone check my solution please?
We know that $\frac{a\frac{ax+b}{cx+d}+b}{c\frac{ax+b}{cx+d}+d} = x$ for all real numbers $x$. However, this equality will only hold under 2 conditions:

*

*$cx+d \ne 0$ for all real $x$, because if $cx+d = 0$, we would have an indeterminate form within the equation.


*$(ca + cd)x + cb + d^2 \ne 0$ for all real $x$, for the same reason as above.
To ensure the above holds for all $x$, we must ensure that the $x$ such that each expression $= 0$ is not equal to a real number. Hence:
$cx+d=0$
$x=-d/c$
So $c=0$ to prevent $x$ from being a real number, and $d \ne 0$, to ensure the above expression never equals to $0$.
Hence:
$(ca + cd)x + cb + d^2 = 0$
By the same reasoning, $ca + cd=0$ and $cb + d^2 \ne 0$.
Given this, we can rearrange the above to form the quadratic: $(ca+cd)x^2 + (d^2 - a^2)x + ba + bd = 0$.
The only quadratic that outputs $0$ for all values is one where the coefficients all are equal to $0$.
Hence:
$ca + cd = 0$
$d^2 - a^2 = 0$
$ba + bd = 0$
Since $c=0$, there are 2 possibilities:

*

*$a=-d$, $d \ne 0$ and $b =$ all real numbers

*$a=d$, $d \ne 0$ and $b = 0$
I'm not sure if this is right though - it seems overly complex, especially the steps where I state that $cx+d \ne 0$ and $(ca + cd)x + cb + d^2 \ne 0$. Could someone check my solution, and provide me with the correct one, if mine is wrong?
Thanks so much in advance!
 A: You are misunderstanding the meaning of “for all $x$”. It means “for all $x$ in the domain of $f$”, not “for all $x\in\Bbb R$”. And the domain of $f$ is $\Bbb R\setminus\left\{-\frac bc\right\}$ if $c\ne0$. You can check that, for instance, if $c\ne0$, then the function defined by$$f(x)=\frac{ax+\frac{1-a^2}c}{cx-a}$$is such that $f\circ f=f$.
A: To find all numbers $a$, $b$, $c$, and $d$ satisfying$$(f \circ f)(x)=f(f(x))=x \quad \text{ for all }x,$$where $f(x)=\frac{ax+b}{cx+d}$, you do not need to care the domain of $f \circ f$, $D_{ f \circ f}$ (in terms of your language, the $x$'s not causing any indeterminate form).
Let us find all numbers $a$, $b$, $c$, and $d$ satisfying the given condition for all $x\in D_{ f \circ f}$, and then I will show that the solution is also valid for all $x$. So, we have$$\frac{a \frac{ax+b}{cx+d}+b}{c\frac{ax+b}{cx+d}+d}=x \quad \Rightarrow \quad (ac+dc)x^2+(d^2-a^2)x-(ab+db)=0$$(Please note that in order that the above identity is defined, both $c$ and $d$ cannot be zero at the same time).
The above equality holds for any x if each coefficient of the quadratic is equal to zero; that is, we must have$$\begin{cases}ac+dc=0, \\ d^2-a^2=0, \\ -(ab+db)=0 \end{cases} \quad \Rightarrow \quad \begin{cases}c(a+d)=0, \\ d=\pm a, \\ b(a+d)=0 \end{cases}.$$Thus, there are two cases:

*

*if $(a+d)\neq 0$, then we have $b=c=0$ and $a=d$, where $d$ can be any nonzero real number,


*if $(a+d)=0$, then $b$, $c$ can be any real numbers and $a=-d$, where $d$ can be any real number (The case $c=d=0$ is already excluded).
Hence, we concluded that for any $x\in D_{f \circ f}$ the above solution satisfies the given condition. Now, the statement "if $x \not \in D_{f \circ f}$, then the solution satisfies the given condition" is valid because if the antecedent of a conditional statement is false then the conditional statement is true (For more information, please see this post); in fact, there exists an implicit antecedent in "$f(f(x))=x$" stating that "if $x$ is in the domain of $f \circ f$," which is false for $x \not \in D_{f \circ f}$.
Thus, for all $x$ the solution satisfies the given condition.
