Determine the value of $k$ such that the line determined by the points $(3,2)$ and $(1,-2)$ is tangent to the graph of $y=\frac{k}{x+1}$. I have done the following work but I am stuck on solving for k. Am I doing this right? If so what do I do next?

 A: We have 
$1.$ $k/(x+1)=2x-4$
$2.$ $-k/(x+1)^2=2$
First equation
Multiplying it by $(x+1)$
$k=(x+1)\cdot (2x-4)=2x^2-4x+2x-4=2x^2-2x-4 \quad (1)$
Second equation
Multiply it by $(x+1)^2$
$-k=2(x+1)^2=2x^2+4x+2 \Rightarrow k=-2x^2-4x-2 \quad (2)$
Set $(1)$ equal to $(2)$
$2x^2-2x-4=-2x^2-4x-2$
$4x^2+2x-2=0$
$2x^2+1x-1=0$
Solve for $x$. This gives $x_1=-1$ and $x_2=0.5$ 
$x_1$ is not in the domain of $y=k/(x+1)$.
Now insert $x=0.5$ in  $k/(x+1)=2x-4$ to obtain the value of $k$

A: You are given a function $$y=\frac{k}{x+1}.$$
The line defined by the two points has a slope of $$m=\frac{\Delta y}{\Delta x}=\frac{2-(-2)}{3-1}=2$$
and therefore has an equation $$y-2=2(x-3)\Rightarrow2x-y-4=0$$
We want the original function and the tangent line to have exactly one point of intersection (by the definition of a tangent line), so we have the set of equations
\begin{cases} y=\dfrac{k}{x+1} \\ 2x-y-4=0
\end{cases}
Solving by substitution we have
\begin{align}
2x-\frac{k}{x+1}-4&=0\\
2x(x+1)-k-4(x+1)&=0\\
2x^2-2x+(-4-k)&=0
\end{align}
This quadratic equation has exactly one solution when the discriminant $b^2-4ac=0$.  Thus, we have
\begin{align}
b^2-4ac=0&=(-2)^2-4(2)(-4-k)\\
0&=4+32+8k\\
8k&=-36\\
k&=-\frac92
\end{align}
A graph of the two functions:
 
