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!
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.