<s>[INST] How to find the Maclaurin series for $f(x) = \frac{1}{1 + \sin(x)}$? I have that $\frac{1}{1 + x} = 1 - x + x^2 - x^3 + ...$
So then $\frac{1}{1 + \sin(x)}$ should be $ 1 - \sin(x) + \sin^2(x) - \sin^3(x) + ...$ but clearly this is not the case. 
So how does substitution into Maclaurin series work and why does this not work? 
 [/INST] By substitution of the expansion of $\sin x$ at the required order in the expansion of $\dfrac1{1+u}$ at the same order.
Example for order 5:
$$\dfrac1{1+u}=1-u+u^2-u^3+u^4-u^5+o(u),\qquad \sin x=x-\frac{x^3}6+\frac{x^5}{120}+o(x5),$$
whence
\begin{align*}
\sin^2x&=x^2-\frac{x^4}3+o(x^5)&\sin^3x&=\Bigl(x^2-\frac{x^4}3+o(x^5)\Bigr)\Bigl(x-\frac{x^3}6+\frac{x^5}{120}+o(x^5)\Bigr)=x^3-\frac{x^5}2+o(x^5)\\
\sin^4x&=x^4+o(x^5)& \sin^5x&=x^5,
\end{align*}
so we have
\begin{align*}
\dfrac1{1+\sin x}&=1-\Bigl(x-\frac{x^3}6+\frac{x^5}{120}\Bigr)+\Bigl(x^2-\frac{x^4}3\Bigr)-\Bigl(x^3-\frac{x^5}2\Bigr)+x^4-x^5+o(x^5)\\&=1-x+x^2-\frac{5x^3}6+\frac{2x^4}3-\frac{61x^5}{120}+o(x^5).
\end{align*}
</s>