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?

You can use the fact that the $x$-intercept and the $y$-intercept get switched, OR you can use the fact that the horizontal asymptote and the vertical asymptote get switched.
(ADDED A FEW MINUTES LATER)
Since I am pretty sure the intended solution of this problem is how I suggested (and not by the heavy algebraic manipulations that others have given), I thought it best to give some more details.
The $x$- and $y$-intercepts of $\;y = \frac{x+5}{x+k}\;$ are $(-5,0)$ and $(0,\frac{5}{k}).$ Therefore, the $x$- and $y$-intercepts of the inverse will be $(\frac{5}{k},0)$ and $(0,-5).$ (Recall that if $(a,b)$ is on the graph of the original function, then $(b,a)$ will be on the graph of the inverse.) Since the function and its inverse are the same function (hence their graphs will be identical), it follows that $\;(-5,0) = (\frac{5}{k},0)\;$ and $\;(0,\frac{5}{k}) = (0,-5),\;$ and each of these equations gives us $\;-5 = \frac{5}{k},\;$ or $k = -1.$
Alternatively, the horizontal asymptote of $\;y = \frac{x+5}{x+k}\;$ is $y = 1$ and the vertical asymptote of $\;y = \frac{x+5}{x+k}\;$ is $x=-k.$ Therefore, the inverse will have a horizontal asymptote of $y = -k$ and a vertical asymptote of $x = 1.$ (When you perform the transformation that replaces $x$ with $y$ and replaces $y$ with $x,$ the line $y=1$ gets transformed into the line $x=1$ and the line $x=-k$ gets transformed into the line $y=-k.$ Also, if the graph gets close to the former lines far from the origin, the graph of the inverse gets close to the latter lines far from the origin, and thus the latter lines are also asymptotes.) Now, since the function and its inverse are the same function (hence their graphs will be identical), we immediately get that $k = -1.$
