$\lim_{x\rightarrow0}\frac{1-\left(\cos x\right)^{\ln\left(x+1\right)}}{x^{4}}$ Could you please check if I derive the limit correctly?
$$\lim_{x\rightarrow0}\frac{1-\left(\cos x\right)^{\ln\left(x+1\right)}}{x^{4}}=\lim_{x\rightarrow0}\frac{1-\left(O\left(1\right)\right)^{\left(O\left(1\right)\right)}}{x^{4}}=\lim_{x\rightarrow0}\frac{0}{x^{4}}=0$$
 A: $$1-(\cos{x})^{\log{(1+x)}} = 1-e^{\log{\cos{x}} \log{(1+x)}} $$
$$\begin{align}\log{\cos{x}} &= \log{\left ( 1-\frac{x^2}{2!} + \frac{x^4}{4!}+\cdots \right )}\\ &= \left (-\frac{x^2}{2!} + \frac{x^4}{4!}+\cdots \right ) - \frac12\left (-\frac{x^2}{2!} + \frac{x^4}{4!}+\cdots \right )^2+\cdots \\ &= -\frac{x^2}{2}-\frac{x^4}{12} + \cdots \end{align}$$
$$\begin{align}\log{\cos{x}} \log{(1+x)} &= \left ( -\frac{x^2}{2}-\frac{x^4}{12} + \cdots \right ) \left (x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4}+\cdots \right )\\ &= -\frac{x^3}{2} \left ( 1+\frac{x^2}{6}+\cdots \right ) \left (1 - \frac{x}{2} + \frac{x^2}{3} +\cdots \right ) \\ &= -\frac{x^3}{2} + \frac{x^4}{4} + \cdots \end{align}$$
$$\begin{align}1-e^{\log{\cos{x}} \log{(1+x)}} &= -\left (-\frac{x^3}{2} + \frac{x^4}{4} + \cdots \right ) - \frac1{2!} \left (-\frac{x^3}{2} + \frac{x^4}{4} + \cdots \right )^2+\cdots \\ &= \frac{x^3}{2} - \frac{x^4}{4} + \cdots\end{align}$$
Thus,
$$\lim_{x\to 0} \frac{1-(\cos{x})^{\log{(1+x)}}}{x^4} = \lim_{x\to 0} \left (\frac{1}{2 x} - \frac14 + \cdots \right) = \infty $$
A: By your logic:
$$\lim_{x\to 0}\frac{1 - \cos x}{x^2} = \lim_{x\to 0}\frac{1-O(1)}{x^2} = \lim_{x\to 0}\frac{0}{x^2} = 0$$
but in actual fact, the limit should be equal to $\frac12$
A: We can proceed as follows:
\begin{align}
L &= \lim_{x \to 0}\frac{1 - (\cos x)^{\log(1 + x)}}{x^{4}}\notag\\
&= \lim_{x \to 0}\frac{1 - \exp\{\log(1 + x)\log(\cos x)\}}{x^{4}}\notag\\
&= \lim_{x \to 0}\frac{1 - \exp\{\log(1 + x)\log(\cos x)\}}{\log(1 + x)\log(\cos x)}\cdot\frac{\log(1 + x)\log(\cos x)}{x^{4}}\notag\\
&= \lim_{y \to 0}\frac{1 - e^{y}}{y}\cdot\lim_{x \to 0}\frac{\log(1 + x)}{x}\cdot\frac{\log \cos x}{x^{3}}\notag\\
&= -1\cdot 1\lim_{x \to 0}\frac{\log(1 + \cos x - 1)}{x^{3}}\notag\\
&= -\lim_{x \to 0}\frac{\log(1 + \cos x - 1)}{\cos x - 1}\cdot\frac{\cos x - 1}{x^{3}}\notag\\
&= -\lim_{z \to 0}\frac{\log(1 + z)}{z}\cdot\lim_{x \to 0}\frac{\cos^{2}x - 1}{x^{3}(\cos x + 1)}\notag\\
&= -\lim_{x \to 0}\frac{1}{1 + \cos x}\cdot\frac{-\sin^{2}x}{x^{2}}\cdot\frac{1}{x}\notag\\
&= -\frac{1}{2}\cdot (-1)\cdot\lim_{x \to 0}\frac{1}{x}\notag\\
&= \infty
\end{align}
Here $y = \log(1 + x)\log(\cos x) \to 0$ as $x \to 0$ and $z = \cos x - 1 \to 0$ as $x \to 0$. We see that effective use of standard limits is sufficient in many seemingly tough limit problems and there is no need for higher level theorems like Taylor or L'Hospital Rule.
Also as mentioned in one of the comments (to the question) we can see that had the denominator been $x^{3}$ there would not have been the factor $1/x$ in the second last line of our derivation and the limit would have been $1/2$.
