<s>[INST] calculating $\lim\limits _{x\to0}\left(\frac{1}{x^{2}}-\frac{e^{x}}{\left(e^{x}-1\right)^{2}}\right)$ using taylor polynomials I am trying to calculate the limit $$\lim\limits _{x\to0}\left(\frac{1}{x^{2}}-\frac{e^{x}}{\left(e^{x}-1\right)^{2}}\right)$$ using taylor polynomials. I tried using L'Hôpital's rule, but it was tedious. the final answer should be $\frac{1}{12}$.
I tried taylor many times but couldn't make it work. here is my best attempt:
$$\lim\limits _{x\to0}\left(\frac{1}{x^{2}}-\frac{e^{x}}{\left(e^{x}-1\right)^{2}}\right)=\lim\limits _{x\to0}\left(\frac{\left(e^{x}-1\right)^{2}-x^{2}e^{x}}{x^{2}}\right)=\lim\limits _{x\to0}\left(\frac{\left(1+x+\frac{x^{2}}{2}+\frac{x^{3}}{6}+R_{3}\left(x\right)-1\right)^{2}-x^{2}\left(1+x+\frac{x^{2}}{2}+\frac{x^{3}}{6}+R_{3}\left(x\right)\right)}{x^{2}}\right)=\lim\limits _{x\to0}\left(\frac{\frac{1}{3}R_{3}\left(x\right)x^{4}+R_{3}^{2}\left(x\right)x^{2}+2x^{2}R_{3}\left(x\right)+\frac{x^{6}}{36}+\frac{x^{4}}{12}}{x^{2}}\right)=\lim\limits _{x\to0}\left(\frac{R_{3}\left(x\right)\left(\frac{1}{3}x^{4}+R_{3}\left(x\right)x^{2}+2x^{2}\right)}{x^{2}}\right)=\lim\limits _{x\to0}\left(R_{3}\left(x\right)\left(\frac{1}{3}x^{2}+R_{3}\left(x\right)+2\right)\right)$$
the number $\frac{1}{12}$ appears here but then goes away since $x^4$ goes to zero. There must be a simpler way then opening the brackets here, and making all those tedious calculations.
 [/INST] You have $(e^x-1)^2-x^2e^x=e^{2x}-(x^2+2)e^x+1$ and the first $5$ terms of the Taylor series of this function are simply $\frac{x^4}{12}$. And the first $5$ terms of the Taylor series of $x^2(e^x-1)^2$ are simply $x^4$. Therefore your limit is indeed $\frac1{12}$.
</s>