everybody.
I was reading the classical electrodynamics book written by Jackson, but at the derivation of formula of (65.2), I got a problem. It is written that by considering \begin{align} Z=e^{(\frac{i\pi}{a})(x+iy)} \end{align} in the potential relation \begin{align} \phi(x,y)=\frac{2V}{\pi} \text{Im} \left(\ln \left( \frac{1+Z}{1-Z} \right) \right), \end{align} we will obtain \begin{align} \phi(x,y) = \frac{2V}{\pi} \tan^{-1}\left( \frac{\sin\left(\frac{\pi x}{a}\right)}{\sinh\left(\frac{\pi y}{a}\right)} \right). \end{align} My problem is that I don't know how that last equation has been derived. It's a kind of you if you help me.
Best wishes.
Hint
$$Z=e^{\frac{i \pi (x+i y)}{a}}\implies \frac{1+Z}{1-Z}=i \cot \left(\frac{\pi (x+i y)}{2 a}\right)$$ $$\log\left(\frac{1+Z}{1-Z} \right)=\log\left(i \cot \left(\frac{\pi (x+i y)}{2 a}\right)\right)$$ $$\text{Im} \left(\ln \left( \frac{1+Z}{1-Z} \right) \right)=\arg \left(i \cot \left(\frac{\pi (x+i y)}{2 a}\right)\right)$$ Just continue.