<s>[INST] Evaluating limits using Taylor expansions The limits are
$$\lim_{x\to 0}(\frac{\cos{x}-e^{-x^2/2}}{x^4})$$
$$\lim_{x\to 0}\frac{e^x\cdot\!\sin{x}-x(1+x)}{x^3}$$
Probably wrong things that I've tried
$\lim_{x\to 0}\frac{\cos{x}-e^{-x^2/2}}{x^4}=\lim_{x\to 0}(\frac{1-\frac{x^2}{2!}+\frac{x^4}{4!}+o(x^5)-1+\frac{x^2}{2}+\frac{x^4}{4}+o(x^4)}{x^4})$
$\lim_{x\to 0}\frac{e^x\cdot\!\sin{x}-x(1+x)}{x^3}=\lim_{x\to 0}\frac{(1+x+\frac{x^2}{2}+o(x^2))(x+o(x^2))-x-x^2)}{x^3}=\lim_{x\to 0}\frac{\frac{x^3}{2}+o(x^2)}{x^3}=1/2$
Could you please help me understand how these kinds of limits can be computed I keep getting all of them wrong and if this goes on for a little bit longer I may have a panic attack.
 [/INST] The first rule is that, when you use Taylor's expansion, you use it at the same order for all terms. The second rule is that, when you have a product of expansions, or a composition, you expand it with the usual rules for polynomials, and truncate the result at the chosen order.
I'll start it for the first example, for which you had an error in the expansion of the exponential. We'll expand at order $4$:
\begin{align}
\cos x- \mathrm e^{-x^2/2}
&=1-\frac{x^2}2+\frac{x^4}{24}+o\bigl(x^4\bigr)-\Bigl(1-\frac{x^2}2+\frac{x^4}8+o\bigl(x^4\bigr)\Bigr)\\
&=\frac{x^4}{24}-\frac{x^4}8+o\bigl(x^4\bigr)=-\frac{x^4}{12}+o\bigl(x^4\bigr)
\end{align}
</s>