Limit $\frac{n^{2k+1}}{2k+1}\log(n)-\frac{n^{2k+1}}{(2k+1)^2}$ to evaluate the integral $\int_0^{\infty}\frac{\log x}{x^2-1}dx$ Evaluate the integral
$$I=\int_0^{\infty}\frac{\log x}{x^2-1}dx$$ 
Attempt: $$I=-\int_{0}^{\infty}\log(x)\sum_{k=0}^{\infty}x^{2k}dx=-\sum_{k=0}^{\infty}\lim_{n\to\infty}I_n$$ where $I_n=\int_{0}^nx^{2k}\log(x)dx$. 
For computing $I_n$, let $u=\log(x)$ and $dv=x^{2k}dx$. Then $du=(1/x)dx$ and $v=x^{2k+1}/(2k+1)^2$. So, 
\begin{equation}
I_n=\frac{x^{2k+1}}{2k+1}log(x)-\frac{x^{2k+1}}{(2k+1)^2}\Bigg|_{x=0}^{x=n}=\frac{n^{2k+1}}{2k+1}log(n)-\frac{n^{2k+1}}{(2k+1)^2}-\lim_{x\to 0^{+}}\Big(\frac{x^{2k+1}
}{2k+1}\log(x)\Big)\end{equation}
On the other hand, $$\lim_{x\to 0^+}x^{2k+1}log(x)=\lim_{x\to 0^+}\frac{1/x}{1/x^{2k+1}}=\lim_{x\to 0^+}\frac{x^{2k+1}}{-2k-1}=0$$
So we have $$I_n=\frac{n^{2k+1}}{2k+1}\log(n)-\frac{n^{2k+1}}{(2k+1)^2}$$
Now we need to compute $\lim_{n\to\infty}I_n$. But I'm stuck here. How can we compute this limit? And can anyone check my attempt? Thanks!
 A: Outline:


*

*First, you actually should prove that your integral is indeed convergent. You may not want to, but that's always a good thing...

*Rewrite your integral as
$$
I = \underbrace{\int_0^1 dx \frac{\ln x}{x^2-1}}_{I_1} + \underbrace{\int_1^\infty dx \frac{\ln x}{x^2-1}}_{I_2}
$$

*Compute $I_1$ by writing $\frac{1}{x^2-1} = -\sum_{k=0}^\infty x^{2k}$, so that
$$
I_1 = -\int_0^1 dx \sum_{k=0}^\infty x^{2k} \ln x = -\sum_{k=0}^\infty \int_0^1 dx\ x^{2k} \ln x = [...]
$$
where you need to justify swapping sum and integral.$^{(\dagger)}$ See Marco Cantarini's answer there for more details on the computation of $I_1$.

*Compute $I_2$ by reducing it to computing $I_1$... the change of variable $u=\frac{1}{x}$ will come in handy.$^{(\ddagger)}$

Spoilers.
$(\dagger)$ The words "absolute convergence" should have a role there.
$(\ddagger)$ More precisely,
$$
I_2 = \int_1^\infty dx\frac{\ln x}{x^2-1}
= \int_1^0 -\frac{du}{u^2}\frac{\ln \frac{1}{u}}{\frac{1}{u^2}-1}
= \int_0^1 \frac{du}{u^2}\frac{-\ln u}{\frac{1}{u^2}-1}
= \int_0^1 du\frac{-\ln u}{1-u^2}
= I_1
$$
A: Let $I$ be the integral given by 
$$\begin{align}
I&=\int_0^\infty \frac{\log(x)}{x^2-1}\,dx\\\\
&=\int_0^1 \frac{\log(x)}{x^2-1}\,dx+\int_1^\infty \frac{\log(x)}{x^2-1}\,dx\tag 1
\end{align}$$
Enforcing the substitution $x\to 1/x$ in the second integral on the right-hand side of $(1)$ reveals
$$\begin{align}
I&=2\int_0^1 \frac{\log(x)}{x^2-1}\,dx\\\\
&=\int_0^1 \frac{\log(x)}{x-1}\,dx-\int_0^1 \frac{\log(x)}{x+1}\,dx\tag 2
\end{align}$$
For the first integral on the right-hand side of $(2)$, we enforce the substitution $x\to 1-x$ to obtain
$$\begin{align}
\int_0^1 \frac{\log(x)}{x-1},dx&=-\int_0^1 \frac{\log(1-x)}{x}\,dx\\\\
&=\text{Li}_2(1)\\\\
&=\frac{\pi^2}{6}
\end{align}$$
For the second integral on the right-hand side of $(2)$, we integrate by parts with $u=\log(x)$ and $v=\log(1+x)$ to obtain
$$\begin{align}
\int_0^1 \frac{\log(x)}{x+1},dx&=-\int_0^1 \frac{\log(1+x)}{x}\,dx\\\\
&=-\int_0^{-1}\frac{\log(1-x)}{x}\,dx\\\\
&=\text{Li}_2(-1)\\\\
&=-\frac{\pi^2}{12}
\end{align}$$
Hence, we find 
$$\begin{align}
I&=\frac{\pi^2}{6}+\frac{\pi^2}{12}\\\\
&=\frac{\pi^2}{4}
\end{align}$$
