Let f(x)=ax^3+6x^2+bx+4. Determine the constants a and b so that f has a relative minimu at x=-1 and a relative maximumat x=2.

f ' (x) = 3ax^2 + 12x + b

given:
f ' (-1) = 0 ----> 3a -12 + b = 0 or 3a + b = 12
f ' (2) = 0 ----> 12a + 24 + b = 0 or 12a + b = -24
subtract them:
9a = -36
a = -4
back in 3a + b = 12
-12 + b = 12
b = 24

a = -4, b = 24

check:
f ' (x) = -12x^2 + 12x + 24
= 0 for a max/min
x^2 - x - 2 = 0
(x-2)(x+1)=0
x = 2 or x = -1 , yeahhhh!