This is one of the HW questions I'm trying to solve
Find the first four terms of this Maclaurin Series of $$f(x)=\cos\left(\frac{x}{x+1}\right)$$
I tried using $\sum_{n=0}^\infty (-1)^n \frac{x^{2n}}{2n!} = \cos x $ and $ \sum_{n=0}^\infty (-1)^n x^n= \frac{1}{1+x}$ but no luck! I can't properly substitute the derivative of the series in the Maclaurin Series.
Also related to this question is its second part$$ \sum_{} (n)^p (\cos (\frac{1}{n-1})-\cos(\frac{1}{n})$$ for what values of $p$ it converges or diverges.
I would really appreciate it if someone could type in a detailed solution so I can improve my understanding of this topic.