<s>[INST] limit using taylor series I keep getting an error in the expansion
$$\lim_{x\to 0 }\frac{2\exp(\sin(x))-2-x-x^2-\arctan (x) }{x^3}$$
The numerator works out as
$$\approx 2 (1+\sin(x) + 1/2 \sin^2(x)) -2-x-x^2 - (x-x^3/3+x^5/5)$$
$$\approx 2(1+x-x^3/3!+1/2(x-x^3/3!)^2 -2-2x+x^3/3-x^2 -x^5/5 $$
$$ = o(x^4)$$
so that the limit is zero. But it is supposed to be $1/3$. Where is my mistake?
 [/INST] $$\newcommand{\b}[1]{\left(#1\right)}
\newcommand{\O}{{\mathbb O}}
\sin x=x-\frac16x^3+\O(x^5)\\
e^x=1+x+\frac12x^2+\frac16x^3+\O(x^5)\\
\arctan x=x-\frac13x^3+\O(x^5)$$
Now:
$$e^{\sin x}=1+\sin x+\frac12\sin^2 x+\O(x^3)\\
=1+\b{x-\frac16x^3+\O(x^5)}+\frac12\b{x-\frac16x^3+\O(x^5)}^2+\frac16\b{x-\frac16x^3+\O(x^5)}^3+O(x^5)\\
=1+\b{x-\frac16x^3+\O(x^5)}+\frac12\b{x^2-\frac13x^4+\O(x^5)}+\frac16\b{x^3+\O(x^5)}+\O(x^5)\\
=1+x+\frac12x^2+\O(x^5)$$
Now:
$$2e^{\sin x}-2-x-x^2=x+\O(x^5)$$
So:
$$2e^{\sin x}-2-x-x^2-\arctan x=\frac13x^3+\O(x^5)$$
Now:
$$\lim_{x\to0}\frac{2e^{\sin x}-2-x-x^2-\arctan x}{x^3}=\lim_{x\to0}\frac{\frac13x^3+\O(x^5)}{x^3}=\frac13$$
Anyways Why don't you use L'Hospital?
$$\lim_{x\to 0 }\frac{2\exp(\sin(x))-2-x-x^2-\arctan (x) }{x^3}
\\=\lim_{x\to 0 }\frac{2\cos x\exp(\sin(x))-1-2x-\frac1{x^2+1} }{3x^2}
\\=\lim_{x\to 0 }\frac{2(\cos^2x-\sin x)\exp(\sin(x))-2+\frac{2x}{(x^2+1)^2} }{6x}
\\=\lim_{x\to 0 }\frac{\frac{2-6x^2}{(x^2+1)^3}-2\sin xe^{\sin x}(\sin x+3)}{6}
\\=\frac{\frac{2-6\times0^2}{(0^2+1)^2}-2\times0\times e^0(0+3)}{6}
\\=\frac{2}{6}=\frac13$$
</s>