# Why are these two integrals different?

Let $$a_n$$ and $$b_n$$ be two sequences of numbers, both uniformly distributed in $$(0,1)$$. Then, $$\lim_{n \to \infty}\frac{1}{n}\sum_{r=1}^{n}f(a_r b_r) = \int_{0}^{1}\int_{0}^{1} f(xy)dxdy$$

Now let $$A_n$$ and $$B_n$$ be two increasing sequences of positive integers such that , both the ratios $$\frac{A_r}{A_n}$$ and $$\frac{B_r}{B_n}$$, $$r = 1,2,\ldots n$$ approach uniform distribution in $$(0,1)$$ as $$n \to \infty$$. Then,

$$\lim_{n \to \infty}\frac{1}{n}\sum_{r=1}^{n}f\Big(\frac{A_r B_r}{A_n B_n}\Big) = \int_{0}^{1} f(x^2)dx$$

I found this somewhat unexpected as I would have expected both the above limits to have the same integral form since I was expecting the $$a_r b_r$$ to have a behavior similar to that of $$\frac{A_r}{A_n}\frac{B_r}{B_n}$$ but this does not seem to be the case.

Main question: What is the root cause due to which we have two different integral i.e why is the behavior of $$a_r b_r$$ different from that of $$\frac{A_r}{A_n}\frac{B_r}{B_n}$$?

Secondary question: Under what conditions or for which functions $$f(x) \ne c$$, is

$$\int_{0}^1 \int_{0}^1 f(xy)dxdy = \int_{0}^1 f(x^2)dx$$

The answer to Question 1 has to do with the fact that in the first case, $$a_n$$ and $$b_n$$ are unordered, so the joint distribution of $$\{(a_r, b_r)\}_{r \ge 1}$$ is uniform on the unit square $$(0,1)^2$$. But in the second expression both $$A_r/A_n$$ and $$B_r/B_n$$ are ordered, so their joint distribution is no longer uniform on the unit square. Informally speaking, the product $$\frac{A_r B_r}{A_n B_n}$$ never has a term where $$A_r/A_n$$ is "small" but $$B_r/B_n$$ is "large" for a given index $$r$$, or vice versa. Each is uniform on $$(0,1)$$ but together, they are highly correlated--in the limit, perfectly correlated.
Take $$f(x) = \ln(x)$$
$$\int_{[0,1]} \int_{[0,1]} f(xy)dxdy = \int_{[0,1]} \int_{[0,1]} \ln(xy) dx dy = \int_{[0,1]} \int_{[0,1]} ( \ln(x) + \ln(y)) dx dy = 2(x\ln(x) - x) |_{0}^{1} = -2$$
And $$\int_{[0,1]} f(x^{2})dx = \int_{[0,1]} \ln(x^{2}) dx= \int_{[0,1]} 2\ln(x)dx = 2(x\ln(x) -x)|_{0}^{1} = -2$$