a: \(x^3-6x-9\)
\(=x^3-9x+3x-9\)
\(=x\left(x^2-9\right)+3\left(x-3\right)\)
\(=x\left(x-3\right)\left(x+3\right)+3\left(x-3\right)\)
\(=\left(x-3\right)\left(x^2+3x+3\right)\)
b: \(x^4-5x^2+4\)
\(=x^4-4x^2-x^2+4\)
\(=x^2\left(x^2-4\right)-\left(x^2-4\right)\)
\(=\left(x^2-4\right)\left(x^2-1\right)\)
\(=\left(x-2\right)\left(x+2\right)\left(x-1\right)\left(x+1\right)\)