We will solve first for a by making it differentiable; then we can solve for b by making it continuous.
This is a very standard Calc AB question, by the way. The function is piecewise-defined, meaning it has different function rules for different intervals in the domain. Because each of those rules (in this case 2) is a continuous and differentiable function, we only need to look at the one value for x where the rule changes: x = - 2.
Start by taking the derivative of each rule: f'(x) = { 24x2 - 12x ; for x < - 2
a ; for x ≥ - 2
Now plug in x = - 2 in the top derivative rule and we get 120. (This is technically limx→-2-f'(x).) So a = 120.
Then we go back to the given function rules for f(x) and plug in x = - 2 and again set them = , to make the function continuous. When we plug - 2 in for x in the top rule we get - 86. So, 120x + b = - 86 when x = -2. So b = 154.