Trouble with separation of variables for Laplace's equation Consider the 2D Laplace's equation, given by:
$$u_{xx}+u_{yy}=0$$with boundary conditions
$$\array{u(x,0)=0, \\u(x,1)=1,\\u(0,y)=0, \\u(1,y)=g(y)}$$
We will assume this equation is separable. We write
$$u(x,y)=X(x)*Y(y)$$
$$X''Y+XY''=0$$
$$\frac{X''}{X}=\frac{Y''}{Y}=\lambda$$
Where I'm stuck is the case that $\lambda=0$. This case gives two linear equations:
$$\array{X=ax+b\\Y=cy+d}$$
and when I apply the boundary conditions to X and Y I get
$$\array{X(0)=0\\X(1)=g(y)\\Y(0)=0\\Y(1)=1}$$
Therefore, $$\array{X(x)=g(y)*x\\Y(y)=y}$$
There are plenty of sources that have a solution for this problem, but this is certainly nothing like those solutions. Is there something I'm missing that makes this solution trivial?
 A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\bbox[5px,#ffd]{\mrm{u}_{xx}\pars{x,y} + \mrm{u}_{yy}\pars{x,y} = 0\,,\quad
\left\{\begin{array}{lcl}
\ds{\mrm{u}\pars{x,0}} & \ds{=} & \ds{0}
\\
\ds{\mrm{u}\pars{x,1}} & \ds{=} & \ds{1}
\\
\ds{\mrm{u}\pars{0,y}} & \ds{=} & \ds{0}
\\
\ds{\mrm{u}\pars{1,y}} & \ds{=} & \ds{\mrm{g}\pars{y}}
\end{array}\right.\,,}\qquad {\Large ?}}$
The following approach is $\ds{\underline{completely\
equivalent}}$ to the usual "variable separation": It just takes advantage of the homogeneous ( or cuasi$\ldots$ ) boundary conditions.

Start with $\ds{\mrm{u}\pars{x,y} \equiv
y + \sum_{n = 1}^{\infty}a_{n}\pars{x}\sin\pars{n\pi y}}$
which already satisfies $\ds{\mrm{u}\pars{x,0} = 0}$ and
$\ds{\mrm{u}\pars{x,1} = 1}$. The above proposed solution must satisfies its differential equation.  

*

*Namely, $\ds{0 = \sum_{n = 1}^{\infty}
\bracks{a_{n}''\pars{x} - \pars{n\pi}^{2}a_{n}\pars{x}}\sin\pars{n\pi y}}$.
Multiply both members by
$\ds{2\sin\pars{n\pi y}}$ and integrate over $\ds{y \in \pars{0,1}}$. It leads to
$$
a_{n}\pars{x} = b_{n}\sinh\pars{n\pi x} +
c_{n}\cosh\pars{n\pi x}
$$
The general solution becomes
$$
\mrm{u}\pars{x,y} = y + 
\sum_{n = 1}^{\infty}\bracks{b_{n}\sinh\pars{n\pi x} +
c_{n}\cosh\pars{n\pi x}}\sin\pars{n\pi y}
$$

*In addition, $\ds{0 = \mrm{u}\pars{0,y} =
y + \sum_{n = 1}^{\infty}c_{n}\sin\pars{n\pi y}}$. Multiply both members by $\ds{2\sin\pars{n\pi y}}$ and integrate over $\ds{y \in \pars{0,1}}$:
$$
\underbrace{\int_{0}^{1}y
\bracks{2\sin\pars{n\pi y}}\dd y}
_{\ds{{2 \over \pi}\,{\pars{-1}^{n + 1} \over n}}}\ +\ c_{n} = 0 \implies c_{n} = 
{2 \over \pi}\,{\pars{-1}^{n} \over n}
$$
The general solution becomes
\begin{align}
&\mrm{u}\pars{x,y}
\\[5mm] = &\
y +  \sum_{n = 1}^{\infty}
\bracks{b_{n}\sinh\pars{n\pi x} +
{2 \over \pi}\,{\pars{-1}^{n} \over n}
\cosh\pars{n\pi x}}
\\ &\
\phantom{y +  \sum_{n = 1}^{\infty}\left[\right.}
\sin\pars{n\pi y}
\label{1}\tag{1}
\end{align}

*Similarly,
\begin{align}
\mrm{g}\pars{y} & = \mrm{u}\pars{1,y}
\\[5mm] & =
y + \sum_{n = 1}^{\infty}\bracks{b_{n}\sinh\pars{n\pi} +
{2 \over \pi}\,{\pars{-1}^{n} \over n}\cosh\pars{n\pi}}
\sin\pars{n\pi y}
\end{align}
Multiply both members by $\ds{2\sin\pars{n\pi y}}$ and integrate over $\ds{y \in \pars{0,1}}$:
\begin{align}
&2\int_{0}^{1}\mrm{g}\pars{y}\sin\pars{n\pi y}\dd y 
\\[5mm] = &\
-{2 \over \pi}\,{\pars{-1}^{n} \over n} + b_{n}\sinh\pars{n\pi} +
{2 \over \pi}\,{\pars{-1}^{n} \over n}\cosh\pars{n\pi}
\\[5mm] \implies &
b_{n} = \varphi_{n}\,\mrm{csch}\pars{n\pi}
\\[2mm] &\
+ {\pars{-1}^{n} \over n\pi}
\bracks{\mrm{csch}\pars{n\pi} - \coth\pars{n\pi}}
\label{2}\tag{2}
\\[2mm] &\
\mbox{where}\ \varphi_{n} \equiv
\int_{0}^{1}\mrm{g}\pars{y}\sin\pars{n\pi y}\dd y
\end{align}

Replace (\ref{2}) in (\ref{1}) to get the final solution.
A: Solve two problems, and add their solutions. For the first problem set $u(x,1)=0$. For the second problem, set $u(1,y)=0$.
