Evaluate $\lim_\limits{x \to +\infty}\left(x\ln (1+x)-x\ln x + \arctan\frac{1}{2x}\right)^{x^2\arctan x}$ $$\lim_{x \to +\infty}\left(x\ln (1+x)-x\ln x + \arctan\frac{1}{2x}\right)^{x^2\arctan x}$$
My attempt
\begin{align*}
&=\exp \lim_\limits{x \to +\infty} x^2\arctan x \cdot\ln\left[x\ln (1+x)-x\ln x + \arctan\frac{1}{2x}\right]\\
&=\exp \lim_{x \to +\infty} \frac{\pi}{2}x^2 \ln\left[\frac{\ln x}{\frac{1}{x}} + \frac{\ln \left(1+\frac{1}{x}\right)}{\frac{1}{x}}-\frac{\ln x}{\frac{1}{x}} + \arctan\frac{1}{2x}\right]\\
&=\exp \lim_{x \to +\infty} \frac{\pi}{2}x^2\ln\left[1 + \arctan \frac{1}{2x}\right]
\end{align*}
Here I don't know what to do. One thing I did was to multiply and divide by $\arctan \frac{1}{2x}$ in order to get rid of the logarithm. But I ended up with 
$$\frac{\pi}{2}x^2\arctan \frac{1}{2x}$$
$\arctan \frac{1}{2x} \to \pi/2$ as $x \to +\infty$ but that doesn't lead to the right answer (I'd get a limit of $+\infty$).

Start by writing (all symbols $\sim$ are taken as $x \to +\infty$)
$$
\log(1+x) = \log x + \log \left( 1+ \frac{1}{x} \right) \sim \log x + \frac{1}{x} - \frac{1}{2x^2} + \frac{1}{3x^3}.
$$
Hence
$$
x \log (1+x) - x\log x + \arctan \frac{1}{2x} \sim 1 - \frac{1}{2x} + \frac{1}{3x^2} + \frac{1}{2x} - \frac{1}{24 x^3} \sim 1+\frac{1}{3x^2}.
$$
Now you conclude easily since
$$
\lim_{x \to +\infty} \left(1+\frac{1}{3x^2} \right)^{x^2 \arctan x} = e^{\frac{1}{3} \frac{\pi}{2}} = e^{\pi/6}.
$$
As you can see, a zero-order expansion is not enough, since you can cancellation of low-order terms.
