How did they sum this infinite series: $\sum_{n=1,3,5...} \frac1n e^{-\frac{n\pi x}a}\sin{\frac{n\pi y}a}$? I am studying Electrodynamics by Griffith. In potential chapter, I encountered this.

$$\sum_{n=1,3,5...} \frac{1}{n} e^{{\large -\frac{n\pi x}{a}}}\sin{\frac{n\pi y}{a}} = \frac{1}{2}  \arctan\left(\frac{\sin(\frac{\pi y}{a})}{\sinh(\frac{\pi x}{a})}\right)$$

Can anyone please show me how did he get this?
Any help will be appreciated!
 A: Hint. One may recall that, by the Taylor series expansion,
$$
\sum_{n=1}^{\infty} \frac{z^n}n=-\log (1-z), \quad |z|<1, \tag1
$$ giving
$$
\sum_{n=1,3,5...} \frac{z^n}{n}=\frac12\log \left(\frac{1+z}{1-z}\right), \quad |z|<1. \tag2
$$
Then one may apply $(2)$ with 
$$
z=e^{\Large -\frac{\pi x}a}e^{\Large -\frac{i\pi y}a}
$$ and take the imaginary parts, observing that
$$
\text{Im }\frac{z^n}n=\frac1ne^{\Large -\frac{\pi n x}a}\sin{\frac{n\pi y}{a}}, \qquad \text{Im }\frac12\log \left(\frac{1+z}{1-z}\right)=\frac12\arg \left(\frac{1+z}{1-z}\right).
$$

Here $\displaystyle  \log z$ denotes the principal value of the logarithm defined by 
$$ \begin{align} 
  \displaystyle \log z  = \ln |z| + i \: \mathrm{arg}\:z, \quad -\pi <\mathrm{arg}\: z \leq \pi,\quad z \neq 0.
\end{align} 
$$
A: Note that we have 
$$\begin{align}
\sum_{n=1}^\infty \frac{ e^{-(2n-1)\pi x/a}\sin\left((2n-1)\pi y/a\right)}{2n-1}&=\frac{\pi}{a}\sum_{n=1}^\infty e^{-(2n-1)\pi x/a} \,\int_0^y \cos((2n-1)\pi y'/a)  \,dy'\\\\
&=\frac{\pi}{a} \int_0^y \sum_{n=1}^\infty e^{-(2n-1)\pi x/a} \, \cos((2n-1)\pi y'/a)  \,dy'\\\\
&=\frac{\pi}{a} \text{Re}\left(\int_0^y \sum_{n=1}^\infty e^{-(2n-1)\pi(x+iy') /a}   \,dy'\right)\\\\
&=\frac{\pi}{2a} \text{Re}\left(\int_0^y \frac{1}{\sinh\left(\pi(x+iy')/a\right)}   \,dy'\right)\\\\
&=\frac12 \text{Re}\left(\int_0^{\pi y/a} \frac{1}{\sinh\left(\pi x/a+iy'\right)}   \,dy'\right)\\\\
&=\frac12 \text{Re}\left(\int_0^{\pi y/a} \frac{1}{\sinh\left(\pi x/a\right)\cos(y')+i\cosh(\pi x/a)\sin(y')}   \,dy'\right)\\\\
&=\frac12 \int_0^{\pi y/a} \frac{\sinh\left(\pi x/a\right)\cos(y')}{\sinh^2\left(\pi x/a\right)\cos^2(y')+\cosh^2(\pi x/a)\sin^2(y')}   \,dy'\\\\
&=\frac12 \arctan\left(\frac{\sin(\pi y/a)}{\sinh(\pi x/a)}\right)
\end{align}$$
as was to be shown!

NOTE: 
The interchange of integration and summation is justifiable since the series converges uniformly. 
