f (x)={cx+d     for  x≤2

{-x^2−cx    for  x>2
Let f be the function defined above, where c and d are constants. If f is differentiable at x=2, what is the value of c+d  ?

-4, -2, 0, 2, 4

1 answer

you need f and f' to be continuous
lim(x→2-) f'(x) = c
lim(x→2+) f'(x) = -4-c
So, you need c = -4-c => c = -2

lim(x→2-) f(x) = 2c+d = -4+d
lim(x→2+) f(x) = -4+4 = 0
so, -4+d = 0 => d=4

S, f(x) =
{-2x+4 for x≤2
{-x^2+2x for x>2

See the graphs at

https://www.wolframalpha.com/input/?i=plot+y%3D-2x%2B4%2C+2x-x%5E2