The answer of the following limit: $$ \lim_{x \rightarrow 0}\left(\frac{1}{\ln \cos (x)}+\frac{2}{\sin ^{2}(x)}\right) $$ is 1 by Wolfram Alpha.
But I tried to find it and I got $2/3$ :
My approach :
$1)$ $ \ln(\cos x)=\ln\left(1-\frac{x^{2}}{2}+o\left(x^{3}\right)\right)=-\frac{x^{2}}{2}+o\left(x^{3}\right) $
$2)$ $ \sin ^{2}(x)=\left(x-\frac{x^{3}}{3!}+o\left(x^{3}\right)\right)^{2}=x^{2}-\frac{x^{4}}{3}+o\left(x^{4}\right) $
$3)$
$\begin{aligned} \frac{1}{-\frac{x^{2}}{2}+o\left(x^{3}\right)}+\frac{2}{x^{2}-\frac{x^{4}}{3}+o\left(x^{4}\right)}=\frac{-x^{2}+x^{2}-\frac{x^{4}}{3}+o\left(x^{3}\right)}{-\frac{x^{4}}{2}+o\left(x^{5}\right)}=\frac{-\frac{1}{3}+o\left(x^{3}\right)}{-\frac{1}{2}+o\left(x^{5}\right)} \end{aligned}$
$4)$ $\lim _{x \rightarrow 0} \frac{-\frac{1}{3}+o\left(x^{3}\right)}{-\frac{1}{2}+o\left(x^{5}\right)}=\frac{-\frac{1}{3}}{-\frac{1}{2}}=\frac{2}{3}$
So where is the mistake in my approach?
Note: $o$ denotes the little-o notation
Edit : I've understood where's my mistake is, but another question popped up reading the answers which is : does $o(1/x)$ tends to zero as x tends to zero?
It is because when you expand $\cos(x)$ and $\ln(\cos(x))$, you need to consider more fourth-order term. Specifically,
$$\cos(x)=1-\frac{x^2}{2}+\frac{x^4}{24}+o(x^5).$$ Then $$\ln\left(\cos(x)\right)=-\frac{x^2}{2}+\frac{x^4}{24}-\frac{\left(-\frac{x^2}{2}+\frac{x^4}{24}\right)^2}{2}+o(x^5)=-\frac{x^2}{2}-\frac{x^4}{12}+o(x^5).$$ With the same expression for $\sin(x)$ as you have written, we obtain \begin{align*} \frac{1}{\ln\left(\cos(x)\right)}+\frac{2}{\sin^2(x)}&=\frac{1}{-\frac{x^2}{2}-\frac{x^4}{12}+o(x^5)}+\frac{2}{x^2-\frac{x^4}{3}+o(x^4)}\\ &=\frac{x^2-\frac{x^4}{3}-x^2-\frac{x^4}{6}}{-\frac{x^4}{2}+o(x^4)}\\ &=\frac{x^4}{x^4+o(x^4)}. \end{align*}