\(\left(a^2+b^2-5\right)^2-4\left(ab+2\right)^2\)
\(=\left(a^2+b^2-5\right)^2-\left(2ab+4\right)^2\)
\(=\left(a^2+b^2-5-2ab-4\right)\left(a^2+b^2-5+2ab+4\right)\)
\(=\left[\left(a-b\right)^2-9\right]\left[\left(a+b\right)^2-1\right]\)
\(=\left(a-b-3\right)\left(a-b+3\right)\left(a+b+1\right)\left(a+b-1\right)\)
\(=\left(a^2+b^2-5\right)^2-\left(2ab+4\right)^2\)
\(=\left(a^2+b^2-5-2ab-4\right)\left(a^2+b^2-5+2ab+4\right)\)
\(=\left(a^2-2ab+b^2-9\right)\left(a^2+2ab+b^2-1\right)\)
\(=\left[\left(a-b\right)^2-9\right]\left[\left(a+b\right)^2-1\right]\)
\(=\left(a-b-3\right)\left(a-b+3\right)\left(a+b-1\right)\left(a+b+1\right)\)