Evaluating limits using Taylor's expansion. Evaluate the following limit : $\lim_{x \to 0}(\frac{1}{\log(\cos(x))}+\frac{2}{\sin^2(x)})$
Generally speaking I have no idea at what order should I stop the Taylor's expansion.
I've tried this using two different orders and i've gotten both the results 1 and 0.
If anyone could point out how I should pick the order of the expansion i would be grateful!

$$\lim \limits_{x \to 0}\left(\frac{1}{\log(\cos(x))}+\frac{2}{\sin^2(x)}\right)=\lim \limits_{x \to 0}\frac{\sin^2x+2\ln\cos x}{\sin^2x\ln\cos x}$$
We can stop Taylor's expansion at the denominator to the first (different from zero) term, because it's a product and nothing is going to cancel. So if $x$ tends to $0$ we have
$$\sin^2x\ln\sin x=\left(x^2+o(x^2)\right)\ln\left(1-\frac{x^2}{2}+o(x^2)\right)=\left(x^2+o(x^2)\right)\left(-\frac{x^2}{2}+o(x^2)\right)=$$
$$=-\frac{x^4}{2}+o(x^4)$$
So we need $x^4$ "precision" on the numerator too, to avoid approximation errors. Hence
$$\sin^2x+2\ln\cos x=\left(x-\frac{x^3}{6}+o(x^3)\right)^2+2\ln\left(1-\frac{x^2}{2}+\frac{x^4}{24}+o(x^4)\right)=$$
$$=x^2-\frac{x^3}{6}-\frac{x^4}{3}+o(x^4)+2\left(-\frac{x^2}{2}+\frac{x^4}{24}-\frac{1}{2}\left(-\frac{x^2}{2}\right)^2+o(x^4)\right)$$
So finally we have
$$\lim \limits_{x \to 0}\left(\frac{1}{\log(\cos(x))}+\frac{2}{\sin^2(x)}\right)=\lim \limits_{x \to 0}\frac{-\frac{x^4}{2}+o(x^4)}{-\frac{x^4}{2}+o(x^4)}=1$$
