Let $f(x)=x^2-2px+p^2-1$, then find the condition when exactly one root of given quadratic equation lies in the interval $\left(-2,4\right)$
My attempt is as follows:
$$x^2-2px+p^2-1=0$$ $$\left(x-p\right)^2=1$$ $$x=p-1,p+1 $$
Case 1: Only $p-1$ will lie in the interval $\left(-2,4\right)$ if $-2<p-1<4<=p+1$. Solving this would give $p\in \left[3,5\right)$
Case 2: Only $p+1$ will lie in the interval $\left(-2,4\right)$ if $p-1<=-2<p+1<4$. Solving this would give $p\in \left(-3,-1\right]$
Taking union of case 1,case 2 would give $p\in (-3,-1] \cup [3,5)$
But actual answer is $p\in (-3,-1) \cup (3,5)$
I don't understand what mistake am I doing here?
Your solution is correct and the provided one is wrong. To check yourself, the only place your solution differs is in the $p$ values of $-1$ and $3$. Substituting, we get the equations $x(x+2)=0$ and $(x-4)(x-2)=0$ respectively, both of which satisfy the condition.