Diophantine equations and 'quasi-paucity' Let $X,Y \geq 1$. I am interested in the number of solutions of the following diophantine equations:
$$S_1\colon \, \, x_1y_1^3 = x_2 y_2^3 $$
Let $N_1(X,Y) $ denote the number of solutions to $S_1$ with $1\leq x_i \leq X$ and $1\leq y_i \leq Y$. There are the obvious solutions $x_1=x_2$ and $y_1=y_2$ which contribute $XY$. The true order of magnitude should be $XY \log(XY)^A$ with some small power of log. I would like to get $A$ as small as possible.
Also consider the equation $S_2$ given by
$$ x_1(y_1^3 - y_2^3) = x_2 (z_1^3 -z_2^3)$$
with $1\leq x_i\leq X$ and $1\leq y_i,z_i \leq Y$ with $y_1\neq y_2$ and $z_1\neq z_2$. Let $N_2(X,Y)$ denote the corresponding number of solutions.
I expect something like $N_2(X,Y) \ll XY^2\log(XY)^B$, with $B$ again hopefully small.
Is there some clever way to get the exponent of the logarithm small?
 A: For $S_1$ you can take $A=0$.
Setting $g=\gcd(x_1,x_2)$ and $v_i = x_i/g$, and $h=\gcd(y_1,y_2)$ and $w_i = y_i/h$, one obtains $v_1w_1^3 = v_2w_2^3$ with $\gcd(v_1,v_2)=\gcd(w_1,w_2)=1$; this implies that $v_1=w_2^3$ and $v_2=w_1^3$. Therefore all solutions to $S_1$ are of the form $(x_1,x_2,y_1,y_2) = (gw_2^3,gw_1^3,hw_1,hw_2)$ with $\gcd(w_1,w_2)=1$ and the four coordinates less than $X,X,Y,Y$, respectively.
Counting these solutions yields the sum
\begin{align*}
\sum_{g\le X} \sum_{h\le Y} \sum_{\substack{w_1,w_2 \le \min\{ (X/g)^{1/3},Y/h \} \\ \gcd(w_1,w_2)=1} } 1
&=
\sum_{g\le X} \sum_{h \le Y(g/X)^{1/3}} \sum_{\substack{w_1,w_2 \le (X/g)^{1/3} \\ \gcd(w_1,w_2)=1}} 1
+
\sum_{h\le Y} \sum_{g \le X(h/Y)^3} \sum_{\substack{w_1,w_2 \le Y/h \\ \gcd(w_1,w_2)=1}} 1 \\
&\le
\sum_{g\le X} \sum_{h \le Y(g/X)^{1/3}} \frac{X^{2/3}}{g^{2/3}}
+
\sum_{h\le Y} \sum_{g \le X(h/Y)^3} \frac{Y^2}{h^2} \\
&\le
\sum_{g\le X} Y \frac{X^{1/3}}{g^{1/3}}
+
\sum_{h\le Y} X\frac hY \ll YX^{1/3} X^{2/3} + \frac XY Y^2 \ll XY.
\end{align*}
