Integral equals to $\pi^2/6$ I consider the following result from the book "Proofs From the Book" by Aigner to be very elegant:
\begin{align}
I := \int\limits^1_0\int\limits^1_0 {1\over 1-xy}\ dxdy&=
\int\limits^1_0\int\limits^1_0 \sum_{n\ge 0}(xy)^n\ dxdy\\&=
\sum_{n\ge 0}\int\limits^1_0 x^n\ dx\int\limits^1_0 y^n\ dy\\&=
\sum_{n\ge 0}\bigg[{x^{n+1}\over n+1}\bigg]^1_0\bigg[{y^{n+1}\over n+1}\bigg]^1_0\\&=
\sum_{n\ge 0}{1\over (n+1)^2} \\&= \sum_{n\ge 1} {1\over n^2} \\&=
{\pi^2 \over 6}\,.
\end{align}
However, I don't really know why we were able to go from line 2 to 3 if $I$ is infinite at $x,y=1$. I would appreciate an explanation for this. Thank you.
 A: Well, we have:
$$\mathscr{I}_{\space\text{n}}:=\int_0^\text{n}\int_0^\text{n}\frac{1}{1-x\cdot\text{y}}\space\text{d}x\space\text{d}\text{y}\tag1$$
For, the inner integral we can substitute:
$$\text{u}:=1-x\cdot\text{y}\tag2$$
So, we get:
$$\mathscr{I}_{\space\text{n}}=\int_0^\text{n}\left\{-\frac{1}{\text{y}}\int_1^{1-\text{n}\cdot\text{y}}\frac{1}{\text{u}}\space\text{d}\text{u}\right\}\space\text{d}\text{y}=\int_0^\text{n}\left\{-\frac{1}{\text{y}}\cdot\left[\ln\left|\text{u}\right|\right]_1^{1-\text{n}\cdot\text{y}}\right\}\space\text{d}\text{y}=$$
$$\int_0^\text{n}\left\{-\frac{\ln\left|1-\text{n}\cdot\text{y}\right|-\ln\left|1\right|}{\text{y}}\right\}\space\text{d}\text{y}=-\int_0^\text{n}\frac{\ln\left|1-\text{n}\cdot\text{y}\right|}{\text{y}}\space\text{d}\text{y}\tag3$$
Now, substitute:
$$\text{p}:=\text{n}\cdot\text{y}-1\tag4$$
So, we get:
$$\mathscr{I}_{\space\text{n}}=-\int_{-1}^{\text{n}^2-1}\frac{\ln\left|\text{p}\right|}{1+\text{p}}\space\text{d}\text{p}\tag5$$
Using integration by parts:
$$\mathscr{I}_{\space\text{n}}=\int_{-1}^{\text{n}^2-1}\frac{\ln\left(1+\text{p}\right)}{\text{p}}\space\text{d}\text{p}-\left[\ln\left(1+\text{p}\right)\cdot\ln\left|\text{p}\right|\right]_{-1}^{\text{n}^2-1}=\int_{-1}^{\text{n}^2-1}\frac{\ln\left(1+\text{p}\right)}{\text{p}}\space\text{d}\text{p}-\mathscr{P}\tag6$$
Where:
$$\mathscr{P}:=\lim_{\text{p}\to-1}\left\{\ln\left(1+\left(\text{n}^2-1\right)\right)\cdot\ln\left|\text{n}^2-1\right|-\ln\left(1+\text{p}\right)\cdot\ln\left|-1\right|\right\}=$$
$$\ln\left(\text{n}^2\right)\cdot\ln\left|\text{n}^2-1\right|\tag7$$
And we can use the dilogarithm:
$$\int\frac{\ln\left(1+\text{p}\right)}{\text{p}}\space\text{d}\text{p}=\text{C}-\text{Li}_2\left(-\text{p}\right)\tag8$$
So, we end up with:
$$\mathscr{I}_{\space\text{n}}=\left[-\text{Li}_2\left(-\text{p}\right)\right]_{-1}^{\text{n}^2-1}-\ln\left(\text{n}^2\right)\cdot\ln\left|\text{n}^2-1\right|=$$
$$\left(-\text{Li}_2\left(-\left(\text{n}^2-1\right)\right)-\left(-\text{Li}_2\left(-\left(-1\right)\right)\right)\right)-\ln\left(\text{n}^2\right)\cdot\ln\left|\text{n}^2-1\right|=$$
$$\frac{\pi^2}{6}-\text{Li}_2\left(1-\text{n}^2\right)-\ln\left(\text{n}^2\right)\cdot\ln\left|\text{n}^2-1\right|\tag9$$

Now, when $\text{n}\to1$:
$$\mathscr{I}_{\space1}:=\int_0^1\int_0^1\frac{1}{1-x\cdot\text{y}}\space\text{d}x\space\text{d}\text{y}=$$
$$\lim_{\text{n}\to1}\left\{\frac{\pi^2}{6}-\text{Li}_2\left(1-\text{n}^2\right)-\ln\left(\text{n}^2\right)\cdot\ln\left|\text{n}^2-1\right|\right\}=$$
$$\frac{\pi^2}{6}-0-0=\frac{\pi^2}{6}\tag{10}$$

