4. 98 Find all integer solutions of the following equation:
$$\cos \left(\frac{\pi}{8}\left(3 x-\sqrt{9 x^{2}+160 x+800}\right)\right)=1 .$$
[Solution] Let $x$ be an integer solution of the original equation, then there must exist an integer $n$ such that
$$\frac{\pi}{8}\left(3 x-\sqrt{9 x^{2}+160 x+800}\right)=2 n \pi$$

i.e., $\square$
$$\begin{array}{l}
9 x^{2}+160 x+800=(3 x-16 n)^{2} \\
x(3 n+5)=8 n^{2}-25
\end{array}$$

However,
Therefore,
$$8 n^{2}-25=\frac{8}{9}(3 n+5)(3 n-5)-\frac{25}{9}$$
$$\begin{array}{l}
x(3 n+5)=\frac{8}{9}(3 n+5)(3 n-5)-\frac{25}{9} \\
8(3 n+5)(3 n-5)-9 x(3 n+5)=25 \\
(3 n+5)(24 n-40-9 x)=25 \\
3 n+5 \in\{ \pm 1, \pm 5, \pm 25\}
\end{array}$$

Noting that $n$ is an integer, we get
$$n \in\{-2,0,-10\}$$

Substituting $n=-2$ into (1) gives $\quad x=-7$;
Substituting $n=0$ into (1) gives $\quad x=-5$;
Substituting $n=-10$ into (1) gives $\quad x=-31$.
Upon verification, $x=-5$ is an extraneous root. The integer solutions of the original equation are $x=-7$ or $x=-31$.