I have the following integral on hand $$I_n=\int_{0}^\infty\frac1x\left[1-\left(\frac{x-1}{x+1}\right)^n\left(\frac{x-i}{x+i}\right)^{-n}\right]\ \mathrm dx$$
I am trying to find out what $\lim_{n\to\infty} I_n$ evaluates to.
I have a sneaking suspicion that the limit is infinite (which comes from a heuristic argument based on the fact that a uniform random walk on $\mathbb Z^2$ is recurrent), but I am not sure if this particular integral would diverge.
My heuristics is as follows. I model my lattice $\mathbb Z^2$ as a resistance network $G$, and then look at square sublattices $G_n$ centered at the origin. Then $G=\lim_{n\to\infty} G_n$. Let us look at a unit current flow, such that the voltage at the origin is $V$ and at the boundary is $0$. Then the probability of a random walk starting at the origin 'escaping' to the boundary of $G_n$ before returning to the origin is (by a standard theorem in electric networks) given by $$\mathbb P_0=\frac{r(0)}{R^{(n)}_{eff}}$$
where $r(0)$ is the resistance at $0$ (here it is $1/4$) and $R^{(n)}_{eff}$ is the effective resistance between $0$ and the boundary of $G_n$. Since the random walk in $\mathbb Z^2$ is recurrent, this probability must go to $0$, and thus the effective resistance must diverge (That the effective resistance diverges is shown by the fact that $R_{eff}^{(n)}\ge \sum_{k=0}^{n-1}\frac{1}{2k+1}\to \infty$, which is another method of showing the random walk is recurrent).
If we now just try to evaluate the effective resistance between any 2 points $G$ physically, it quickly becomes a mess. Here's a nice walkthrough of how one goes about doing this. A more thorough mathematical treatment is in Probability on Trees and Networks by Russel Lyon and Yuval Peres, section 4.3. Also see this answer. The takeaway is that the effective resistance between the origin and any point $(m,n)\in\mathbb Z^2$ is given by
$$R_{m,n}=\frac{1}{2\pi}\int_{x=0}^\infty\frac1x\left[1-\left(\frac{x-1}{x+1}\right)^{m+n}\left(\frac{x-i}{x+i}\right)^{m-n}\right]\ \mathrm dx$$
(see equation 14 in the walkthrough). I am looking at this integral with $m=0$, and the constant factors stripped way to get my $I_n$. Since the effective resistance should diverge however I look (this is probably not precise, but that is why I am calling this a heuristic), I am expecting this integral to diverge, but I am not sure to proceed.
Any help is appreciated.
The integral is real and by means of the substitution $t=\frac{1}{x}$ can be presented in the form $$I(n)=\int_0^\infty\frac{dx}{x}\bigg(1-(-1)^n\Big(\frac{x-1}{x+1}\Big)^n\cos(2n\arctan x)\bigg)$$ The integral converges for both even and odd $n$; for the convenience we will consider the first case (even $n$): $$I(n)=\int_0^\infty\frac{dx}{x}\bigg(1-\Big(\frac{x-1}{x+1}\Big)^n\cos(2n\arctan x)\bigg)\tag{1}$$ Splitting the interval of integration $[0;1];[1;\infty)$ and making the substitution $t=\frac{1}{x}$ in the second part, also using $\cos(2n\arctan \frac{1}{t})=\cos(2n\arctan t)$ for even $n$, $$I(n)=2\int_0^1\frac{dt}{t}\bigg(1-\Big(\frac{1-t}{1+t}\Big)^n\cos(2n\arctan t)\bigg)\tag{2}$$ Making the substitution $\displaystyle x=\frac{1-t}{1+t}$ $$I(n)=2\int_0^1\Big(\frac{1}{1-x}+\frac{1}{1+x}\Big)\Big(1-x^n\cos(2n\arctan\frac{1-x}{1+x})\Big)dx=I_1+I_2\tag{3}$$ where $$I_2=2\int_0^1\frac{1}{1+x}\Big(1-x^n\cos(2n\arctan\frac{1-x}{1+x})\Big)dx=2\ln 2+O\Big(\frac{1}{n}\Big)\tag{4}$$ because $$\Big|\int_0^1\frac{x^n}{1+x}\cos(2n\arctan\frac{1-x}{1+x})dx\Big|<\int_0^1\frac{x^n}{1+x}dx=O\Big(\frac{1}{n}\Big)$$ To evaluate $I_1$, we present it in the form ($H_n$ denotes the n-th harmonic number) $$I_1=2\int_0^1\frac{1-x^n}{1-x}dx+2\int_0^1\frac{x^n}{1-x}\Big(1-\cos(2n\arctan\frac{1-x}{1+x})dx\Big)$$ $$=2H_n+4\int_0^1\frac{x^n}{1-x}\sin^2(n\arctan\frac{1-x}{1+x})dx$$ At $n\to\infty$ the second term contributes only in the narrow region near $x=1$, and with the accuracy up to vanishing terms we can write $$I_1\sim 2H_n+4\int_0^1\frac{x^n}{1-x}\sin^2(n\frac{1-x}{1+x})dx$$ Making the change $t=1-x$, $$I_1\sim 2H_n+4\int_0^1 \frac{(1-t)^n}{t}\sin^2\frac{nt}{2}dt\sim 2H_n+2\int_0^1 \frac{e^{-nt}}{t}\big(1-\cos (nt)\big)dt$$ Making the substitution $x=nt$, expanding integration to $\infty$ and using the Frullani integral $$I_1\sim 2H_n+2\Re\int_0^\infty\frac{e^{-x}-e^{-x+ix}}{x}dx=2H_n+2\Re\ln(1-i)=2H_n+\ln2$$ Using the asymptotic $\displaystyle H_n=\ln n+\gamma+O\Big(\frac{1}{n}\Big)$ $$I_1=2\ln n+2\gamma+\ln2+O\Big(\frac{1}{n}\Big)\tag{5}$$ Putting (4) and (5) in (3), $$\boxed{\,\,I(n)=2\ln n+2\gamma+3\ln2+O\Big(\frac{1}{n}\Big)\sim 2\ln n\,+\, 3.233872... \,\,}$$
$\bf{Appendix}$
Heuristic consideration - quick evaluation of the leading term.
The integral is real and by means of the substitution $t=\frac{1}{x}$ can be presented in the form $$I(n)=\int_0^\infty\frac{dx}{x}\bigg(1-(-1)^n\Big(\frac{x-1}{x+1}\Big)^n\cos(2n\arctan x)\bigg)$$ The integral converges for both even and odd $n$; for the convenience we consider the first case (even $n$): $$I(n)=\int_0^\infty\frac{dx}{x}\bigg(1-\Big(\frac{x-1}{x+1}\Big)^n\cos(2n\arctan x)\bigg)\tag{a}$$ At $ x<\frac{1}{n}$ we choose some $\alpha<1$; $$ I_1(n)\sim\int_0^\frac{\alpha}{n}\frac{dx}{x}\bigg(1-\Big(\frac{1-x}{1+x}\Big)^n\cos(2n\arctan x)\bigg)\sim\int_0^\frac{\alpha}{n}\frac{dx}{x}\Big(1-(1-2nx)\cos(2nx)\Big)$$ Keeping only the main term $$I_1(n)\sim \int_0^\frac{\alpha}{n}2n\,dx=2n\frac{\alpha}{n}=2\alpha$$ We see that the main term does not depends on $n$ and has some constant value at $x\to 0$. In the similar way we can evaluate the integral at $x\to\infty\,(x\in [\beta n;\infty), \beta>1)$ and get a constant as a main term as well.
Evaluating the remaining part of the integral, we can drop the second term in (a).
At $x\in[\frac{\alpha}{n};\beta n]$ $$I_3(n)\sim\int_{\frac{\alpha}{n}}^{\beta n}\frac{dx}{x}=\ln(\alpha\beta n^2)=const+2\ln n$$ If we change $\alpha, \beta$, we get only an additional constant term; therefore, the main term is $2\ln n$, and we can conclude that $$I(n)=a+b\ln n=a+2\ln n$$ In fact I found that $b=2$ and $a\approx3.234$ from a couple of numeric evaluations (please see the comment and evaluations by @KStarGamer; I also checked $I(n)$ for $n=30, 40, 50$)