d)\(D=\left|x-1\right|+\left|x-2\right|+\left|x-3\right|+\left|x-4\right|\)
\(=\left|x-1\right|+\left|x-2\right|+\left|3-x\right|+\left|4-x\right|\)
\(\ge x-1+x-2+3-x+4-x=4\)
Dấu "=" khi \(\begin{cases}x-1\ge0\\x-2\ge0\\3-x\ge0\\4-x\ge0\end{cases}\)\(\Rightarrow\begin{cases}x\ge1\\x\ge2\\x\le3\\x\le4\end{cases}\)\(\Rightarrow2\le x\le3\)
Vậy \(Min_D=4\) khi \(2\le x\le3\)