This is one of the HW questions I’m trying to solve

$$f(x)=cos(frac{x}{x+1})$$

Find the first four terms of this Maclaurin Series…

I tried using $sum_{n=0}^infty (-1)^n frac{x^{2n}}{2n!} = cosx $ & $ 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.