\(M=1-\dfrac{2}{x}+\dfrac{2012}{x^2}=2012\left(\dfrac{1}{x^2}-2.\dfrac{1}{2012}.\dfrac{1}{x}+\dfrac{1}{2012^2}\right)+\dfrac{2011}{2012}\)
\(M=2012\left(\dfrac{1}{x}-\dfrac{1}{2012}\right)^2+\dfrac{2011}{2012}\ge\dfrac{2011}{2012}\)
\(\Rightarrow M_{min}=\dfrac{2011}{2012}\) khi \(\dfrac{1}{x}-\dfrac{1}{2012}=0\Rightarrow x=2012\)