Prove $\frac1{2πi}\int_C\frac{ζ^2(1-n)z^{-n}}{2\cos(nπ/2)}\,{\rm d}n=-γ-\frac12\log z-\frac1{4πz}+\frac zπ\sum\limits_{n=1}^{+∞}\frac{τ(n)}{z^2+n^2}$ I'm wondering on how one can go about proving that
$$\frac{1}{2\pi \imath} \int_{\left(\mathcal{C}\right)} \frac{\zeta^2(1-n)\,z^{-n}}{2\cos\left(n\pi /2\right)}\,\mathrm{d}n = -\gamma -\frac12 \log z - \frac{1}{4\pi z}+\frac{z}{\pi}\sum_{n= 1}^{+\infty} \frac{\tau(n)}{z^2+n^2}$$
where $\tau(n)$ represents the divisor function, $\gamma$ denotes the Euler-Mascheroni constant, $\zeta$ represents the Riemann zeta function, $1<\mathcal{C}<2$ and $\int_{(\mathcal{C})}$ denotes the line integral $\int_{\mathcal{C}-\imath \infty}^{\mathcal{C} + \imath\infty}$.
So far I tried complex analytic methods (Residue theorem and contour integration) but no progress.
Any help would be highly appreciated.
 A: I'd say shift the contour to the left to reach the region where $\zeta(1-s)^2=\sum_{m\ge 1} \tau(m) m^{s-1}$ converges absolutely and uniformly on the vertical lines.
No problem to do so because $\zeta(s)$ is $O(|s|^r)$ in the vertical strip so the exponential decay of $1/\cos(\pi s/2)$ makes it ok.
This will add two residues at $0$ and $1$.
Then use the absolute/uniform convergence to say that $$\int_{(-1/2)} \frac{\zeta(1-s)^2}{2 \cos(\pi s/2)} z^{-s}ds=\sum_{m\ge 1} \tau(m)\int_{(-1/2)} \frac{m^{s-1}}{2 \cos(\pi s/2)} z^{-s}ds$$
Where the last integral is easily computed with the residue theorem,  for $z\in (0,1)$:
$$\int_{(-1/2)} \frac{m^{s-1}}{2 \cos(\pi s/2)} z^{-s}ds = 2i\pi \sum_{k=0}^\infty Res(\frac{m^{s-1}}{2 \cos(\pi s/2)} z^{-s},-2k-1)$$ $$=
2i \sum_{k=0}^\infty \frac{m^{-2k-2}}{(-1)^k} z^{2k+1}
 = \frac{2i z}{m^2+z^2}
$$
You can extend to the remaining $z\in \Bbb{C}-i \Bbb{Z}_{\ge 1}$ by analytic continuation.
A: Note that
$$\frac{\zeta(1-s)^2}{2\cos\left(\pi s/2\right)}=\frac{1}{2\cos\left(\pi s/2\right)}\sum\limits_{n=1}^\infty\frac{\tau(n)}{n^{1-s}}\ ,\ \Re(s)<0\tag{1}$$
which according to both WolframAlpha and Mathematica leads to:
$$\frac{1}{2 \pi i} \int\limits_{c-i\infty}^{c+i\infty} \frac{\zeta(1-s)^2}{2\cos\left(\pi s/2\right)}\,x^{-s}\,ds=\frac{x}{\pi}\sum\limits_{n=1}^\infty\frac{\tau(n)}{x^2+n^2}\tag{2}$$.

See WolframAlpha evaluation of the relevant inverse Mellin transform where $\tau(n)=\sigma_0(n)$. Mathematica provides the same result as WolframAlpha and indicates the result is valid for $-1<\Re(s)<1$, but I'm wondering if $-1<c<0$ should really be the condition on formula (2) above.

Note formula (2) above omits the $-\gamma-\frac12\log x$ and $-\frac{1}{4 \pi x}$ terms associated with the residues of $\frac{\zeta(1-s)^2}{2\cos\left(\pi s/2\right)}\,x^{-s}$ at $s=0$ and $s=1$ respectively, but these terms also need to be included according to a comment by @Gary below and the alternate answer posted by @reuns which also provides a derivation of the right-side of formula (2) above.

The approach taken above (which is also echoed in the alternate answer posted by @reuns) doesn't seem to directly address the question since the OP expressed a desire to evaluate the inverse Mellin transform specified on the left-side of formula (2) above where $1<c<2$.

Note that
$$\frac{\zeta(1-s)^2}{2 \cos\left(\frac{\pi s}{2}\right)}=2^{1-2 s} \pi ^{-2 s} \cos \left(\frac{\pi  s}{2}\right) \Gamma (s)^2 \sum _{n=1}^\infty\frac{\tau(n)}{n^s}\ ,\ \Re(s)>1\tag{3}$$
which according to Mathematica leads to
$$\frac{1}{2 \pi i} \int\limits_{c-i\infty}^{c+i\infty} \frac{\zeta(1-s)^2}{2 \cos\left(\frac{\pi s}{2}\right)}\,x^{-s}\,ds=\sum _{n=1}^\infty\tau(n)\ G_{0,4}^{3,0}\left(n \pi ^2 x,\frac{1}{2}|
\begin{array}{c}
 0,0,\frac{1}{2},\frac{1}{2} \\
\end{array}
\right)\tag{4}$$
where $G$ is the MeijerG function.

Mathematica indicates the result in formula (4) above is valid for $\Re(s)>0$, but I'm wondering if $c>1$ should really be the condition on formula (4) above.
