\(x+y+xy=40\)
\(x\left(1+y\right)+y=40\)
\(\left(x+1\right)\left(y+1\right)=41\)
Vì 41 là số nguyên tố nên xảy ra các trường hợp:
\(\left\{{}\begin{matrix}\left\{{}\begin{matrix}x+1=1\\y+1=41\end{matrix}\right.\\\left\{{}\begin{matrix}x+1=41\\y+1=1\end{matrix}\right.\\\left\{{}\begin{matrix}x+1=-1\\y+1=-41\end{matrix}\right.\\\left\{{}\begin{matrix}x+1=-41\\y+1=-1\end{matrix}\right.\end{matrix}\right.\Rightarrow\left\{{}\begin{matrix}\left\{{}\begin{matrix}x=0\\y=40\end{matrix}\right.\\\left\{{}\begin{matrix}x=40\\y=0\end{matrix}\right.\\\left\{{}\begin{matrix}x=-2\\y=-42\end{matrix}\right.\\\left\{{}\begin{matrix}x=-42\\y=-2\end{matrix}\right.\end{matrix}\right.\)