Simplest solution: we know that x=1 is a solution so x-1 is a factor.
In a quadratic the constant term is the product of the roots so m must be the other root.
The x term is minus the sum of the roots, so k=-(1+m).
1st alternative solution:
Divide the quadratic by x-1 or use synthetic division applying the root 1 and you get the result x-m.
2nd alternative solution:
We can apply the quadratic formula or complete the square. Let's apply the formula:
x=(-k±sqrt(k^2-4m))/2.
We know that one root is x=1, so (-k±sqrt(k^2-4m))/2=1.
Let's assume that we take the positive square root:
(sqrt(k^2-4m)-k)=2 or sqrt(k^2-4m)=k+2.
Squaring both sides we get:
k^2-4m=k^2+4k+4 from which m=-(k+1) or k=-(m+1).
But that means we can calculate the square root in the quadratic formula and get the other root:
x=(-k-(k+2))/2=(-2k-2)/2=-(k+1)=m.
The quadratic becomes: (x-m)(x-1)=x^2-x+mx-m=0:
x^2-x(m+1)+m=0.