$$f(x)=(x-1)^2(x-2)+1$$ Find the real values of $P$ for which $f(x)=P$ has exactly one solution.
Hi, I'm a little bit confused with this question.I don't know how I should start. I think I need to use the quadratic formula but I don't know if it gives me the right answer. Can you help me with this question?

We need $(x-1)^2(x-2) = P-1$ to have exactly one real root. The LHS has a double root at $1$ and a single root at $2$, and is increasing otherwise. Hence as long as $P-1$ does not cross the LHS in this interval, it will always have only a real root.
Therefore the only values $P-1$ cannot take is the range of $(x-1)^2(x-2)$ when $x \in [1, 2]$. This is easily found to be $[-\frac4{27}, 0]$, either using calculus or the AM-GM: $$\frac14(x-1)^2(2-x) \le \left( \frac{\frac{x-1}2+\frac{x-1}2+2-x}3\right)^3=\frac1{27}$$