Find the values of $k$ such that the equation $x^3+x^2-x+2=k$ has three distinct real solutions Find the values of $k$ such that the equation 
$$x^3+x^2-x+2=k$$
has three distinct real solutions.
Please explain how to find the solution! Thanks
 A: Note that the $x$-coordinates of the stationary points satisfy $3x^2 + 2x - 1 = 0$ which factorises as $(3x-1)(x+1) =0$. 
So the stationary points are $(-1, 3)$ (a local maxima) and $(1/3, 49/27)$ (a local minimum). The nature of these stationary points are easily found by examining the sign of the derivative around it or looking at the second derivative. 
A quick sketch now show that the horizontal line $y=k$ will only intersect the curve thrice if it lies strictly between the two extrema. So $\frac{49}{27} < k < 3$. 
A: We can sketch the graph $y=x^3+x^2-x+2$ as below (I used WolframAlpha):

Now we imagine drawing horizontal lines across this graph (setting $y=k$ in the original equation)
We can see that the only points where the line crosses the equation exactly three times are any points where $$y\text{ value of minimum point}<k<y\text{ value of maximum point}$$
Therefore, to solve the problem, we must calculate the turning points of the graph $y=x^3+x^2-x+2$
We do this by computing the derivative first:
$$y'=3x^2+2x-1$$
We then set this equal to zero to find turning points of the graph
\begin{align}3x^2+2x-1&=0\\
(x+1)(3x-1)&=0\end{align}
Therefore we have turning points at $x=-1$ and $x=\frac 13$
We can then find the $y$ co-ordinates of these points by substiuting them back into the equation:
When $x=-1$, \begin{align}y&=(-1)^3+(-1)^2-(-1)+2\\
&=-1+1+1+2\\
&=3\end{align}
When $x=\frac 13$, \begin{align}y&=\left(\frac13\right)^3+\left(\frac13\right)^2-\frac13+2\\
&=\frac 1{27}+\frac 19-\frac 13+2\\
&=\frac{49}{27}\end{align}
We know that $\frac{49}{27}<3$ and therefore we can say that $$\frac{49}{27}<k<3$$
