Ta có:
\(a.b=BCNN\left(a,b\right)\times UCLN\left(a,b\right)\\ \Rightarrow a.b=420.21=8820^{\left(1\right)}\)
Từ \(a+21=b\Rightarrow a=b-21^{\left(2\right)}\)
Thay \((2)\) vào \((1)\) ta được:
\(a.b=b.\left(b-21\right)=8820\\ \Rightarrow b^2-21b=8820\\ \Rightarrow b^2-21b-8820=0\\ \Rightarrow b^2+84b-105b-8820=0\\ \Rightarrow b\left(b+84\right)-105\left(b+84\right)=0\\ \Rightarrow\left(b+84\right).\left(b-105\right)=0\\ \Rightarrow\left[{}\begin{matrix}b+84=0\\b-105=0\end{matrix}\right.\Rightarrow\left[{}\begin{matrix}b=-84\\b=105\end{matrix}\right.\\ \Rightarrow\left[{}\begin{matrix}a=b-21\\b=b-21\end{matrix}\right.\Rightarrow\left[{}\begin{matrix}a=-84-21=-105\\a=105-21=84\end{matrix}\right.\)
Vậy a=84 hoặc a= -105
b= -84 hoặc b=105