x^2+5x+k^2-2kx-5k-6=0
x^2-2kx+5x+k^2-5k-6=0
x^2-2kx+5x+(k-6)(k+1)=0
x^2-(2k-5)x+(k-6)(k+1)=0
[x-(k-6)][x-(k+1)]=0
(x-k+6)(x-k-1)=0
x^2+5x+k^2-2kx-5k-6=0
x^2-2kx+5x+k^2-5k-6=0
x^2-2kx+5x+(k-6)(k+1)=0
x^2-(2k-5)x+(k-6)(k+1)=0
[x-(k-6)][x-(k+1)]=0
(x-k+6)(x-k-1)=0