4. Let $S_{n}$ be the sum of the first $n$ terms of a geometric sequence. If $x=S_{n}^{2}+S_{2 n}^{2}, y=S_{n}\left(S_{2 n}+S_{3 n}\right)$, then $x-y(\quad)$.
(A) is 0
(B) is a positive number
(C) is a negative number
(D) is sometimes positive and sometimes negative
4. A.

Let the geometric sequence be $\left\{a_{n}\right\}$, with the common ratio $q$. Then
$$
\begin{array}{l}
S_{n}=a_{1}+a_{2}+\cdots+a_{n}, \\
S_{2 n}=S_{n}+a_{n+1}+a_{n+2}+\cdots+a_{2 n} \\
=S_{n}+q^{n}\left(a_{1}+a_{2}+\cdots+a_{n}\right) \\
=S_{n}+q^{n} S_{n}=S_{n}\left(1+q^{n}\right), \\
S_{3 n}=S_{2 n}+a_{2 n+1}+a_{2 n+2}+\cdots+a_{3 n} \\
=S_{2 n}+q^{2 n}\left(a_{1}+a_{2}+\cdots+a_{n}\right) \\
=S_{n}\left(1+q^{n}\right)+q^{2 n} S_{n}=S_{n}\left(1+q^{n}+q^{2 n}\right) .
\end{array}
$$
$$
\begin{array}{l}
\text { Hence } x=S_{n}^{2}+S_{2 n}^{2}=S_{n}^{2}+\left[S_{n}\left(1+q^{n}\right)\right]^{2} \\
=S_{n}^{2}\left[1+\left(1+q^{n}\right)^{2}\right]=S_{n}^{2}\left(2+2 q^{n}+q^{2 n}\right), \\
y=S_{n}\left(S_{2 n}+S_{3 n}\right) \\
=S_{n}\left[S_{n}\left(1+q^{n}\right)+S_{n}\left(1+q^{n}+q^{2 n}\right)\right] \\
=S_{n}^{2}\left[\left(1+q^{n}\right)+\left(1+q^{n}+q^{2 n}\right)\right] \\
=S_{n}^{2}\left(2+2 q^{n}+q^{2 n}\right)=x .
\end{array}
$$