We can use a wave curve method. We are going to first find out the critical point. Critical points are those points where your expression becomes zero or undefined.
f(x) = (x+1)(x-2)(x-4)2
f(x) become zero at -1,2 and 4. We are going to plot these on number line.
-------(-1)------------(2)--------------------(4)---------------
We see that these critical points have divided the number line into 4 parts. Now we are going to check the sign of f(x) in each parts. You can chose any point less than -1 to check sign of f(x) in that area. lets chose -2. f(x) = (-2+1)(-2-2)(-2-4)2= positive number. Similar do that others.
-------(-1)------------(2)--------------------(4)---------------
+ - + +
Since we want f(x) >= 0. x ∈ (-infinity,-1]∪[2, infinity)
Similarly, you can do that second part. If
I hope this helps.