<s>[INST] Evaluate $\int \limits _{0}^{\infty}\ln\left({x+\frac{1}{x}}\right)\cdot\frac{\mathrm dx}{1+x^2}$ $$\int \limits _{0}^{\infty}\ln\left({x+\frac{1}{x}}\right)\cdot\frac{dx}{1+x^2}$$
we are asked to solve this definite integral so here's what i did
$$\int \limits_{0}^{\infty}\ln \left({\frac{x^2 +1}{x}}\right)\cdot\frac{dx}{1+x^2} = \int\limits_{0}^{\infty}\ln \left(x^2+1\right)\cdot\frac{dx}{1+x^2} - \int \limits_{0}^{\infty}\ln (x).\frac{dx}{1+x^2}$$ now how to proceed after that ? should i intregrate both seperate functions by substituting $(x^2+1)$ and what should i susbtitute in other integral , by-parts integration is making troubles when substituting $\infty$ , now what to do ?
 [/INST] As you have done the integral can be fairly easy evaluated by splitting it into two easier integrals. 
$$
   \int_{0}^{\infty}\log \left({\frac{x^2 +1}{x}}\right)\cdot\frac{dx}{1+x^2}\mathrm{d}x = 
    \int_{0}^{\infty}\frac{\log\left(x^2+1\right)}{1+x^2}\,\mathrm{d}x - 
    \int_{0}^{\infty}\frac{\log x}{1+x^2}\,\mathrm{d}x
$$
For the last integral we have that 
$$
\int_0^\infty R(x) \log x = 0
$$
given that $R(x)$ is a rational function satisfying $R(x)=R(1/x)/x^2$. I will leave it to you to checki that $R(x) = 1/(1+x^2)$ satisfies this functional relation. Alternatively one can see that the last integral is zero by splitting the integral by splitting it into $[0,1]\cap[1,\infty)$ 
$$
\int_0^1 \frac{\log x}{1+x^2}\mathrm{d}x + \int_1^\infty \frac{\log x}{1+x^2}\mathrm{d}x
$$
and using $x = 1/u$ in the last integral. Now we have that 
$$
    \int_{0}^{\infty}\log \left({\frac{x^2 +1}{x}}\right)\cdot\frac{dx}{1+x^2}\mathrm{d}x 
    =
    \int_{0}^{\infty}\frac{\log\left(x^2+1\right)}{1+x^2}\,\mathrm{d}x 
$$
which can be evaluated by introducing a variable $\alpha$, and differentiating under the integral sign. By looking at the following integral
$$
   I(\alpha) := \int_{0}^{\infty}\frac{\log\left(1 + \alpha^2x^2\right)}{1+x^2}\,\mathrm{d}x 
$$
we see that our integral equals $I(1)$. Now by differentiating by $\alpha$ we obtain
\begin{align}
   \frac{\mathrm{d}}{\mathrm{d}\alpha}I(\alpha) & = \frac{\mathrm{d}}{\mathrm{d}\alpha} \int_{0}^{\infty}\frac{\log\left(1 + \alpha^2x^2\right)}{1+x^2}\,\mathrm{d}x \\
& =  \int_{0}^{\infty} \frac{\partial}{\partial \alpha}\frac{\log\left(1 + \alpha^2x^2\right)}{1+x^2}\,\mathrm{d}x \\ 
& = \int_0^\infty \frac{2a x^2}{(1+\alpha^2x^2)(1+x^2)}\,\mathrm{d}x \\
& = \frac{2\alpha}{\alpha^2-1} \int_0^\infty \frac{1}{1+x^2} - \frac{1}{1 +\alpha^2x^2} \,\mathrm{d}x \\
& = \frac{\pi}{a+1}
\end{align}
Integrating both sides now gives 
$$
  I(\alpha) = \pi \log(1+\alpha) + \mathcal{C}
$$
But since $I(\alpha)=0$, then $\mathcal{C}=0$. We can now "finaly" conclude that 
$$
\int_0^\infty \left( \alpha^2 x + \frac{1}{x}\right) \frac{\mathrm{d}x}{1+x^2} = \pi \log(1+\alpha)
$$ 
Your integral is now evaluated by simply plugging in $\alpha = 1$. The switching of the derivation is legal since we have that 
$$
\frac{\log(1+\alpha x^2)}{1+x^2} < \frac{\log(\alpha x^2+\alpha x^2)}{1+x^2} \, \forall \, x>1
$$
and the last integral converges (why?). By similar means we have that $\pi/(1+\alpha)$ converges as well.
</s>