Do \(a^2+5⋮a^2+2\) nên \(\frac{a^2+5}{a^2+2}\)\(\in Z\)
Đặt A=\(\frac{a^2+5}{a^2+2}\)
Suy ra A=\(\frac{a^2+2+3}{a^2+2}=1+\frac{3}{a^2+2}\)
Để \(A\in Z\)thì 3\(⋮a^2+2\)
Do đó \(a^2+2\inƯ\left(3\right)\)\(\Rightarrow a^2+2\in\left\{1;3;-1;-3\right\}\)
\(\Rightarrow a^2\in\left\{-1;1;-3;-5\right\}\)\(\Rightarrow a^2\in\left\{1\right\}\)\(\Rightarrow a\in\left\{1;-1\right\}\)