\(A=\left(x^2+nx+m\right)^2\Rightarrow x^4+2nx^3+\left(n^2+2m\right)x^2+2mnx+m^2\\ \)
\(\Rightarrow\hept{\begin{cases}m^2=1\\2n=-6\end{cases}\Rightarrow\hept{\begin{cases}m=+-1\\n=-3\end{cases}}}\)
\(\hept{\begin{cases}a=7\\b=6\end{cases}}hoac\hept{\begin{cases}a=11\\b=-6\end{cases}}\)