\(\Delta'=\left(m+2\right)^2-\left(m^2-3m-2\right)=7m+6>0\Rightarrow m>-\frac{6}{7}\)
Khi đó theo Viet: \(\left\{{}\begin{matrix}x_1+x_2=2\left(m+2\right)\\x_1x_2=m^2-3m-2\end{matrix}\right.\)
\(A=2018+3x_1x_2-\left(x_1^2+x_2^2\right)=2018+3x_1x_2-\left(x_1+x_2\right)^2+2x_1x_2\)
\(A=2018+5x_1x_2-\left(x_1+x_2\right)^2\)
\(A=2018+5m^2-15m-10-4m^2-16m-16\)
\(A=m^2-31m+1992\)
\(A=m^2-2.\frac{31}{2}m+\frac{961}{4}+\frac{7007}{4}\)
\(A=\left(m-\frac{31}{2}\right)^2+\frac{7007}{4}\ge\frac{7007}{4}\)
\(\Rightarrow A_{min}=\frac{7007}{4}\) khi \(m=\frac{31}{2}\)