Giải:
Áp dụng BĐT \(\left|a\right|-\left|b\right|\le\left|a-b\right|\) ta có:
\(\left|x-1004\right|-\left|x+1003\right|\le\left|x-1004-x-1003\right|=2007\)
Dấu "=" xảy ra khi \(\Leftrightarrow x=-1013\)
Vậy \(MAX_A=2007\) tại \(x=-1013\)
Ta có:
\(\left|x-1004\right|-\left|x+1003\right|\le\left|x-1004-x+1003\right|\)
hay \(A\le\left|-1\right|\)
\(\Rightarrow A\le1\)
Dấu "=" xảy ra \(\Leftrightarrow\left[{}\begin{matrix}\left\{{}\begin{matrix}x-1004\ge0\\x+1003\ge0\end{matrix}\right.\\\left\{{}\begin{matrix}x-1004\le0\\x+1003\le0\end{matrix}\right.\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}\left\{{}\begin{matrix}x\ge1004\\x\le1003\end{matrix}\right.\\\left\{{}\begin{matrix}x\le1004\\x\ge1003\end{matrix}\right.\end{matrix}\right.\)
TH1: \(\left\{{}\begin{matrix}x\ge1004\\x\le1003\end{matrix}\right.\)
=> vô lí.
TH2: \(\left\{{}\begin{matrix}x\le1044\\x\ge1003\end{matrix}\right.\)
\(\Rightarrow2013\le x\le2014\) (thỏa mãn)
Vậy với \(2013\le x\le2014\) thì A đạt GTLN và khi dó A=1.