this is the expansion
Distribute sum groups
{x}^{2}(x-3)-3x(x-3)-4(x-3)x2(x−3)−3x(x−3)−4(x−3)
Distribute
{x}^{3}-3{x}^{2}-3x(x-3)-4(x-3)x3−3x2−3x(x−3)−4(x−3)
Distribute
{x}^{3}-3{x}^{2}-(3{x}^{2}-9x)-4(x-3)x3−3x2−(3x2−9x)−4(x−3)
even more Distribute
{x}^{3}-3{x}^{2}-(3{x}^{2}-9x)-(4x-12)x3−3x2−(3x2−9x)−(4x−12)
Simplify brackets
{x}^{3}-3{x}^{2}-3{x}^{2}+9x-4x+12x3−3x2−3x2+9x−4x+12
Collect like terms
{x}^{3}+(-3{x}^{2}-3x2)+(9x−4x)+12
now you just Simplify
therefor, it is
x^3-6x^2+5x+12