#abs(x^3-3x^2+2) = {(x^3-3x^2+2," if ", x^3-3x^2+2 > 0),(-(x^3-3x^2+2)," if ", x^3-3x^2+2 > 0):}#

We need to solve the inequalities.

First we solve:

#x^3-3x^2+2 = 0#

Using the rational zeros theorem or obsrving that the sum of the coefficients is #0#, we learn that #1# is a solution.

Therefore #x-1# is a factor. Use division or trial and error to factor and get

# (x-1)(x^2-2x-2) = 0#

The quadratic can be solved using the formula or completing the square. We get:

#x= 1-sqrt3#, #" "# #1#, #" "# #1+sqrt3#

Analyzing the sign, we get

#{: (bb"Interval:",(-oo,1-sqrt3),(1-sqrt3,1),(1,1+sqrt3),(1+sqrt3,oo)),
(darrbb"Factors"darr,"========","======","=====","======"),
(x-2, bb" -",bb" -",bb" +",bb" +"),
(x^2-2x-2,bb" +",bb" -",bb" -",bb" +"),
("==========","========","======","=====","======"),
(x^3-3x^2+2,bb" -",bb" +",bb" -",bb" +")
:}#

So we can write

#f(x) = abs(x^3-3x^2+2) = {(x^3-3x^2+2," if ", x < 1-sqrt3),(-(x^3-3x^2+2)," if ", 1-sqrt3 < x < 1),(x^3-3x^2+2," if ",1 < x < 1+sqrt3),(-(x^3-3x^2+2)," if ",1+sqrt3 < x):}#

Differentiating each piece yields

#f'(x) = {(3x^2-6x," if ", x < 1-sqrt3),(-3x^2+6x," if ", 1-sqrt3 < x < 1),(3x^2-6x," if ",1 < x < 1+sqrt3),(-3x^2+6x," if ",1+sqrt3 < x):}#

We can quickly see that #f'(x) = 0# at #0# and at #2#.

It takes a moment to realize that #f# is not differentiable at the three cut points. #x= 1-sqrt3#, #" "# #1#, #" "# #1+sqrt3#.

The derivative on the left and right of the cuts have opposite signs because they are not #0# at the cuts.

(We can actually calculate if you like, the left derivative at #1-sqrt3# is #6# and the right derivative is #-6#. So the (two-sided) derivative does not exist at this point.

The critical numbers are

#x= 1-sqrt3#, #" "# #1#, #" "# #1+sqrt3# #" "# (where #f'# does not exist)

and

#x=0#, #" "# #2# #" "# (where #f'# is #0#)