We first calculate the auxiliary polynomials:
\(p_1(x)=\frac{(x-1)(x-2)}{(-1-1)(-1-2)}=\frac{x^2-3x+2}{6}\),
\(p_2(x)=\frac{(x-(-1))(x-2)}{(1-(-1))(1-2)}=\frac{-x^2+x+2}{2}\),
\(p_3(x)=\frac{(x-(-1))(x-1)}{(2-(-1))(2-1)}=\frac{x^2-1}{3}\).
Then we combine them in the desired polynomial:
\(p(x)=-9p_1(x)-3p_2(x)+3p_3(x)\).