Let P(x)=ax3+bx2+cx+d be a cubic polynomial with P(−3)=0. Since P has a local minimum at x=1 and a local maximum at x=−1, we need P′(1)=0 and P′(−1)=0, where P′(x)=3ax2+2bx+c.
From P′(1)=3a+2b+c=0 and P′(−1)=3a−2b+c=0, subtracting gives 4b=0, so b=0. Then c=−3a. With b=0, the polynomial is P(x)=ax3−3ax+d.
Applying P(−3)=0: a(−27)−3a(−3)+d=−27a+9a+d=−18a+d=0, so d=18a. Thus P(x)=a(x3−3x+18).
Now we use ∫−11P(x)dx=18. Since x3 and x are odd functions, their integrals over [−1,1] vanish, leaving ∫−1118adx=18a⋅2=36a=18, giving a=21.
The sum of all coefficients of P(x) is P(1)=21(1−3+18)=216=8.