Decide the order of of an integration involving the $\log$ function Let $$A_n=\int_{n^{-\frac{1}{2}}}^{1}\frac{\log(nx)}{nx(\log\log(nx)-\log\log(1+x))}dx.$$
I want to discribe the order of $A_n$, by geting a progressive formula or a good lower bound for it. The order is at most $\frac{\log^2n}{n\log\log n}$ if we loose the denominator to $nx(\log\log(nx))$ but maybe the answer is lower.The problem is that when $x$ is near to $1$ the inner function is hard to discribe for me. If we let $\log(nx)=t\log n$, then $$A_n=\frac{\log^2n}{n}\int_{\frac{1}{2}}^{1}\frac{t}{\log t +\log\log n-\log\log(1+n^{t-1})}dt.$$
Can anyone help me with this problem? Thanks a lot.
 A: $\newcommand{\de}{\delta}$Write
\begin{equation}
    A_n=\frac{\ln^2n}n\, J_n,
\end{equation}
where
\begin{equation}
    J_n:=\int_{1/2}^1\frac{t\,dt}{\ln t +\ln\ln n-\ln\ln(1+n^{t-1})}. 
\end{equation}
Since $\ln(1+x)\asymp x$ for $x\in(0,1]$, we have
\begin{equation}
    J_n=\int_{1/2}^1\frac{t\,dt}{O(1) +\ln\ln n-\ln(n^{t-1})+O(1)}
    =\frac{I_n}{\ln n}, 
\end{equation}
where
\begin{equation}
    I_n=\int_{1/2}^1\frac{t\,dt}{1-t+a_n}=I_{1n}+I_{2n},
\end{equation}
\begin{equation}
    a_n\sim\frac{\ln\ln n}{\ln n}, 
\end{equation}
\begin{equation}
    I_{1n}=\int_{1/2}^{1-\de_n}\frac{t\,dt}{1-t+a_n},\quad 
    I_{2n}=\int_{1-\de_n}^1\frac{t\,dt}{1-t+a_n},
\end{equation}
$\de_n:=1/\ln\ln\ln n$. Next,
\begin{equation}
    I_{1n}=\int_{1/2}^{1-\de_n}\frac{t\,dt}{1-t+a_n}
    \le\int_{1/2}^{1-\de_n}\frac{dt}{\de_n}\le\frac1{\de_n}=o(\ln\ln n),
\end{equation}
\begin{equation}
    I_{2n}\sim\int_{1-\de_n}^1\frac{dt}{1-t+a_n}
    =\ln\Big(1+\frac{\de_n}{a_n(1+o(1))}\Big)\sim\ln\ln n. 
\end{equation}
Collecting the pieces, we get
\begin{equation}
    A_n\sim\frac{\ln^2n}n\, \frac{\ln\ln n}{\ln n}
    =\frac{\ln n\;\ln\ln n}n. 
\end{equation}
