\(x^2+2xy+y^2+2x+2y=8\)
\(\Leftrightarrow\left(x+y\right)^2+2\left(x+y\right)-8=0\)
\(\Leftrightarrow\left(x+y-2\right)\left(x+y+4\right)=0\)
\(\Rightarrow\left[{}\begin{matrix}x+y=2\\x+y=-4\end{matrix}\right.\) \(\Rightarrow\left[{}\begin{matrix}y=2-x\\y=-4-x\end{matrix}\right.\) thay vào pt ban đầu:
\(\left[{}\begin{matrix}x+3\left(2-x\right)=2018\\x+3\left(-4-x\right)=2018\end{matrix}\right.\)