Ta có : \(\left|2004-x\right|+\left|2003-x\right|\)
\(\Rightarrow\left|2004-x\right|+\left|2003-x\right|\ge\left|2004-x+x-2003\right|=1\)
Dấu \("="\) xảy ra \(\Leftrightarrow\left(2004-x\right).\left(x-2003\right)\ge0\)
\(\Rightarrow\left[\begin{array}{nghiempt}\hept{\begin{cases}2004-x\ge0\\x-2003\ge0\end{array}\right.\\\hept{\begin{cases}2004-x\le0\\x-2003\le0\end{array}\right.\end{array}\right.\)
\(\Rightarrow\left[\begin{array}{nghiempt}\hept{\begin{cases}x\le2004\\x\ge2003\end{array}\right.\\\hept{\begin{cases}x\ge2004\\x\le2003\end{array}\right.\end{array}\right.\)
\(\Rightarrow2003\le x\le2004\)
Vậy : Giá trị nhỏ nhất của \(D=1\Leftrightarrow2003\le x\le2004\)