If a function is convex, then the second derivative is positive:

f"(x)>0

If a function is concave, then the second derivative is negative:

f"(x)<0

To determine if the second derivative is negative or positive, we'll have to calculate, for the beginning, the first derivative:

f'(x) = [(x-1)*(x+2)^3]'

Since the function is a product, we'll differentiate using the rule of product:

(u*v)' = u'*v + u*v'

We'll put u = x-1

u' = (x-1)'

u' = 1

v = (x+2)^3

v' = 3*[(x+2)^2]*(x+2)'

v' = 3*[(x+2)^2]

f'(x) = (x+2)^3 + 3(x-1)*[(x+2)^2]

f"(x) = 3(x+2)^2 + 3(x+2)^2 + 3(x-1)*2(x+2)

f"(x) = 6(x+2)^2 + 6(x+2)(x-1)

We'll factorize by 6(x+2):

f"(x) = 6(x+2)(x+2+x-1)

f"(x) = 6(x+2)(x+1)

Now, we'll put f"(x) = 0:

6(x+2)(x+1) = 0

We'll put x + 2 = 0

x1 = -2

x+1 = 0

x2 = -1

Between x = -2 and x = -1, f"(x) is negative, and between (-infinite;-2) and (-1;+infinite), f"(x) is positive.

The function is convex for x over the intervals (-infinite;-2) and (-1;+infinite), and f(x) is concave for x between (-2 , -1).