5. In the expansion of $(\sqrt{x}+2)^{2 n+1}$, the sum of the coefficients of the terms where the exponent of $x$ is an integer is
$$
\text { 5. } \frac{1}{2}\left(3^{2 n+1}+1\right) \text {. }
$$

The $(r+1)$-th term in the expansion is
$$
T_{r+1}=\mathrm{C}_{2 n+1}^{r} x^{\frac{2 n+1-r}{2}} \cdot 2^{r} \text {. }
$$

Since the exponent of $x$ is an integer, $r$ must be odd. Let
$$
S=\mathrm{C}_{2 n+1}^{1} \cdot 2+\mathrm{C}_{2 n+1}^{3} \cdot 2^{3}+\mathrm{C}_{2 n+1}^{5} \cdot 2^{5}+\cdots+\mathrm{C}_{2 n+1}^{2 n+1} \cdot 2^{2 n+1} \text {. }
$$

Because $(1+2)^{2 n+1}$
$$
\begin{array}{l}
=\mathrm{C}_{2 n+1}^{0}+\mathrm{C}_{2 n+1}^{1} \cdot 2+\mathrm{C}_{2 n+1}^{2} \cdot 2^{2}+\cdots+\mathrm{C}_{2 n+1}^{2 n+1} \cdot 2^{2 n+1}, \\
(1-2)^{2 n+1} \\
=\mathrm{C}_{2 n+1}^{0}-\mathrm{C}_{2 n+1}^{1} \cdot 2+\mathrm{C}_{2 n+1}^{2} \cdot 2^{2}-\cdots-\mathrm{C}_{2 n+1}^{2 n+1} \cdot 2^{2 n+1},
\end{array}
$$

Subtracting the two equations gives $2 S=3^{2 n+1}-(-1)^{2 n+1}=3^{2 n+1}+1$. Therefore, $S=\frac{1}{2}\left(3^{2 n+1}+1\right)$.