\(2M=2a^2+2b^2-6a-6b+4002\)
\(=\left[\left(a^2+2ab+b^2\right)-4\left(a+b\right)+4\right]+\left(a^2-2a+1\right)+\left(b^2-2b+1\right)+3996\)
\(=\left(a+b-2\right)^2+\left(a-1\right)^2+\left(b-1\right)^2+3996\ge3996\)
\(\Rightarrow M\ge1998\)
Dấu = xảy ra khi \(a=b=1\)