In my last question: Does $\sum _n \int_0^{\frac{\pi }{2}} \cos ^n(x) \, dx$ converge? I've managed to transform the expression using: https://en.wikipedia.org/wiki/Monotone_convergence_theorem
Could sb help me just with this transformation in a bit more complex example? How may I treat $(-1)^n$ inside the sum?
For $\frac{\pi}{2}\ge x\gt 0$, $\sum_{n=0}^\infty (-cos(x))^n=\frac {1}{1+cos(x)}$. For $x=0$, the sum does not converge but the partial sums are bounded , either $=0$ or $=1$, so the integral is not a problem. I'll leave to you to get$\int_0^{\frac{\pi}{2}} \frac{1}{1+cos(x)}dx$.