# how do I find the tangent line of a function that passes a given point

I have the function $f(x) = \frac{x}{x-1}$ and I have to find the equations of the lines that pass the point A(-1,5) and are tangent to f.

This is what I have tried I calculated the derivative of f(x) to get the slope of a tangent line at any point on the graph of f. $f'(x)=\frac{-1}{(x-1)^2}$ then I used the line equation and replaced its slope with the derivative but I got nowhere.

Let the point on the curve be $(x_0,y_0=x_0/(x_0-1))$. The slope is $-1/(x_0-1)^2$. So
$$\frac{5-y_0}{-1-x_0}=\frac{-1}{(x_0-1)^2}$$ $$\frac{5-x_0/(x_0-1)}{-1-x_0}=\frac{-1}{(x_0-1)^2}$$ $$x_0=2 \text{ or }1/2$$ $$y_0=2 \text{ or }-1$$ The slopes are $-1$ or $-4$, respectively.
So the two equations are $$\frac{y-5}{x+1}=-1$$ and $$\frac{y-5}{x+1}=-4$$