A series from a physics problem: $\sum_{k = 0}^{\infty}\frac{2}{2k + 1}e^{-(2k + 1)\pi x/a}\sin\left( \frac{(2k + 1)\pi y}{a}\right)$ How might we show that $$\sum_{k = 0}^{\infty}\frac{2}{2k + 1}e^{-(2k + 1)\pi x/a}\sin\left( \frac{(2k + 1)\pi y}{a}\right)  = \tan^{-1}\left( \frac{\sin(\pi y/a)}{\sinh(\pi x/a)} \right) $$
where $x, y$ are independent variables and $a$ is a parameter?
This arose in the solution to Laplace's equation. My text asserted this without proof, so I'm curious. 

Expanding on Mhenni Benghorbal's answer, the Maclaurin series of the inverse hyperbolic tangent function is  $$\sum_{k=0}^{\infty} \frac{z^{2k+1}}{2k+1} = \text{artanh} (z) \, , \ |z| <1.$$
So assuming $x, a >0$ and $y \in \mathbb{R}$, we get
$$ \begin{align} &\sum_{k = 0}^{\infty}\frac{2}{2k + 1}e^{-(2k + 1)\pi x/a}\sin\left( \frac{(2k + 1)\pi y}{a}\right) \\ &= \text{Im}\sum_{k = 0}^{\infty}\frac{2}{2k + 1}e^{-(2k + 1)\pi x/a} e^{i(2k+1) \pi y /a} \\ &= 2 \ \text{Im} \ \text{artanh} \left(e^{- \pi x /a} e^{- i \pi y/a} \right) \\ &= \ \text{Im} \left( \text{Log} (1+e^{- \pi x/a} e^{i \pi y/a}) - \text{Log}(1-e^{-\pi x /a} e^{i \pi y /a})\right) \\&= \arctan \left(  \frac{e^{- \pi x/a}\sin (\frac{\pi y}{a})}{1 + e^{- \pi x/a} \cos (\frac{\pi y}{a})}  \right) - \arctan\left( \frac{-e^{- \pi x /a} \sin (\frac{\pi y}{a})}{1 - e^{- \pi x /a}\cos (\frac{\pi y}{a})}  \right) \tag{1} \\ &= \arctan \left( \frac{\sin (\frac{\pi y}{a})}{e^{\pi x /a} +\cos (\frac{\pi y}{a})}  \right) + \arctan\left( \frac{\sin (\frac{\pi y}{a})}{e^{\pi x /a} - \cos (\frac{\pi y}{a})}  \right)  \\ &= \arctan \left(\frac{2 e^{\pi x/a} \sin (\frac{\pi y}{a})}{e^{2 \pi x/a} - \cos^{2} (\frac{\pi y}{a}) - \sin^{2} (\frac{\pi y}{a})} \right) \tag{2}\\   &= \arctan \left( \frac{2e^{\pi x/a} \sin (\frac{\pi y}{a})}{e^{2 \pi x/a}-1} \right)  \\ &= \arctan \left( \frac{\sin (\frac{\pi y}{a})}{\sinh (\frac{\pi x}{a})}\right). \end{align}$$

$(1)$  The points $1+e^{- \pi x/a} e^{i \pi y/a}$ and $ 1-e^{- \pi x/a} e^{i \pi y/a}$ are in the right half-plane.
$(2)$ Since $$ \left|\frac{\sin (\frac{\pi y}{a})}{e^{\pi x/a} + \cos (\frac{\pi y}{a})} \left(\frac{\sin (\frac{\pi y}{a})}{e^{\pi x/a} - \cos (\frac{\pi y}{a})} \right) \right| = \frac{1-\cos^{2} (\frac{\pi y}{a})}{e^{2 \pi x/a} - \cos^{2} (\frac{\pi y}{a})}  < 1, $$ we can use the formula $$\arctan(x+y) = \arctan \left(\frac{x+y}{1-xy} \right).$$
