$\lim_{n \to \infty}\int_0^\infty\left ( \log \left ( {\frac{x+n}{x+\frac{1}{n}}}\right )\right )^2dx$ Let $n=1,2,...$ and define $f(n)$ by $$f(n)=\int_0^\infty\left ( \log \left ( {\frac{x+n}{x+\frac{1}{n}}}\right )\right )^2dx$$
For some values of $n$, Matehamtica's shows that $f(n)$ is finite and seems to converge to $\infty$ as $n\rightarrow \infty$.
1 - How to find a bound for $f(n)$?
2- $f(n)\rightarrow\infty$, as $n\rightarrow\infty$?
Thank you for your time.
 A: Note that, with the substitution $x \mapsto nx$, we have
$$ \frac{f(n)}{n} = \int_{0}^{\infty} \log^2 \left( \frac{x + 1}{x + n^{-2}} \right) \, dx. $$
Now, let us denote
$$ h_n (x) = \log^2 \left( \frac{x + 1}{x + n^{-2}} \right) \quad \text{and} \quad h(x) = \log^2 \left( \frac{x + 1}{x} \right). $$
Then we easily observe that


*

*$h_n (x) \to h(x)$ pointwise and $h_n (x) \leq h(x)$. Indeed,
$$ 1 \leq \frac{x+1}{x+n^{-2}} \leq \frac{x+1}{x} $$
and the claim follows by observing that $x \mapsto \log^2 x$ is non-negative increasing on $x \geq 1$.

*$h(x)$ is integrable. It is a direct consequence of the following estimation:
\begin{align*}
\int_{0}^{\infty} h(x) \, dx
&= \int_{0}^{1} h(x) \, dx + \int_{1}^{\infty} h(x) \, dx \\
&= \int_{1}^{\infty} \frac{h(1/x)}{x^2} \, dx + \int_{1}^{\infty} h(x) \, dx \\
&= \int_{1}^{\infty} \frac{\log^2 (1+x)}{x^2} \, dx + \int_{1}^{\infty} \log^2 \left(1 + \frac{1}{x} \right) \, dx \\
&\leq \int_{1}^{\infty} \frac{\log^2 (1+x)}{x^2} \, dx + \int_{1}^{\infty} \frac{dx}{x^2}
 < \infty.
\end{align*}


Then by dominated convergence we obtain
$$ \frac{f(n)}{n} = \int_{0}^{\infty} h_n(x) \, dx \xrightarrow[]{n\to\infty} \int_{0}^{\infty} h(x) \, dx. $$
(If you want to avoid the use of dominated convergence, which requires some basic measure theory, you can first show that $h_n(x) \uparrow h(x)$ as $n \to \infty$ pointwise. Then by Dini's theorem, on any compact subset of $(0, \infty)$ we have $h_n (x) \to h(x)$ uniformly. Now a suitable $\epsilon-\delta$ argument will give the same conclusion.)
This already shows that 
$$ f(x) \sim cn $$
for some constant $c > 0$. To determine the constant $c$, we have to show that
$$ \int_{0}^{\infty} h(x) \, dx = \frac{\pi^2}{3}. $$
But this is also straightforward. Indeed, put $\displaystyle u = \frac{x}{x+1}$. Then $\displaystyle dx = \frac{du}{(1-u)^2}$ and therefore
\begin{align*}
\int_{0}^{\infty} h(x) \, dx
&= \int_{0}^{\infty} \log^2 \left( \frac{x + 1}{x} \right) \, dx
 = \int_{0}^{1} \frac{\log^2 u}{(1-u)^2} \, du \\
&= \left[ \frac{u}{1-u} \log^2 u \right]_{0}^{1} - 2 \int_{0}^{1} \frac{\log u}{1-u} \, du \\
&= 2 \int_{0}^{\infty} \frac{t}{e^{t}-1} \, dt \qquad (u = e^{-t}) \\
&= 2 \zeta(2) = \frac{\pi^2}{3}.
\end{align*}
A: $$ \frac{x + n}{x + n^{-1}} = 1 + \frac{n-1}{nx + 1}$$
Using the expansion of $\log(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} + O(x^4)$
We see that the resulting expansion of the integrand is $$\frac{n - 1}{nx + 1} - \frac{(n - 1)^2}{2(n x+ 1)^2} + O\left (\left(\frac{n-1}{nx + 1} \right)\right)^3$$
Squaring this again, we get $(\frac{n - 1}{nx + 1})^2 + O((\frac{n-1}{n x + 1})^3)$
The integral of the left term is just $$\left.-\frac{(n - 1)^2}{n(1 + n x)}\right|^{\infty}_0 = \frac{(n-1)^2}{n}$$
