Solving Laplace's equation with fourier transform

After enforcing the boundary conditions, we find that

$$A(\omega)=-\frac{e^{-\omega}}{2(1+i\omega)\sinh(\omega)}$$

$$B(\omega)=\frac{e^{\omega}}{2(1+i\omega)\sinh(\omega)}$$

Then, applying the Fourier inverse transform, we obtain

$$u(x,y)=\frac{1}{2\pi}\int_{-\infty}^\infty e^{i\omega x} \frac{\sinh(\omega(1-y))}{(1+i\omega)\sinh(\omega)}\,d\omega \tag 1$$

To evaluate the integral in $(1)$, we use contour integration. We note that the integrand has poles at $\omega =i$ and $\omega =in\pi$, $n\ne0$.

Enclosing the contour in the upper-half plane when $x>0$, application of the residue theorem yields

$$u(x,y)=\frac{e^{-x}\sin(1-y)}{\sin(1)}+\sum_{n=1}^\infty \frac{(-1)^ne^{-n\pi x}\sin(n\pi (1-y))}{n\pi -1}$$

Enclosing the contour in the lower-half plane when $x<0$, application of the residue theorem yields

$$u(x,y)=-\sum_{n=1}^\infty \frac{(-1)^n e^{n\pi x}\sin(n\pi (1-y))}{n\pi +1}$$