Maclaurin series of $\frac{1}{1+\sin x}$ Find the terms through degree four of the Maclaurin series of $f(x)$.
$$f(x) = \frac{1}{1+\sin x}$$
My work:
The Maclaurin series for $\sin x$ up to degree $4$ is $x - \frac{x^3}{6} + \frac{x^5}{120}$
The Maclaurin series for $\frac{1}{1+x}$ up to degree $4$ is $1 - x + x^2 - x^3 + x^4$
I substituted $x - \frac{x^3}{6} + \frac{x^5}{120}$ for $x$ in $1 - x + x^2 - x^3 + x^4$
Did I do this right? 
Plugging this into WolframAlpha, I get this: http://goo.gl/SKddyh
Which doesn't seem like the answer in the text: $1-x+x^2-\frac{5x^3}{6}+\frac{2x^4}{3}$
 A: Have a look at this:
Your equation, expanded
As you can see, what you plugged into WolframAlpha was the same equation as the answer in the text.
A: You did it right. The answer on WolframAlpha is the same. Try typing "expand" in front on WA.
A: Your answer is correct, but there is a somewhat simpler method. You are looking for a polynomial $P=a+bx+cx^2+dx^3+ex^4$ such that $P\times(1+x-\frac{x^3}6)\equiv 1\pmod{x^5}$. This gives (by comparing coefficients of $x^0,x^1,\ldots,x^4$) the equations
$$
  \begin{align}a&=1\\a+b&=0\\b+c&=0\\-\tfrac16a+c+d&=0\\-\tfrac16b+d+e&=0,
  \end{align}
$$
which you can solve straight away as $a=1$, $b=-1$, $c=1$, $d=-\tfrac56$, $e=\tfrac23$.
A: You did it right and nothing has to be added to the answers you received.
I do not know if you were obliged to use these steps since there is a direct way of doing this expansion applying the basic rules, that is to say that the Taylor series of $f(x)$ built at $x=0$ just write (up to the fourth degree)
$$f(0)+x f'(0)+\frac{1}{2} x^2 f''(0)+\frac{1}{6} f^{(3)}(0) x^3+\frac{1}{24}
   f^{(4)}(0) x^4+O\left(x^5\right)$$ The value of the function and its first four derivatives are $1,-1 ,2,-5,16$ (they are easy to evaluate bcause $sin(0)=0$ and $cos(0)=1$). 
For sure, you arrive to your result.  
You also have another way : replace in the denominator $sin(x)$ by its Taylor expansion and perform the long division of numerator by denominator.
You have done a good job ! Congratulations.
A: For $k,n\in\mathbb{N}=\{1,2,\dotsc\}$, partial Bell polynomials $\textrm{B}_{n,k}$ satisfy
\begin{equation}\label{bell-sin=ans=0}\tag{BWSC}
\textrm{B}_{n,k}\biggl(1,0,-1,0,\dotsc, \cos\frac{(n-k)\pi}{2}\biggr)
=2^{n-k}\cos\frac{(n-k)\pi}2 R\biggl(n,k,-\frac{k}{2}\biggr),
\end{equation}
where
\begin{equation}\label{S(n,k,x)-satisfy-eq}
R(n,k,r)=\frac1{k!}\sum_{j=0}^k(-1)^{k-j}\binom{k}{j}(r+j)^n
\end{equation}
for $r\in\mathbb{R}$ and $n\ge k\ge0$ denotes weighted Stirling numbers of the second kind, see Carlitz's paper [1] below.
The formula \eqref{bell-sin=ans=0} and its proof can be found in Theorem 1.2 of [2] and Section 1.6 of [3] below.
By virtue of the Faa di Bruno formula and the equation \eqref{bell-sin=ans=0}, one can readily discover the series expansion
\begin{equation}\label{sin-recip-ser-expan}\tag{SQE}
\boxed{\frac{1}{1+\sin x}=1+\sum_{k=1}^{\infty}(-1)^{k}\Biggl[\sum_{\ell=0}^{\lfloor{(k-1)/2}\rfloor} (-1)^{\ell} (k-2\ell)! 2^{2\ell} R\biggl(k,k-2\ell,-\frac{k-2\ell}{2}\biggr)\Biggr]\frac{x^k}{k!}}
\end{equation}
for $|x|<\frac{\pi}{2}$, where $\bigl\lfloor{\frac{k-1}{2}}\bigr\rfloor$ stands for the floor function whose value is equal to the largest integer less than or equal to $\frac{k-1}{2}$.
References

*

*L. Carlitz, Weighted Stirling numbers of the first and second kind, I, Fibonacci Quart. 18 (1980), no. 2, 147--162.

*F. Qi, Derivatives of tangent function and tangent numbers, Appl. Math. Comput. 268 (2015), 844--858; available online at http://dx.doi.org/10.1016/j.amc.2015.06.123.

*F. Qi, D.-W. Niu, D. Lim, and Y.-H. Yao, Special values of the Bell polynomials of the second kind for some sequences and functions, J. Math. Anal. Appl. 491 (2020), no. 2, Article 124382, 31 pages; available online at https://doi.org/10.1016/j.jmaa.2020.124382.

