Prove that if $ {(x-a)^{2}}$ is a factor of the polynomial $\mathrm p(x)$, then $\mathrm p'(a)=0$. Prove a corresponding result if $(x-a)^4$ is a factor of $\mathrm p(x).$ Given that the polynomial
$$
x^6+4x^5-5x^4-40x^3-40x^2+32x+k
$$
has a factor of the form $ {(x-a)}^4$, find $k$.