# If $\large\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}n=a$ then what is the value of $\large\sum_{n=1}^{\infty}\frac1n\cos\frac{n\pi}2$?

If $$\large\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}n=a$$ then what is the value of $$\large\sum_{n=1}^{\infty}\frac1n\cos\frac{n\pi}2$$ ?

$$1)\frac{-a_1}2\qquad\qquad2)-\frac a2\qquad\qquad3)\frac{a-a}2\qquad\qquad4)\frac a2$$

To solve this problem I just evaluated each sum:

$$a=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}n=\frac11-\frac12+\frac13-\frac14+\cdots$$ $$\sum_{n=1}^{\infty}\frac1n\cos\frac{n\pi}2=-\frac12+\frac14-\frac16+\cdots$$ Then noticed that if I multiply the terms of the first sums by $$-\frac12$$ It gives me the second sum. so the answer is$$-\frac a2$$.

But is it possible to solve this question without writing and adding the terms of each sum and comparing the terms?

\begin{align*} \sum_{n=1}^{\infty}\frac{1}{n}\cos\left(\frac{\pi n}{2}\right) &= \sum_{k=1}^{\infty}\frac{1}{2k}\cos\left(\pi k\right) \\ &=\sum_{k=1}^{\infty}\frac{(-1)^{k}}{2k}\\ &=-\frac{1}{2}\sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{k} \end{align*}