17. (12 points) Given vectors
$$
\begin{array}{l}
\boldsymbol{a}=\left(\cos \frac{3}{2} x, \sin \frac{3}{2} x\right), \\
\boldsymbol{b}=\left(\cos \frac{x}{2},-\sin \frac{x}{2}\right), \text { and } x \in\left[\frac{\pi}{2}, \frac{3 \pi}{2}\right] .
\end{array}
$$
(1) Find the range of $|a+b|$;
(2) Find the minimum value of the function $f(x)=\boldsymbol{a} \cdot \boldsymbol{b}-|\boldsymbol{a}+\boldsymbol{b}|$ and the value of $x$ at which this minimum occurs.
17. (1) Since $x \in\left[\frac{\pi}{2}, \frac{3 \pi}{2}\right]$, therefore, $-1 \leqslant \cos 2 x \leqslant 1$.

Also, $|\boldsymbol{a}+\boldsymbol{b}|=\sqrt{2+2 \cos 2 x}$, then $0 \leqslant|\boldsymbol{a}+\boldsymbol{b}| \leqslant 2$.
(2) Since $x \in\left[\frac{\pi}{2}, \frac{3 \pi}{2}\right]$, therefore, $-1 \leqslant \cos x \leqslant 0$.
$$
\begin{array}{l}
\text { Also, } f(x)=\boldsymbol{a} \cdot \boldsymbol{b}-|\boldsymbol{a}+\boldsymbol{b}|=\cos 2 x-\sqrt{2+2 \cos 2 x} \\
=2 \cos ^{2} x-1-\sqrt{4 \cos ^{2} x}=2 \cos ^{2} x+2 \cos x-1,
\end{array}
$$

Therefore, when $\cos x=-\frac{1}{2}$, i.e., $x=\frac{2 \pi}{3}$ or $x=\frac{4 \pi}{3}$, $f(x)=\boldsymbol{a} \cdot \boldsymbol{b}-|\boldsymbol{a}+\boldsymbol{b}|$ takes the minimum value $-\frac{3}{2}$.