4. The trajectory equation of the moving point in the complex plane
$$
\begin{aligned}
& Z\left(\frac{\cos \theta-\sin \theta}{\cos \theta+\sin \theta}, \frac{2}{\cos \theta+\sin \theta}\right)(\theta \in \mathbf{R}, \theta \\
\neq & \left.k \pi+\frac{3 \pi}{4}, k \in \mathbf{Z}\right)
\end{aligned}
$$

is
4. $\frac{y^{2}}{2}-x^{2}=1$.

Notice that $x^{2}=\frac{1-\sin 2 \theta}{1+\sin 2 \theta}, y^{2}=\frac{4}{1+\sin 2 \theta}$. Then $\frac{y^{2}}{2}-x^{2}=1$.