a.\(\left(3x-1\right)\left(9x^2+3x+1\right)+\left(1-3x\right)^3-3x\left(9x-3\right)-\left(x+2\right)^3+x\left(x^2+6x+12\right)\)\(=27x^3-1+1^3-9x+27x^2-27x^3-27x^2+9x-x^3-6x^2-12x-8+x^3+6x^2+12x\)\(=\left(27x^3+1^3-27x^3-x^3+x^3\right)+\left(27x^2-27x^2-6x^2+6x^2\right)+\left(-9x+9x-12x+12x\right)+\left(-1-8\right)\)\(=1-9=8\)
b.
\(\left(2x-3\right)\left(x-2\right)\left(x+2\right)-2\left(x+3\right)^3-\left(x-4\right)^3+\left(x-3\right)\left(x^2+3x+9\right)+9x^2+110x\)\(=\left(2x-3\right)\left(x^2-4\right)-2\left(x^3+9x^2+27x\right)-\left(x^3-12x^2+48x-64\right)+x^3-27+9x^2+110x\)\(=2x^3-8x-3x^2+1-2x^3-18x^2-54x-x^3+12x^2-48x+64+x^3-27+9x^2+110x\)\(=\left(2x^3-2x^3-x^3+x^3\right)+\left(-3x^2-18x^2+2x^2+9x^2\right)+\left(-8x-54x-48x+110x\right)+\left(1+64-27\right)\)\(=38\)