I need to solve $\phi (x,y) = \frac{2V}{\pi} \int_{0}^{\infty} \frac{\sin(kx)\cosh(ky) dk}{k\cosh(ka)}$ I start with a integral in complex plane $$\oint_c \frac{e^{izx} e^{zy} dz}{z\cosh(za)}$$ where $c$ is a countour starting in $z = -R$ along the real axis and jumping the pole at origin and continuing to $z = R$ and closing above the real axis with a semicircle circulating all the poles. I got $$\int_{0}^{\infty} \frac{e^{ky}\sin(kx)}{k\cosh(ky)}dk = \frac{\pi}{2} + 2\pi\sum_{n=1}^{\infty} (-1)^{n+1} \exp\left\{\frac{-xn\pi}{2a}\right\} \frac{\cos{\frac{yn\pi}{2a}}}{n}$$ and now i have no idea.
 A: Assuming your summation is correct we have
$$-\sum_{n=1}^\infty (-1)^ne^{-\frac{\pi n x}{2a}}\frac{e^{\frac{\pi n y}{2a}i}+e^{-\frac{\pi n y}{2a}i}}{2n}=-\frac{1}{2}\sum_{n=1}^\infty (-1)^n\frac{e^{-\frac{\pi n x}{2a}+\frac{\pi n y}{2a}i}}{n}-\frac{1}{2}\sum_{n=1}^\infty (-1)^n\frac{e^{-\frac{\pi n x}{2a}-\frac{\pi n y}{2a}i}}{n}.$$
This can be rewritten
$$-\frac{1}{2}\sum_{n=1}^\infty (-1)^n\frac{\left(e^{-\frac{\pi x}{2a}+\frac{\pi y}{2a}i}\right)^n}{n}-\frac{1}{2}\sum_{n=1}^\infty (-1)^n\frac{\left(e^{-\frac{\pi x}{2a}-\frac{\pi y}{2a}i}\right)^n}{n}.$$
Using the series $-\log(1+z)=\sum_{n=1}^\infty (-1)^n\frac{z^n}{n}$, $|z|<1$, we obtain
$$\frac{1}{2}\log\left(1+e^{-\frac{\pi x}{2a}+\frac{\pi y}{2a}i}\right)+\frac{1}{2}\log\left(1+e^{-\frac{\pi x}{2a}-\frac{\pi y}{2a}i}\right),$$ for $\left|e^{-\frac{\pi x}{2a}\pm\frac{\pi y}{2a}i}\right|=e^{-\frac{\pi x}{2a}}<1\implies \frac{\pi x}{2a}>0$.
Converting to trigonometric functions,
$$\frac{1}{2}\log 2+\frac{1}{2}\log\left(\cosh \left(\frac{\pi  x}{2 a}\right)-\sinh \left(\frac{\pi  x}{2 a}\right)\right)+\frac{1}{2}\log\left( \cosh \left(\frac{\pi  x}{2 a}\right)+\cos \left(\frac{\pi  y}{2 a}\right)\right).$$
Hence, your sum is
$$\frac{\pi}{2}+\pi\log 2+\pi\log\left(\cosh \left(\frac{\pi  x}{2 a}\right)-\sinh \left(\frac{\pi  x}{2 a}\right)\right)+\pi\log\left( \cosh \left(\frac{\pi  x}{2 a}\right)+\cos \left(\frac{\pi  y}{2 a}\right)\right).$$
Simplifying gives
$$\frac{\pi}{2}+\pi\log 2-\frac{\pi^2 x}{2a}+\log\left(\cos\left(\frac{\pi x}{2a}\right)+\cosh\left(\frac{\pi x}{2a}\right)\right).$$
A: We can dispose with the sums altogether by using a rectangular contour.  I would express the integral as
$$\phi(x,y) = \frac{V}{\pi} x \int_0^1 du \, \int_{-\infty}^{\infty} dk \frac{\cos{k x u} \cosh{k y}}{\cosh{k a}} $$
assuming $|y| \lt a$.  So consider the contour integral
$$\oint_{\gamma} dz \frac{\cos{z x u} \cosh{z y}}{\cosh{z a}} $$
where $\gamma$ is the rectangle with vertices $-R$, $R$, $R + i \pi/a$, $-R + i \pi/a$.  The contour integral is then equal to
$$\int_{-R}^R dk \frac{\cos{k x u} \cosh{k y}}{\cosh{k a}} + i \int_0^{\pi/a} d\nu \frac{\cos{(R+i \nu) x u} \, \cosh{(R+i \nu) y}}{\cosh{(R+i \nu) a}} \\ + \int_R^{-R} dk \frac{\cos{(k+i \pi/a) x u} \cosh{(k+i \pi/a) y}}{\cosh{(k+i \pi/a) a}}+ i \int_{\pi/a}^0 d\nu \frac{\cos{(-R+i \nu) x u} \, \cosh{(-R+i \nu) y}}{\cosh{(-R+i \nu) a}}$$ 
As $R \to \infty$ the second and fourth integrals vanish because $|y| \lt a$.  Also,
$$\cosh{(k+i \pi/a) a} = -\cosh{k a}$$
$$\cosh{(k+i \pi/a) y} = \cosh{k y} \cos{(\pi y/a)} + i \sinh{k y} \sin{(\pi y/a)} $$
$$\cos{(k+i \pi/a) x u} = \cos{k x u} \cosh{(\pi x u/a)} - i \sin{k u} \sinh{(\pi x u/a)} $$
Note that the integral over the imaginary part of the integrand will be zero as it is an odd function over a symmetric interval.  Thus, the contour integral is
$$[1+\cos{(\pi y/a)} \cosh{(\pi x u/a)}]\int_{-\infty}^{\infty} dk \frac{\cos{k x u} \cosh{k y}}{\cosh{k a}} \\+ \sin{(\pi y/a)} \sinh{(\pi x u/a)}\int_{-\infty}^{\infty} dk \frac{\sin{k x u} \sinh{k y}}{\cosh{k a}}$$
We have a second integral that we didn't bargain for.  We deal with it by considering the integral
$$\oint_{\gamma} dz \frac{\sin{z x u} \sinh{z y}}{\cosh{z a}} $$
which, using the same analysis as above, we find to be equal to
$$[1+\cos{(\pi y/a)} \cosh{(\pi x u/a)}]\int_{-\infty}^{\infty} dk \frac{\sin{k x u} \sinh{k y}}{\cosh{k a}} \\- \sin{(\pi y/a)} \sinh{(\pi x u/a)}\int_{-\infty}^{\infty} dk \frac{\cos{k x u} \cosh{k y}}{\cosh{k a}}$$
We apply the residue theorem by considering the respective residues at the pole $z=i \pi/(2 a)$ of each integrand.  If we denote the cosine integral as $C$ and the sine integral as $S$, then the residue theorem produces the equations
$$[1+\cos{(\pi y/a)} \cosh{(\pi x u/a)}] C + \sin{(\pi y/a)} \sinh{(\pi x u/a)} S = \frac{2 \pi}{a} \cosh{\left (\frac{\pi x u}{2 a} \right )} \cos{\left (\frac{\pi y}{2 a} \right )} $$
$$\sin{(\pi y/a)} \sinh{(\pi x u/a)} C - [1+\cos{(\pi y/a)} \cosh{(\pi x u/a)}] S = \frac{2 \pi}{a} \sinh{\left (\frac{\pi x u}{2 a} \right )} \sin{\left (\frac{\pi y}{2 a} \right )} $$
I will spare the reader the algebra involved and simply present the solution we seek:
$$C = \int_{-\infty}^{\infty} dk \frac{\cos{k x u} \cosh{k y}}{\cosh{k a}}  = \frac{2 \pi}{a} \frac{\cosh{\left (\frac{\pi x u}{2 a} \right )} \cos{\left (\frac{\pi y}{2 a} \right )}}{\cosh{\left (\frac{\pi x u}{a} \right )} + \cos{\left (\frac{\pi y}{a} \right )}}$$
Of course, we're not quite done because $C$ is not the integral we sought. Rather, we need to integrate $C$ with respect to $u$ to get that integral.  Thus,
$$\begin{align}\phi(x,y) &= \frac{2 V}{a} x \cos{\left (\frac{\pi y}{2 a} \right )} \int_0^1 du \frac{\cosh{\left (\frac{\pi x u}{2 a} \right )} }{\cosh{\left (\frac{\pi x u}{a} \right )} + \cos{\left (\frac{\pi y}{a} \right )}} \\ &= \frac{2 V}{\pi} \cos{\left (\frac{\pi y}{2 a} \right )} \int_0^1 \frac{d\sinh{\left (\frac{\pi x u}{2 a} \right )}}{ \sinh^2{\left (\frac{\pi x u}{2 a} \right )}+ \cos^2{\left (\frac{\pi y}{2 a} \right )} } \\ &= \frac{2 V}{\pi} \left [\arctan{\frac{\sinh{\left (\frac{\pi x u}{2 a} \right )}}{\cos{\left (\frac{\pi y}{2 a} \right )}}} \right ]_0^1\end{align}$$
Thus,

