a: Ta có: \(\left(a^2-1\right)^3-\left(a^4+a^2+1\right)\left(a^2-1\right)\)
\(=a^6-3a^4+3a^2-1-\left(a^6-1\right)\)
\(=-3a^4+3a^2\)
b: Ta có: \(\left(a^4-3a^2+9\right)\left(a^2+3\right)-\left(a^2+3\right)^3\)
\(=a^6+27-a^6-9a^4-27a^2-27\)
\(=-9a^4-27a^2\)