Apparently, the problem is not that easy after all. What your teacher believes is the solution is obviously wrong. After all, she suggests that $\frac12$ is one of the solutions, but
$$ (\tfrac12)^2-(k+1)\tfrac12+k+1\ne 0$$
Compare $(a-r_1)(x-r_2) = x^2 - (r_1+r_2)x + r_1r_2$ to $(a-r_1)(x-r_2) = x^2 - 5x + 6$.
$$(x - r_1)(x - r_2) =
\left\{\begin{array}{ccc}
x^2 & -5x & +6 \\
x^2 & -(r_1+r_2)x & +r_1r_2
\end{array}\right\}$$
You can see that you need to find $r_1$ and $r_2$ such that $r_1+r_2 = 5$ and $r_1 r_2 = 6$
Note that the coefficient of $x^2$ is $1$. When it is not, then you will need to do a bit more work.
There are several ways to do this. The better you are at arithmetic, the easier this will be.
- METHOD $1:$
Make a list of the pairs of factors that multiply to make $6$.
\begin{array}{ccc}
1 & 6 \\ 2 & 3
\end{array}
Then append a third column that consists of their sums.
\begin{array}{cc|c}
1 & 6 & 7 \\ 2 & 3 & 5
\end{array}
We see that $r_1=2$ and $r_2=3$ is what we are looking for.
This method works. But it requires that you be pretty good at arithmetic and at solving simple linear equations.
Let $r_1 = u - v$ and let $r_2 = u+v$
Then $5 = r_1 + r_2 = (u-v) + (u+v) = 2u$. So $u = \dfrac 52$. So
$6 = r_1 r_2 = \left(\dfrac 52 - v\right)\left(\dfrac 52 + v\right)
= \dfrac{25}{4}-v^2$. Solve for $v$.
\begin{align}
\dfrac{25}{4}-v^2 &= 6 \\
v_2 - \dfrac{25}{4} &= -6 \\
4v^2 - 25 &= -24 \\
4v^2 &= 1 \\
v^2 &= \dfrac 14 \\
v &= \dfrac 12
\end{align}
So $r_1 = u - v = \dfrac 52 - \dfrac 12 = 2$
and $r_2 = u + v = \dfrac 52 + \dfrac 12 = 3$
- METHOD $3$: Completing the square.
\begin{align}
x^2 - 5x + 6 &= 0 \\
x^2 - 5x &= -6
&\text{Move the constant term over to the other side.} \\
& & \text{Take half of $5$ and square it.
$\left(\dfrac 52 \right)^2 = \dfrac{25}{4}$} \\
x^2 - 5x + \dfrac{25}{4} &= \dfrac{25}{4} - 6
&\text{Add that number to both sides.} \\
\left(x - \frac 52 \right)^2 &= \frac 14 &\text{Simplify} \\
x - \frac 52 &= \pm \dfrac 12 \\
x &= \frac 52 \pm \frac 12 \\
x &= 2, 3
\end{align}
Best Answer
Suppose I have a mystery quadratic $p(x) = -2x^2 + x + 1$, and want to factorise it using the quadratic formula. I can find the roots easily enough:
$$ x = \frac{-1 \pm \sqrt{1 + 8}}{-4}$$ and so the roots are $-\frac{1}{2}$ and $1$, and so I think that the polynomial should factorise as $p(x) = (x - 1)(x+\frac{1}{2})$. But this is wrong, since I forgot that $p(x)$ and $2p(x)$ and $\frac{-p(x)}{9}$ and so on all have the same roots! And so knowing the two roots only determines $p(x)$ up to scaling. But it's easy to find the right scaling factor, by just looking at the $-2x^2$ term. So I arrive at the actual answer, of $$ p(x) = -2x^2 + x + 1 = -2(x-1)(x + \frac{1}{2})$$
So after you find the roots, remember to multiply the whole thing by the right number to fix up the $x^2$ term.