Counting Gaussian integers with an angle condition Consider elements $x,z \in \mathbb{Z}[i]$, the Gaussian integers. Let $S(T_1, T_2)$ be the subset of $\mathbb{Z}[i] \times \mathbb{Z}[i]$ consisting of those elements $(x,z)$ such that $T_1 < |x| \leq  2T_1, T_2 < |z| \leq 2T_2$. I want to estimate the cardinality of the set 
$$\displaystyle S_k(T_1, T_2) =\{(x,z) \in S(T_1, T_2) : \left \lvert \Re(xz^k) \right \rvert \leq M \}, k \geq 2.$$
Note that if $M$ is close in size to $T_1 T_2^k$, then the restriction that $\lvert \Re(xz^k) \rvert \leq M$ is hardly a restriction at all and the obvious bound of $|S(T_1, T_2)|$ will give the correct order of magnitude. However when $M$ is very small compared to $T_1 T_2^k$ then $|S_k(T_1, T_2)|$ should be substantially smaller than $|S(T_1, T_2)|$. 
If we write $x = r_1 e^{i \theta_1}$ and $z = r_2 e^{i \theta_2}$, then the condition $|\Re(xz^k)| \leq M$ can be written as $|r_1 r_2^k \cos(\theta_1 + k \theta_2)| \leq M$. If $M$ is small compared to $T_1 T_2^k$, then this is essentially saying that the angle $\theta_1 + k\theta_2 \pmod{\pi}$ is close to $\pi/2$. 
Is there a good way to estimate the size of $S_k(T_1, T_2)$? 
 A: If we consider $\mathbb{C}$ instead of $\mathbb{Z}[i]$, we can answer this well. In that case we are interested in the integral
$$\iiiint {\large\chi}\!\left[|r_1 r_2^k \cos(\theta_1 + k \theta_2)| \leq M\right](r_1 dr_1 d\theta_1)(r_2 dr_2 d\theta_2)$$
and the challenge is to do the integrations and the approximation in the right order.
We integrate first over $0 \le \theta_1 \le 2\pi$. Whatever the value of $\theta_2$, there are four ranges of $\theta$ in which the inequality holds, each of width $\frac{\pi}{2}-\arccos(M/r_1 r_2^k)$, or $\arcsin(M/r_1 r_2^k)$. So the integral reduces to
$$\iiint 4\arcsin(M/r_1 r_2^k) (r_1 dr_1)(r_2 dr_2 d\theta_2)$$
We then integrate over $0 \le \theta_2 \le 2\pi$ to get
$$\iint 8\pi\arcsin(M/r_1 r_2^k) (r_1 dr_1)(r_2 dr_2)$$
We integrate this over $T_1 \le r_1 \le 2 T_1$ to get
$$\int 4\pi r_2 T_1^2\ f(r_2^k T_1/M)\ dr_2,$$
$$f(u) = (4\arcsin{\frac1{2u}}+\sqrt{\frac{4}{u^2}-\frac{1}{u^4}})-(\arcsin{\frac1u}+\sqrt{\frac{1}{u^2}-\frac{1}{u^4}})$$
Since $f(u)\sim 5/(2u)$,
we can approximate the last integral over $T_2 < r_2 < 2T_2$ as
$$\int 4\pi r_2 T_1^2 \frac{5M}{2r_2^k T_1} dr_2$$
$$=\frac{2^{1-k}(2^k-4)}{k-2}5\pi M T_1 T_2^{2-k}$$
