6. For the complex number $x$, the minimum value of the expression $u=|x|+|x-i|+|x-\sqrt{3}|$ is $\qquad$ .
6. $\sqrt{7}$.

Let $\omega=-\frac{1}{2}+\frac{\sqrt{3}}{2} i$, then
$$
\omega^{2}=-\frac{1}{2}-\frac{\sqrt{3}}{2} i, 1+\omega+\omega^{2}=0 .
$$

We get
$$
\begin{aligned}
u & =|x|+|x-i||\omega|+|x-\sqrt{3}|\left|\omega^{2}\right| \\
& =|x|+|(x-i) \omega|+\left|(x-\sqrt{3}) \omega^{2}\right| \\
& \geqslant\left|x+(x-i) \omega+(x-\sqrt{3}) \omega^{2}\right| \\
& =\left|x\left(1+\omega+\omega^{2}\right)-\left(i \omega+\sqrt{3} \omega^{2}\right)\right| \\
& =|\omega||i+\sqrt{3} \omega|=\left|-\frac{\sqrt{3}}{2}+\frac{5}{2} i\right| \\
& =\sqrt{\frac{3}{4}+\frac{25}{4}}=\sqrt{7} .
\end{aligned}
$$

Equality holds if and only if
$$
x,(x-i) \omega,(x-\sqrt{3})
$$
$\omega^{2}$ are collinear in the same direction, i.e., the vectors corresponding to the complex numbers $x$, $x-i$, $x-\sqrt{3}$ form angles of $120^{\circ}$ with each other, at which point $u$ attains its minimum value $\sqrt{7}$.

The geometric meaning of this is, for a right triangle $\triangle A O B$ in the complex plane, where $A(0,1), O(0, 0), B(\sqrt{3}, 0)$, find a point $P$ such that the sum of the distances to the three vertices is minimized (as shown in Figure 5).
$$
u=|A P|+|B P|+|O P|,
$$

It is easy to see that $P$ is the Fermat point of the triangle when the minimum value $\sqrt{7}$ is achieved.