$$\phi(x,y) = \frac{2 V}{\pi} \arctan{\left [\frac{\sinh{\left (\frac{\pi x}{2 a} \right )}}{\cos{\left (\frac{\pi y}{2 a} \right )}}\right ]} $$

ADDENDUM
It should be noted that $\phi$ is clearly a solution of Laplace's equation for $x \ge 0$ and $|y| \le a$.  The boundary conditions appear to be $\phi(0,y) = 0$ and $\phi(x,\pm a) = V$.  Thus, this solution may be checked using a conformal mapping of the BC's to the right-half plane using the transformation $w=\sinh{[\pi z/(2 a)]}$.
A: I recently posted this same problem unaware that it had already been posted and responded to. 
I am sorry, but integrating w.r.t k seems backwards to me. k is more like a constant or sum index. Thus, I am using the usual x.
$$\int_{0}^{\infty}\frac{\sin(ax)\cosh(bx)}{x\cosh(\frac{\pi}{2}x)}$$
$$\;\ $$
$$\begin{align}=\int_{0}^{\infty}\frac{\sin(ax)}{x}\cdot \frac{e^{bx}+e^{-bx}}{e^{\pi x/2}+e^{-\pi x/2}}dx\end{align}$$
$$\;\ $$
$$\begin{align}=\int_{0}^{\infty}\frac{\sin(ax)}{x}\cdot \frac{e^{bx-\frac{\pi}{x}x}+e^{-bx-\frac{\pi}{2}x}}{1+e^{-\pi x}}\end{align}dx$$
$$\;\ $$
$$=\begin{align}\int_{0}^{\infty}\frac{\sin(ax)}{x}\sum_{n=0}^{\infty}(-1)^{n}e^{-\pi xn}(e^{bx-\frac{\pi}{2}n}+e^{-bx-\frac{\pi}{2}n})dx\end{align}$$
$$\;\ $$
$$\begin{align}=\sum_{n=0}^{\infty}(-1)^{n}\int_{0}^{\infty}\left(\frac{e^{-x(\pi n+\frac{\pi}{2}-b)}\sin(ax)}{x}+\frac{e^{-x(\pi n+\frac{\pi}{2}+b)}\sin(ax)}{x}\right)dx\end{align}$$
$$\;\ $$
The integral(s) here are rather famous Frullani-like integrals. Using the known result:  $$\;\ $$
$\displaystyle \int_{0}^{\infty}\frac{e^{-xt}\sin(ax)}{x}dx=\tan^{-1}\left(\frac{a}{t}\right)$, 
we have:
$$\begin{align}=\sum_{n=0}^{\infty}(-1)^{n}\tan^{-1}\left(\frac{a}{\pi n+\frac{\pi}{2}-b}\right)+\sum_{n=0}^{\infty}(-1)^{n}\tan^{-1}\left(\frac{a}{\pi n+\frac{\pi}{2}+b}\right)\end{align}$$
$$\;\ $$
Note that Ramanujan explored sums of this form in his First Notebook:
$$\begin{align}\tanh^{-1}\left(\frac{\sinh(a)}{\cos(b)}\right)=\Im \log\left(1+\frac{\sinh(a)}{\cos(b)}i\right)\end{align}$$
$$\;\ $$
$$\begin{align}
=\Im\log\left[\left(1+\frac{ia}{\frac{\pi}{2}\pm b}\right)\prod_{n=1}^{\infty}\left(1-\frac{ia}{2\pi n-(\frac{\pi}{2}\pm b)}\right)\left(1+\frac{ia}{2\pi n+\frac{\pi}{2}\pm b}\right)\times \left(1-\frac{ia}{(2n-1)\pi+\frac{\pi}{2}\pm b}\right)\left(1+\frac{ia}{(2n-1)\pi -(\frac{\pi}{2}\pm b)}\right)\right]\end{align}$$
$$\;\ $$
$$=\sum_{n=0}^{\infty}(-1)^{n}\tan^{-1}\left(\frac{a}{\pi n+c}\right)=\tan^{-1}\left(\frac{\sinh(a)}{\sin(c)}\right)$$
$$\;\ $$
Only in this case, $c=\frac{\pi}{2}\pm b\to \sin(\frac{\pi}{2}\pm b)=\cos(b)$, thus the result:
$$\;\ $$
$$\tan^{-1}\left(\frac{\sinh(a)}{\cos(b)}\right)=\cot^{-1}\left(\frac{\cos(b)}{\sinh(a)}\right)$$
follows.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\bbox[5px,#ffd]{\phi\pars{x,y} = {2V \over \pi} \int_{0}^{\infty}{\sin\pars{kx}\cosh\pars{ky}  \over k\cosh\pars{ka}}}\,\dd k}$

With $\ds{\alpha \equiv x/\verts{a}}$ and $\ds{\beta \equiv y/\verts{a}}$:
\begin{align}
&{\pi \over 2V\alpha}\,\phi\pars{x,y} \equiv
\bbox[5px,#ffd]{\int_{0}^{\infty}{\sin(k\alpha) \over k\alpha}{\cosh\pars{k\beta} \over \cosh\pars{k}}\dd k}
\\[5mm] = &\
\int_{0}^{\infty}{\sin(k\alpha) \over k\alpha}{2\sinh\pars{k}\cosh\pars{k\beta} \over \sinh\pars{2k}}\dd k
\\[5mm] & =
{\cal I}\pars{\alpha,1 + \beta} +
{\cal I}\pars{\alpha,1 - \beta}\label{1}\tag{1}
\end{align}
where
\begin{align}
{\cal I}\pars{\alpha,z} & \equiv
\int_{0}^{\infty}{\sin(k\alpha) \over k\alpha}{\sinh\pars{kz} \over \sinh\pars{2k}}\dd k
\\[5mm] = &\
\int_{0}^{\infty}\pars{{1 \over 2}
\int_{-1}^{1}\expo{\ic k\alpha q}\,\dd q}
{\expo{-k\pars{2 - z}} - \expo{-k\pars{z + 2}} \over
1 - \expo{-4k}}\dd k
\\[5mm] = &\
{1 \over 2}\int_{-1}^{1}\int_{0}^{\infty}
{\expo{-k\pars{2 - z - \ic\alpha q}}\,\, -
\expo{-k\pars{z + 2 - \ic\alpha q}} \over
1 - \expo{-4k}}\dd k\,\dd q
\\[5mm] = &\
{1 \over 8}\int_{-1}^{1}\int_{0}^{\infty}
{\expo{-k\pars{1/2 - z/4 - \ic\alpha q\,/4}}\,\,\,\, -
\expo{-k\pars{z/4 + 1/2 - \ic\alpha q\,/4}}\quad \over
1 - \expo{-k}}\,\dd k\,\dd q
\\[5mm] = &\
{1 \over 8}\int_{-1}^{1}
\bracks{%
\Psi\pars{{z \over 4} + {1 \over 2} - {\alpha\ic \over 4}\,q} -
\Psi\pars{{1 \over 2} - {z \over 4} - {\alpha\ic \over 4}\,q}}
\dd q
\end{align}
where I used the A & S Table ${\bf\color{black}{6.3.22}}$ identity.
Then,
\begin{align}
{\cal I}\pars{\alpha,z} & \equiv
\int_{0}^{\infty}{\sin(k\alpha) \over k\alpha}{\sinh\pars{kz} \over \sinh\pars{2k}}\dd k
\\[5mm] = &\
\left.{1 \over 8}\pars{{4 \over \alpha}\,\ic}
\ln\pars{\Gamma\pars{z/4 + 1/2 - \ic\alpha q/4} \over
\Gamma\pars{1/2 - z/4 - \ic\alpha q/4}}
\right\vert_{\,q\ =\ -1}^{\,q\ =\ 1}
\\[5mm] = &\
{\ic \over 2\alpha}\,
\ln\pars{{\Gamma\pars{1/2 + z/4 - \ic\alpha/4} \over
\Gamma\pars{1/2 - z/4 - \ic\alpha/4}}\,
{\Gamma\pars{1/2 - z/4 + \ic\alpha/4} \over
\Gamma\pars{1/2 + z/4 + \ic\alpha/4}}}
\\[5mm] = &\
{\ic \over 2\alpha}\,
\ln\pars{\sin\pars{\pi/2 - \pi z/4 - \ic\pi\alpha/4} \over
\sin\pars{\pi/2 + \pi z/4 - \ic\pi\alpha/4}}
\\[5mm] = &\
{\ic \over 2\alpha}\,
\ln\pars{\cos\pars{\pi z/4 + \ic\pi\alpha/4} \over
\cos\pars{\pi z/4 - \ic\pi\alpha/4}}
\\[5mm] = &\
{\ic \over 2\alpha}\,
\ln\pars{\cos\pars{\pi z/4}\cosh\pars{\pi\alpha/4}
-\ic\sin\pars{\pi z/4}\sinh\pars{\pi\alpha/4} \over
\cos\pars{\pi z/4}\cosh\pars{\pi\alpha/4} +
\ic\sin\pars{\pi z/4}\sinh\pars{\pi\alpha/4}}
\\[5mm] = &\
-\,{1 \over \alpha}\,\Im
\ln\pars{\cos\pars{\pi z/4}\cosh\pars{\pi\alpha/4}
-\ic\sin\pars{\pi z/4}\sinh\pars{\pi\alpha/4}}
\\[5mm] = &\
{1 \over \alpha}\,
\arctan\pars{\tan\pars{\pi z \over 4}\tanh\pars{\pi\alpha \over 4}}
\end{align}
Then ( see (\ref{1}) ),
\begin{align}
{\pi \over 2V\alpha}\,\phi\pars{x,y} & \equiv
\bbox[5px,#ffd]{\int_{0}^{\infty}{\sin(k\alpha) \over k\alpha}{\cosh\pars{k\beta} \over \cosh\pars{k}}\dd k}
\\[5mm] & =
{1 \over \alpha}\left\{%
\arctan\pars{\tan\pars{\pi\bracks{1 + \beta} \over 4}
\tanh\pars{\pi\alpha \over 4}}\right.
\\[2mm] &
\left.\phantom{{1 \over \alpha}\left\{\,\,\,\,\right.}
+ \arctan\pars{\tan\pars{\pi\bracks{1 - \beta} \over 4}
\tanh\pars{\pi\alpha \over 4}}\right\}
\\[5mm] & =
{1 \over \alpha}
\arctan\pars{\sinh\pars{\pi\alpha \over 2} \sec\pars{\pi\beta \over 2}}
\\[5mm] & =
{1 \over \alpha}
\arctan\pars{\sinh\pars{\pi x \over 2\verts{a}} \sec\pars{\pi y \over 2\verts{a}}}
\end{align}
Finaly,
\begin{align}
\phi\pars{x,y} & =
\bbx{{2V \over \pi}
\arctan\pars{\sinh\pars{\pi x \over 2\verts{a}}
\sec\pars{\pi y \over 2a}}} \\ &
\end{align}
