I need help with this:
In what interval does $k$ need to vary so that the two roots of the equation
$$x^2 - 2kx + k^2-1 = 0$$
are between $-2$ and $4$?
I think the answer is $k = [-1, 3]$, but I found that out by trial and error. How could I solve this problem? Thanks in advance.
$$x^2-2kx+k^2-1=0$$
$$\Leftrightarrow (x-k)^2-1=0$$
$$\Leftrightarrow (x-k-1)(x-k+1)=0$$
$$\Leftrightarrow x_{1}=k-1;x_{2}=k+1$$.
We have $-2 \le x_{1},x_{2} \le 4$ and because $x_{1}<x_{2}$ for all $k$, we will have $-2 \le k-1<k+1 \le 4$ or ${\begin{cases}-2\le k-1\\k+1\le 4\end{cases}}\Rightarrow {\begin{cases}-1\le k\\k\le 3\end{cases}}\Rightarrow -1\le k\le 3$.