<s>[INST] Evaluate $\lim\limits_{x \to 0+}\left[\frac{x^{\sin x}-(\sin x)^{x}}{x^3}+\frac{\ln x}{6}\right].$ Problem
Evaluate
$$\lim_{x \to 0+}\left[\frac{x^{\sin x}-(\sin x)^{x}}{x^3}+\frac{\ln x}{6}\right].$$
Attempt
First, we may obtain
$$\lim_{x \to 0+}\left[\frac{x^{\sin x}-(\sin x)^{x}}{x^3}+\frac{\ln x}{6}\right]=\lim_{x \to 0+}\frac{6e^{\sin x\ln x}-6e^{x\ln\sin x}+x^3\ln x}{6x^3}.$$
Here, you can apply L'Hôpital's rule, but it's too complicated. Moreover, you can also apply Taylor's formula, for example
$$e^{\sin x\ln x}=1+\sin x\ln x+\frac{1}{2}(\sin x\ln x)^2+\cdots,\\e^{x\ln\sin x}=1+x\ln\sin x+\frac{1}{2}(x\ln\sin x)^2+\cdots,$$
but you cannot cancel the terms, thus you cannot avoid differentiating, either. Is there any elegant solution?
P.S. Please don't suspect the existence of the limit. The result equals $\dfrac{1}{6}.$
 [/INST] The key point is that $x\log \sin x \to 0$ and $\sin x \log x \to 0$ then by Taylor's series we have


*

*$x^{\sin x}=e^{\sin x \log x}=1+x\log x+\frac12x^2\log^2 x+\frac16x^3\log x(\log^2 x -1)+O(x^4\log^2 x)$ 

*$(\sin x)^{x}=e^{x \log (\sin x)}=1+x\log x+\frac12x^2\log^2 x+\frac16x^3(\log^3 x -1)+O(x^4\log x)$
then
$$\frac{x^{\sin x}-(\sin x)^{x}}{x^3}+\frac{\ln x}{6}=\frac{\frac16x^3\log^3 x-\frac16x^3\log x-\frac16x^3\log^3 x +\frac16x^3+O(x^4\log x)}{x^3}+\frac{\ln x}{6}=$$
$$=\frac16+O(x\log x) \to \frac16$$

To see how obtain the Taylor's expansion, let consider the first one, then since


*

*$\sin x =x-\frac16 x^3+O(x^5) \implies \sin x \log x=x\log x-\frac16 x^3\log x+O(x^5\log x)$

*$e^t = 1+t+\frac12 t^2+\frac16t^3+O(t^4)$
we obtain that
$$x^{\sin x}=e^{\sin x \log x}
=1+\left(x\log x-\frac16 x^3\log x+O(x^5\log x)\right)+\frac12\left(x\log x-\frac16 x^3\log x+O(x^5\log x)\right)^2+\frac16\left(x\log x-\frac16 x^3\log x+O(x^5\log x)\right)^3+O(x^5\log^4 x)=$$
$$=1+x\log x-\frac16 x^3\log x+\frac12x^2\log^2x-\frac16x^4\log^2x+\frac16x^3\log^3x+O(x^4\log^2x)=$$
$$=1+x\log x+\frac12x^2\log^2x+\frac16x^3\log x(\log^2x-1)+O(x^4\log^2x)$$
and for the second one since


*

*$\log (1+t)= t-\frac12t^2+\frac13t^3+O(t^4)$

*$\sin x =x-\frac16 x^3+O(x^5)\implies \frac{\sin x}x=1-\frac16 x^2+O(x^4)$

*$\log \sin x=\log x+\log \frac{\sin x}x=\log x+\log \left(1-\frac16 x^2+O(x^4)\right)=\log x-\frac16 x^2+O(x^4)$

*$x\log \sin x=x\log x-\frac16 x^3+O(x^5)$
we obtain that
$$(\sin x)^x=e^{x\log \sin x}=1+\left(x\log x-\frac16 x^3+O(x^5)\right)+\frac12\left(x\log x-\frac16 x^3+O(x^5)\right)^2+\frac16\left(x\log x-\frac16 x^3+O(x^5)\right)^3+O(x^4\log^4x)$$
$$=1+x\log x-\frac16 x^3+\frac12x^2\log^2x-\frac16x^4\log x+\frac16x^3\log^3 x+O(x^4\log x)=$$
$$=1+x\log x+\frac12x^2\log^2x+\frac16x^3(\log^3 x-1)+O(x^4\log x)$$
</s>