Solution (source code)

= Solution

Multiply the <Taylor series> $\cos x=1-x^2/2+O(x^4)$ by $(1-x)^{-1}=1+x+x^2+O(x^3)$. Counting the constant as the first nonzero term gives
$$
\boxed{\frac{\cos x}{1-x}=1+x+\frac{x^2}{2}+O(x^3).}
$$