I'm struggling to get a Laplace problem with inhomogeneous boundary conditions solved. My memories are very rusty, and it almost works out, but I've got my brain twisted in some way. So I'm kindly requesting to check my reasoning for flaws.
\begin{align} u_{xx} + u_{yy} &= 0 \quad x,y \in \Omega = [0,1] \times [0,1],\\ u &= e^x \sin(y) \quad \text{on} \ \Gamma = \partial \Omega. \end{align}
The following function solves the problem (quite obviously): \begin{align} u(x,y) = e^x \sin(y). \end{align}
But I'd like to know how to derive that with a strategy similar to this question. For exercising not so obvious examples.
- I'm separating the variables using $u(x,y) = X(x) Y(y)$ and trying to to incorporate the b.c.: \begin{align} X'' - \lambda^2 X &= 0\\ X(x=0) &= \sin(y)\\ X(x=1) &= e \sin(y) \end{align} and \begin{align} Y'' + \lambda^2 Y &= 0\\ Y(y=0) &= 0\\ Y(y=1) &= e^x \sin(1) \end{align}
General solution for $Y$ is: \begin{align} Y(y) = c_1 \cos(\lambda y) + c_2 \sin(\lambda y) \end{align} BC1 yields: $c_1 = 0$, and BC2: \begin{align} c_2 \sin(\lambda y) = e^x \sin(1) \end{align} which gives me $c_2 = e^x$ and $\lambda = 1+ n \pi$ with some integer $n$. Thus \begin{align} Y(y) = e^x \sin((1+n\pi) y) \end{align}
Next for $X(x)$: General solution is \begin{align} X(x) = c_1 e^{\lambda x} + c_2 e^{-\lambda x} \end{align}
Again, using the b.c., I get two equations \begin{align} c_1 + c_2 &= \sin(y) \quad \text{and}\\ c_1 e^\lambda + c_2 e^{-\lambda} &= e \sin(y) \end{align} substitution of $\sin(y)$:
\begin{align} c_1 e^{\lambda} + c_2 e^{-\lambda} = c_1 e^1 + c_2 e^1 \end{align}Here's where I'm stuck: I need $\lambda = 1 \rightarrow n=0$ and $X(x) = 1$. Then I write $u(x,y) = X(x) Y(y)$:
Result \begin{align} u(x,y) = X(x) Y(y) = e^x \sin(y). \end{align}