\(\left(3x-1\right)^2+2\left(9x^2-1\right)+\left(3x+1\right)^2\)
\(=9x^2-6x+1+18x^2+2+9x^2+6x+1\)
\(=36x^2+4\)
\(\left(x^2-1\right)\left(x+3\right)-\left(x-3\right)\left(x^3+3x+9\right)\)
\(=x^3+3x^2-x+3-\left(x^4+3x^2+9x-3x^3-9x-27\right)\)
\(=x^3+3x^2-x+3-x^4-3x^2-9x+3x^3+9x-27\)
\(=\left(3x^2-3x^2\right)+\left(9x-9x\right)-x-\left(27-3\right)+x^3-x^4+3x^3\)
\(=-x-24+x^3-x^4+3x^3\)
\(\left(x+4\right)\left(x-4\right)-\left(x-4\right)^2\)
\(=x^2-16-\left(x-4\right)^2\)
\(=x^2-16-x^2+8x-16\)
\(=8x-32\)