9. When $x \in[1,2017]$, find the minimum value of $f(x)=\sum_{i=1}^{2017} i|x-i|$
9. 801730806 (i.e., $f(1427)$)

Analysis: When $k \leq x \leq k+1$, $k=1,2, \ldots, 2016$
$$
\begin{array}{l}
f(x)=\sum_{i=1}^{k} i(x-i)+\sum_{i=k+1}^{2017} i(i-x)=\left(\sum_{i=1}^{k} i-\sum_{i=k+1}^{2017} i\right) x-\sum_{i=1}^{k} i^{2}+\sum_{i=k+1}^{2017} i^{2} \\
=(k(k+1)-2017 \times 1009) x+\sum_{i=k+1}^{2017} i^{2}-\sum_{i=1}^{k} i^{2}
\end{array}
$$

Clearly, $f(x)$ is a linear function on $k \leq x \leq k+1$, so $f(x)$ takes its minimum value when $x=k$ or $x=k+1$. Therefore, the minimum value of $f(x)$ is achieved at some (or several) $x=k$, where $k \in\{1,2, \ldots, 2017\}$.

When $k \leq x \leq k+1$, $f(x)=(k(k+1)-2017 \times 1009) x+\sum_{i=k+1}^{2017} i^{2}-\sum_{i=1}^{k} i^{2}$, it is known that $f(k) < 0$ when $k < 1427$; $f(k) > 0$ when $k \geq 1427$. Therefore, $f(k) < f(k+1) \Leftrightarrow k(k+1)-2017 \times 1009 < 0$, i.e., $k < 1427$; $f(k) > f(k+1) \Leftrightarrow k(k+1)-2017 \times 1009 > 0$, i.e., $k \geq 1427$. Thus, $f(1) > f(2) > \ldots > f(1426) > f(1427)$, and $f(1427) < f(1428) < \ldots < f(2017)$. Therefore, the minimum value of $f(x)$ is $f(1427)$, substituting into the linear function yields $f(1427)=801730806$.