Ta có : \(\frac{a^4-3a^2+1}{a^4-a^2-2a-1}\) \(=\frac{\left(a^4-2a^2+1\right)-a^2}{\left(a^4-a^3-a^2\right)+\left(a^3-a^2-a\right)+\left(a^2-a-1\right)}\)
\(=\frac{\left(a^2-1\right)^2-a^2}{a^2\left(a^2-a-1\right)+a\left(a^2-a-1\right)+\left(a^2-a-1\right)}\)
\(=\frac{\left(a^2-a-1\right)\left(a^2+a-1\right)}{\left(a^2-a-1\right)\left(a^2+a+1\right)}\)
\(=\frac{a^2+a-1}{a^2+a+1}\)