Alternative method for expanding $\dfrac{1}{1+\sin(x)}$

$$\dfrac{1}{1+\sin x} = P$$
Cross multiplying
$$P(1+\sin x) = 1$$
Plugin Maclaurin series for $\sin x$
$$P(1+x - \frac{x^3}{6} + \frac{x^5}{120}-\cdots)=1$$
Compare coefficients both sides upto $x^4$ term.
($\mod x^5$ is just a fancy of way saying abive line. You may forget about it if it confuses.)


The notation $1 \bmod x^5$ doesn't have anything in particular to do with the answer.

The notation $$F(x) \equiv 1 \pmod {x^5},$$ where $F$ is a polynomial function, means there is some polynomial $Q(x)$ such that $$ F(x) = 1 + x^5 Q(x). $$ A little less formally, it means $F(x)$ is a polynomial with a constant term $1,$ and all other non-zero terms of $F(x)$ are degree $5$ or higher. That is, $$ F(x) = 1 + 0x + 0x^2 + 0x^3 + 0x^4 + f_5x^5 + f_6x^6 + \cdots .\tag1$$

The reason we're interested in this in this answer is that we're really looking for the Taylor series of a function $p$ such that $$ p(x) \times (1 + \sin x) = 1. $$ But since we're only looking for the terms up through $x^4$, the $x^5$ and higher terms don't matter. So by saying we don't care about errors the product of our functions for terms in $x^5$ or higher, we are able to ignore the terms in $x^5$ or higher in the Taylor expansions of $p(x)$ and $1 + \sin x.$ We can truncate the Taylor series of $p(x)$ to just the polynomial $P(x) = a+bx+cx^2+dx^3+ex^4$, and we can truncate the Taylor series of $1 + \sin x$ to just $1 + x - \frac16 x^3,$ because everything else only affects the $x^5$ and higher terms.

So we end up with $$(a+bx+cx^2+dx^3+ex^4) \times \left(1 + x - \frac16 x^3\right) \equiv 1 \pmod {x^5}.$$

Now if you take the trouble to multiply out the thing on the left to write it as a single polynomial in standard form, you'll find that the constant term and the coefficients for $x,$ $x^2,$ $x^3,$ and $x^4$ are the left-hand sides of the equations in the red box. And Equation $(1)$ in this answer says that the constant term is $1$ and the next four coefficients are all zero, so those are the numbers on the right-hand side of the equations in the red box. (Two polynomials are equal if their coefficients are equal term by term.)