Explanation:
There is 1 root at x = 1, where the function crosses the x-axis.
There are 2 roots at x = -2, where the function touches the x-axis but does not cross.
So there are 3 real roots total.
The function is:
y = (x − 1) (x − (-2))²
y = (x − 1) (x + 2)²