An alternative proof for sum of alternating series evaluates to $\frac{\pi}{4}\sec\left(\frac{a\pi}{4}\right)$
Solution 1:
$$\begin{eqnarray*}\sum_{n=0}^\infty\left(\frac{(-1)^n}{4n-a+2}+\frac{(-1)^n}{4n+a+2}\right)&=&\sum_{n=0}^{+\infty}\int_{0}^{1}(-1)^n x^{4n+1}\left(x^a+x^{-a}\right)\,dx \\&=& \int_{0}^{1}\frac{x}{1+x^4}\left(x^a+x^{-a}\right)\,dx\end{eqnarray*}$$ hence we have that our integral equals: $$ \frac{1}{8}\left(\psi\left(\frac{6+a}{8}\right)-\psi\left(\frac{2+a}{8}\right)+\psi\left(\frac{6-a}{8}\right)-\psi\left(\frac{2-a}{8}\right)\right)$$ but since: $$ \psi(x)-\psi(1-x) = -\pi\cot(\pi x) $$ the previous line equals: $$ \frac{\pi}{8}\left(\tan\left(\frac{\pi}{8}(a+2)\right)-\tan\left(\frac{\pi}{8}(a-2)\right)\right) $$ that simplifies to: $$ \frac{\pi}{4}\sec\frac{a\pi}{4}$$ as wanted.
Solution 2:
I answered this before in Closed form of $\int_{0}^{\infty} \frac{\tanh(x)\,\tanh(2x)}{x^2}\;dx$. However the solution was too long as Venus mentioned. Inspired from Jack D'aurizio's answer, I have a simple solution for this. It is easy to check that \begin{eqnarray*} &&\sum_{n=0}^\infty\left(\frac{(-1)^n}{4n-a+2}+\frac{(-1)^n}{4n+a+2}\right)\\ &=& \int_{0}^{1}\frac{x}{1+x^4}\left(x^a+x^{-a}\right)\,dx=\int_{0}^{\infty}\frac{x^{a+1}}{1+x^4}\,dx\\ &=&\frac{1}{a+2}\int_0^\infty\frac{1}{1+x^{\frac{a+2}{4}}}dx. \end{eqnarray*} Now using the following well-known integral $$ \int_0^\infty\frac{1}{1+x^n}dx=\frac{\pi}{n\sin(\pi/n)}, \text{ for }n>1, $$ (for example, see Prove $\int_0^{\infty}\! \frac{\mathbb{d}x}{1+x^n}=\frac{\pi}{n \sin\frac{\pi}{n}}$ using real analysis techniques only) it is easy to get the answer.