An alternative proof for sum of alternating series evaluates to $\frac{\pi}{4}\sec\left(\frac{a\pi}{4}\right)$ How does one prove the given series? $$\sum_{n=0}^\infty\left(\frac{(-1)^n}{4n-a+2}+\frac{(-1)^n}{4n+a+2}\right)=\frac{\pi}{4}\sec\left(\frac{a\pi}{4}\right)$$
This series came up in xpaul's calculation during the process of answering my homework problem. I really appreciate his help for me but I am looking a method to prove the above series using a real analysis method because the link he cited (Ron G's answer) to help me to prove it is using the residue theorem. I worked for a while on this today but was unsuccessful. 
$$\begin{align}\sum_{n=0}^\infty\left(\frac{(-1)^n}{4n-a+2}+\frac{(-1)^n}{4n+a+2}\right)&=4\sum_{n=0}^\infty(-1)^n\frac{2n+1}{(4n+2)^2-a^2}\\&=\sum_{n=0}^\infty(-1)^n\frac{2n+1}{(2n+1)^2-\left(\frac{a}{2}\right)^2}\end{align}$$
Comparing with Taylor series for secant, hyperbolic secant, or any other well known series forms but I could not get any of them to work,  perhaps someone else can? I would like a nice proof and avoiding residue method in order to complete my homework's answer. Would you help me? Any help would be appreciated. Thanks in advance.
 A: $$\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.
A: 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.
