Evaluating limits using taylor expansion $$\lim_{x\to 0^{+}} (\ln x)^3\left(\arctan\left(\ln\left(x+x^2\right)\right) + \frac{\pi}{2}\right) + (\ln x)^2$$ 
I have this limit in my sheet and the answer is $\frac 13$.
But I don't know how to approach any step using taylor expansion near zero (this is our lesson by the way). Please help me with the simplest way.
 A: When $x\to 0^+$, 
$$
\ln(x+x^2) = \ln x + \ln(1+x^2) = \ln x + o(x) \tag{1}
$$
and this goes to $-\infty$ as $x\to 0^+$. To continue, we would like to have $\arctan u$ with $u\to 0$, though. When $x<0$, we can use the fact that 
$$
\arctan x + \arctan \frac{1}{x} = -\frac{\pi}{2} \tag{2}
$$
to rewrite (for $x$ small enough)
$$
\arctan \ln(x+x^2) = \arctan(\ln x + o(x))
= -\frac{\pi}{2} - \arctan\frac{1}{\ln x + o(x)}
$$
which also us to write, as $\frac{1}{\ln x + o(x)}\xrightarrow[x\to 0^+]{} 0^-$,
$$\begin{align}
\arctan \ln(x+x^2) + \frac{\pi}{2}
&= - \arctan\frac{1}{\ln x + o(x)}\\
&= - \arctan\frac{1}{\ln x}\left(\frac{1}{1 + o\left(\frac{x}{\ln x}\right)}\right)\\
&= - \arctan\left( \frac{1}{\ln x}+o\left(\frac{x}{\ln^2 x}\right)\right)\\
&= -\frac{1}{\ln x}+\frac{1}{3\ln^3 x}+o\left(\frac{1}{\ln^3 x}\right) .\tag{3}
\end{align}$$
From there, we get
$$\ln^3 x\left(\arctan \ln(x+x^2) + \frac{\pi}{2}\right) = 
-\ln^2 x+\frac{1}{3}+o\left(1\right) 
$$
and, finally,
$$\ln^3 x\left(\arctan \ln(x+x^2) + \frac{\pi}{2}\right) + \ln^2 x= 
\frac{1}{3}+o\left(1\right)  \xrightarrow[x\to 0^+]{} \boxed{\frac{1}{3}}.
$$
A: As $x \to 0^+$, one has $\ln x<0$, giving
$$
\arctan\left(\ln\left(x+x^2\right)\right)=-\frac \pi2-\arctan\left(\frac1{\ln\left(x+x^2\right)}\right),
$$ and using  $\dfrac1{\ln\left(x+x^2\right)} \to 0$ one gets, by applying a standard taylor series expansion,
$$
\arctan\left(\frac1{\ln\left(x+x^2\right)}\right)=\frac1{\ln\left(x+x^2\right)}-\frac1{3\ln^3\left(x+x^2\right)}+O\left( \frac1{\ln^5\left(x+x^2\right)}\right)
$$ and
$$
\begin{align}
&(\ln x)^3\left(\arctan\left(\ln\left(x+x^2\right)\right) + \frac{\pi}{2}\right) + (\ln x)^2
\\\\&= (\ln x)^2-\frac{(\ln x)^3}{\ln\left(x+x^2\right)}+\frac{(\ln x)^3}{3\ln^3\left(x+x^2\right)}+O\left( \frac{(\ln x)^3}{\ln^5\left(x+x^2\right)}\right)
\\\\&= (\ln x)^2-\frac{(\ln x)^3}{\ln x+O(x)}+\frac{(\ln x)^3}{3\ln^3x+O(x)}+O\left( \frac{(\ln x)^3}{\ln^5x+O(x)}\right)
\\\\&= (\ln x)^2-(\ln x)^2+\frac13+O\left( \frac1{\ln^2x}\right)+O(x)
\\\\& \to \frac13
\end{align}
$$ as announced.
