Calculate $ \lim_{x\to 0}\frac{ \ln(x+\cos(x))-xe^{-x} }{x^{3}}$ Calculate   $\displaystyle \lim\limits_{x\to 0}\dfrac{ \ln\left(x+\cos(x)\right)-xe^{-x} }{x^{3}}$ 
My attempts 
by l’hôpital   


*

*$\left( \ln\left(x+\cos(x)\right)-xe^{-x} \right)'=\dfrac{(x+\cos(x))' }{(x+\cos(x))} -(e^{-x}-xe^{-x}   )=\dfrac{(1-\sin(x)) }{(x+\cos(x))} -(e^{-x}-xe^{-x}   ) $

*$(x^{3})'=3x^{2}$


L’Hôpital's rule seems to be hard to use here. 
This is an alternative method by using Taylor expansion at $0$: 
\begin{align*}
\ln\left(x+\cos(x)\right)-xe^{-x}&=
\ln\left(1+x-\frac{x^2}{2}+o(x^3)\right)-x\left(1-x+\frac{x^2}{2}+o(x^2)\right)\\
&=\left(x-\frac{x^2}{2}\right)-\frac{1}{2}\left(x-\frac{x^2}{2}\right)^2+\frac{1}{3}\left(x-\frac{x^2}{2}\right)^3-x+x^2-\frac{x^3}{2}+o(x^3)\\
&=x-\frac{x^2}{2}-\frac{x^2}{2}+\frac{x^3}{2}+\frac{x^3}{3}-x+x^2-\frac{x^3}{2}+o(x^3)\\
&=\frac{x^3}{3}+o(x^3).
\end{align*}
Hence
$$\lim_{x\to 0}\frac{ \ln\left(x+\cos(x)\right)-xe^{-x} }{x^{3}}=\lim\limits_{x\to 0}\frac{\frac{x^3}{3}+o(x^3) }{x^{3}}=\frac{1}{3}.$$
