6. Let $x_{1}$ be the greatest negative root of the equation $\sqrt{3} \sin x-3 \cos x=2 a-1$, and $x_{2}$ be the smallest positive root of the equation $2 \cos ^{2} x-2 \sin ^{2} x=a$. Then, the range of real numbers $a$ for which the inequality $\left|x_{1}\right| \leqslant x_{2}$ holds is . $\qquad$
6. $\frac{1}{2}-\sqrt{3} \leqslant a \leqslant-1$ or $a=2$.

The equation $\sqrt{3} \sin x-3 \cos x=2 a-1$ is equivalent to
$\sin \left(x-\frac{\pi}{3}\right)=\frac{2 a-1}{2 \sqrt{3}}$.
From $-1 \leqslant \frac{2 a-1}{2 \sqrt{3}} \leqslant 1$, we get
$$
\frac{1}{2}-\sqrt{3} \leqslant a \leqslant \frac{1}{2}+\sqrt{3} \text {. }
$$

Solving (1), the maximum negative root is
$$
x_{1}=\left\{\begin{array}{l}
\frac{\pi}{3}+\arcsin \frac{2 a-1}{2 \sqrt{3}}\left(\frac{1}{2}-\sqrt{3} \leqslant a<-1\right) . \\
-\frac{2 \pi}{3}-\arcsin \frac{2 a-1}{2 \sqrt{3}}\left(-1 \leqslant a \leqslant \frac{1}{2}+\sqrt{3}\right) .
\end{array}\right.
$$

Its graph is shown in the figure, located below the $a$ axis.
The equation $2 \cos ^{2} x-2 \sin ^{2} x=a$ is equivalent to
$\cos 2 x=\frac{a}{2}$.
From $-1 \leqslant \frac{a}{2} \leqslant 1$, we get $-2 \leqslant a \leqslant 2$.
The smallest positive root of (2) is
$$
x_{2}=\left\{\begin{array}{l}
\frac{1}{2} \arccos \frac{a}{2}(-2 \leqslant a<2), \\
\pi(a=2) .
\end{array}\right.
$$

Its graph is shown in the figure, located above the $a$ axis.
Comparing the two graphs, it is not difficult to see that the necessary and sufficient condition for $\left|x_{1}\right| \leqslant x_{2}$ is $\frac{1}{2}-\sqrt{3} \leqslant a \leqslant-1$ or $a=2$.