Answer:
let the polynomial be
f(x)=x³+2kx+2
is divided by
g(x)=x+2
hence
(x+2) is a factor of f(x)
so comparing with x-a we get a=-2
so
f(a)=0
f(-2)=(-2)³+2*-2*k+2
0=-8-4K+2
4k=-6
K=-6/4
k=-3/2
again
when divided by x+1
g(x)=x+1
hence
x+1 is a factor
so a=-1
f(-1)=-(1)³+2*-1*k+2
0=-1-2k+2
0=1-2k
k=1/2
The value of k is 1/2 when divided by x+1
and
K =-3/2 when divided by x+2