Solving Laplace’s equation with Dirichlet and periodic boundary conditions

ordinary differential equationspartial differential equations

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!

Best Answer

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?