Solving Laplace's equation with Dirichlet and periodic boundary conditions I wish to find the function, $T(x,y)$, on the unit square that satisfies Laplace's equation,
$$ 
\nabla^2 T = 0, \text{ in } \Omega = [0,1]^2, 
$$
with  Dirichlet boundary conditions in $y$ and periodic in $x$, i.e.
\begin{align} 
T(x,0) &= 1 + A\sin{\left( n2\pi x \right)}, \\ 
T(x,1) &= 0, \\
T(0,y) &= T(1,y)
\end{align}
What I have tried so far
First Attempt
I attempted to solve the above using separation of variables. I.e., by setting $T(x,y) = X(x)Y(y)$, which (I think) translates the boundary conditions to
\begin{align}
Y(0) &= 1, \\
Y(1) & = 0, \\
X(x) &= 1 + A\sin{\left( n2\pi x \right)}
\end{align}
and reduces the problem to the ODEs
\begin{align}
\frac{d^2Y}{dy^2} = \lambda^2 Y, \quad \frac{d^2X}{dx^2} = -\lambda^2 X.
\end{align}
It is easy enough to find a solution for $Y$, but for $X$, $X(x) = 1 + A\sin{\left( n2\pi x \right)}$ is clearly not consistent with $\frac{d^2X}{dx^2} = -\lambda^2 X$
Second Attempt
I set $T(x,y) = \tilde{T}(x,y) + \phi(x,y)$. I let $\phi$ deal with the inhomogeneous boundary conditions, i.e. set
$$
\phi = \left(1 + A\sin{\left( n2\pi x \right)} \right)\left(1-y \right).
$$
In this set-up, the problem for $\tilde{T}$ is
$$ 
\nabla^2 \tilde{T} = A\left(2\pi n \right)^2\sin{\left( n2\pi x \right)}(1-y), \text{ in } \Omega = [0,1]^2, 
$$
with periodic boundary conditions in $x$ and homogeneous boundary conditions in $y$. Perhaps this is an easier problem to solve?
Is my problem ill-posed? Have I made a mistake above? Or is there another approach I should take? Grateful for any input and guidance!
 A: Hint: Try expressing the solution in a Fourier series in the $x$ variable:
$$T(x,y)=\sum_{n=-\infty}^\infty T_n(y)e^{i2\pi n x}$$
This automatically guarantees the periodicity condition $T(0,y)=T(1,y)$. Now apply the Laplace operator and derive an equation for the $T_n$. They should be completely determined by your other boundary conditions. Can you finish from here?
A: This problem is built for separation of variables. Assume solutions of the form $X(x)Y(x)$ and separate variables:
$$
            X''(x)Y(y)+X(x)Y''(y) = 0 \\
             \frac{X''(x)}{X(x)} = -\frac{Y''(x)}{Y(y)} \\
            \frac{X''(x)}{X(x)}=\lambda,\;\;\lambda=-\frac{Y''(y)}{Y(y)}
$$
The functions $X$, $Y$ must satisfy these homogeneous conditions:
$$
                X(0)=X(1),\;\; Y(1)=0.
$$
The periodic solutions in $x$ have the form
\begin{align}
            X_0(x) &= B_0 \\
            X_n(x) &= B_n\cos(n\pi x)+C_n\sin(n\pi x), \;\; n=1,2,3,\cdots
\end{align}
These dictate the permissible values of the separation parameter $\lambda$:
$$
   \lambda_n = -n^2\pi^2,\;\; n=0,1,2,3,\cdots.
$$
For $n=0$, the $\sin(n\pi x)$ term drops out. Because $Y(1)=0$ must hold, the corresponding solutions in $y$ are scalar multiples of
$$
              Y_n(y)=\sinh(n\pi (y-1)).
$$
Therefore, the general solution is
$$
T(x,y)=B_0+\sum_{l=1}^{\infty}\{B_l\cos(l\pi x)+C_l\sin(l\pi x)\}\sinh(l\pi(y-1))
$$
The constants $B_l,C_l$ are determined by the required edge condition through a Fourier series in $x$:
$$
   1+A\sin(2n\pi x)=T(x,0) \\
 =B_0-\sum_{l=1}^{\infty}\{B_l\cos(l\pi x)+C_l\sin(l\pi x)\}\sinh(l\pi)
$$This condition is a straightforward Fourier series equality which is solved by matching Fourier coefficients on the left with those on the right.
