\(A=\left(x+3\right)^2+\left(x-3\right)\left(x+3\right)-2\left(x^2+2\right)\left(x-4\right)=x^2+6x+9+x^2-9-2\left(x^3-4x^2+2x-8\right)=2x^2+6x-2x^3+8x^2-4x+16=-2x^3+10x^2+2x+16\)
Ta có: \(A=\left(x+3\right)^2+\left(x-3\right)\left(x+3\right)-2\left(x^2+2\right)\left(x-4\right)\)
\(=x^2+6x+9+x^2-9-2\left(x^3-4x^2+2x-8\right)\)
\(=2x^2+6x-2x^3+8x^2-4x+16\)
\(=-2x^3+10x^2+2x+16\)