How to solve without solving by inspection? $\frac{x+5}{x+k}=\frac{-kx+5}{x-1}$ Background: This is from a test review on functions. The original problem was

Find the value of $k$ so that the function $f(x) = \frac{x+5}{x+k}$ will be its own inverse.

I found the answer by inspection, and then tried to solve it through more rigorous means. Continuing from the question title, I cross multiplied and used the quadratic formula on $k.$
$x^2+4x-5=5x+5k-kx^2-k^2x$
$k^2x+k(x^2-5)+(x^2-x-5)=0$
$k = \frac{-x+5\pm\sqrt{x^4-10x^2+25-4x(x^2-x-5)}}{2x}$
$k = \frac{-x+5\pm\sqrt{x^4-4x^3-6x^2+20x+25}}{2x}$
This is where I got stuck. Any ideas?

For the original problem, you can also use the fact that a self-inverse function requires that  $ \ f \ \circ \ f (x) \ = \ f( \ f(x) \ ) \ =  \ x \ $ .  (A rational function of linear polynomials is easily shown to be one-to-one.) Hence,
$$ \ \frac{\left(\frac{x+5}{x+k}\right)  + 5 }{  \left(\frac{x+5}{x+k}\right)  + k } \ \ = \ \ x  \ \ \Rightarrow \ \ \frac{\left(\frac{x+5}{x+k}\right)  + 5 }{  \left(\frac{x+5}{x+k}\right)  + k } \ \cdot \ \frac{x+k}{x+k} \ \ = \ \ x $$
$$\Rightarrow \ \ \frac{ ( x+5)   + 5  \ (x + k) }{  (x+5)   + k \ (x+k)  }  \ \ = \ \ x  \ \ \Rightarrow \ \ \frac{   6x    + (5 k+5) }{  (k+1)x   + (k ^2 + 5) } \ \ = \ \ x \ \ . $$
For this last equation to hold, the "constant term" $ \ (5k \ + \ 5) \ $ in the numerator and the "linear term" $ \ (k \ + \ 1) \ x  \ $ must vanish.  The one value of $ \ k \ $ for which this occurs also makes the "constant term" $ \ (k^2 \ +  \ 5) \ $ in the denominator match the coefficient of the "linear term" $ \ 6x \ $ in the numerator, thereby satisfying the equation.
Alternatively, in the spirit of Dave L. Renfro's answer, the domain(range) of a one-to-one function is the same as the range(domain) of its inverse.  Finding the asymptotes of $ \ f(x) \ $ tells us that the domain of the function is $  \ x \ \neq \ -k \ $ and the range is $  \ y \ \neq \ 1 \ $ (in $ \ \mathbb{R}  $ ).  But for a self-inverse function, its domain and range are identical.  Thus, $ \ -k \ = \ 1 \ $ .
