<s>[INST] Maclaurin Expansion of $f(x)=\ln (\cos x)$ Find up to the $x^4$ term in the Maclaurin expansion of $f(x)=\ln (\cos x)$
I've only just learnt about Maclaurin Series today so I'm not too familiar with them. Do I have to find up to the 4th derivative (I've tried it and it gets quite messy) or can I use one of the known expansions to do this?
 [/INST] We have $\cos x = 1 + h(x)$, where $h(x) = -\frac{1}{2}x^2 + \frac{1}{24}x^4 + O(x^6)$ as $x \to 0$. 
Since $h(x) \to 0$, we have
$$f(x) = \ln(\cos x) = \ln(1 + h(x)) = h(x) -\frac{1}{2}h(x)^2 + O(h(x)^3).$$
Since $h(x) \sim -\frac{1}{2}x^2$, we have $h(x)^3 \sim -\frac{1}{8}x^6$, so $O(h(x)^3) = O(x^6)$. Thus
$$
\begin{align*}
f(x) &=  -\frac{1}{2}x^2 + \frac{1}{24}x^4 + O(x^6) -\frac{1}{2}[-\frac{1}{2}x^2 + O(x^4)]^2 + O(x^6) \\
&= - \frac{1}{2}x^2 + \frac{1}{24}x^4 + O(x^6) - \frac{1}{8} x^4 + O(x^6) + O(x^6) \\
&= -\frac{1}{2}x^2 - \frac{1}{12}x^4 + O(x^6).
\end{align*}
$$
</s>