### Instruction:
The function $f$ defined by $f(x)= \frac{ax+b}{cx+d}$, where $a$,$b$,$c$ and $d$ are nonzero real numbers, has the properties $f(19)=19$, $f(97)=97$ and $f(f(x))=x$ for all values except $\frac{-d}{c}$. Find the unique number that is not in the range of $f$.

### Response:

Let's start by finding $f(f(x))$. We can do that by plugging $f(x)$ into $f(x)$. So $f(f(x))=f(\frac{ax+b}{cx+d})=\frac{a(\frac{ax+b}{cx+d})+b}{c(\frac{ax+b}{cx+d})+d}$. Then, we can multiply the numerator and denominator by $cx+d$ to get rid of the fraction. This gives $\frac{a(ax+b)+b(cx+d)}{c(ax+b)+d(cx+d)}$ And we know from the problem that this expression is equal to $x$. So we have $\frac{a^2x+ab+bcx+bd}{acx+bc+dcx+d^2}=x$. But we can simplify it, by expanding the numerator and denominator. This gives us $a(ax+b)+b(cx+d)=x(c(ax+b)+d(cx+d))$. Now we can distribute. So $d^2-a^2=0$. This gives $a=\pm d$. If $a=d$, then $ac+dc=0$ implies $c=0$, but $c$ is nonzero. So $a=-d$. So $a=-d$. Since $b\ne0$, we obtain $a+c=0$ or $c=-a$. Let's plug this into the expression for $f(x)$. $f(x)=\frac{ax+b}{cx+d}=\frac{ax+b}{-ax+d}=\frac{ax+b}{d-ax}$. So $f(x)=\frac{ax+b}{-ax-a}$. Simplifying the denominator gives $f(x)=\frac{ax+b}{-a(x+1)}$. We know that $f(19)=19$ and $f(97)=97$. So we have two equations: $\frac{-19-b/a}{19+1}=19$ and $\frac{-97-b/a}{97+1}=97$. We know that $f(19)=19$ and $f(97)=97$. So we have two equations: $\frac{19a+b}{19c+d}=19$ and $\frac{97a+b}{97c+d}=97$. Simplifying, we get $19a+b=19^2c+19d$ and $97a+b=97^2c+97d$. What if we subtracted the first equation from the second? We would get $97a-19a+b-b=(97^2-19^2)c+(97-19)d$. Or $78a=(97^2-19^2)c+(97-19)d$. We can divide both sides by $78$ to get $a=(\frac{97^2-19^2}{78})c+(\frac{97-19}{78})d$. We can divide both sides by $78$ to get $b=(\frac{19-97}{78})*19*97c$. Then we get $a=116+78d$ and $b=-1843$. But we were told that $f(f(x))=x$ for all values except $\frac{-d}{c}$. Yes, let's plug in $f(x)$ into $x$. We get $\frac{(116+78d)^2x-19*97(116+78d)}{x+d}=x$. Yes, so we have $d^2-a^2=0$. This gives $a=\pm d$. $a=d$ gives $c=0$, which is impossible. So $a=-d$. We obtain $-d=116+78d$, which gives $d=-\frac{116}{79}$. We get $d=-58$. So $a=58$. I think so too.

