7. The equation $\sum_{k=1}^{2 n+1} \cos ^{2} k x=n\left(n \in \mathbf{N}_{+}\right)$ has $\qquad$ solutions in $[0,2 \pi)$.
$$
\begin{array}{l}
7.8 n+2 . \\
\sum_{k=1}^{2 n+1} \cos ^{2} k x=n \\
\Leftrightarrow \sum_{k=1}^{2 n+1}(\cos 2 k x+1)=2 n \\
\Leftrightarrow \sum_{k=1}^{2 n+1} \cos 2 k x=-1 .
\end{array}
$$

Obviously, $x \neq t \pi(\iota \in \mathbf{Z})$. Then
$$
\begin{array}{l}
\sum_{k=1}^{2 n+1} \cos 2 k x=\operatorname{Re}\left(\sum_{k=1}^{2 n+1} \mathrm{e}^{\mathrm{i} 2 k x}\right) \\
=\operatorname{Re}\left(\frac{\mathrm{e}^{\mathrm{i} 2(2 n+2) x}-\mathrm{e}^{\mathrm{i} 2 x}}{\mathrm{e}^{\mathrm{i} 2 x}-1}\right) \\
=\operatorname{Re}\left\{\frac{[\cos (4 n+4) x-\cos 2 x]+\mathrm{i}[\sin (4 n+4) x-\sin 2 x]}{(\cos 2 x-1)+\mathrm{i} \sin 2 x}\right\} \\
=\operatorname{Re}\left\{\frac{\sin (2 n+1) x}{\sin x} \cdot \frac{-\sin (2 n+3) x+\mathrm{i} \cos (2 n+3) x}{-\sin x+\mathrm{i} \cos x}\right\} \\
=\operatorname{Re}\left[\frac{\sin (2 n+1) x}{\sin x} \cdot \mathrm{e}^{\mathrm{i}(2 n+2) x}\right] \\
=\frac{\sin (2 n+1) x}{\sin x} \cdot \cos (2 n+2) x \\
=\frac{\sin (4 n+3) x-\sin x}{2 \sin x}=-1 .
\end{array}
$$

Thus, $\sin (4 n+3) x+\sin x=0$, which means
$$
\sin (2 n+2) x \cdot \cos (2 n+1) x=0 .
$$

Solving this, we get $x=\frac{s \pi}{2 n+2}(s=1,2, \cdots, 2 n+1,2 n+3,2 n+4, \cdots, 4 n+3)$ or $x=\frac{\left(t+\frac{1}{2}\right) \pi}{2 n+1}(t=0, 1, \cdots, 4 n+1)$. Among these, $\frac{s \pi}{2 n+2}=\frac{\left(t+\frac{1}{2}\right) \pi}{2 n+1} \Leftrightarrow \frac{s}{n+1}=\frac{2 t+1}{2 n+1}$ $\Leftrightarrow(s, t)=(n+1, n)$ or $(3 n+3,3 n+1)$. Therefore, equation (1) has $8 n+2$ solutions in $[0,2 \pi)$.
