Solving 2D Poisson Equation with one inhomogeneous Dirichlet Boundary Condition

I'm familiar how to go about solving problems with separation of variables, but I'm very confused on how to get started with a problem that has inhomogeneous boundary conditions. For example:

Any help would be extremely appreciated!


Solution 1:

This problem is actually quite simple. You can tackle one homogeneity at a time (in the equation and on the boundary).

First, separate the solution into $u(x,y) = v(x,y) + u_p(x,y)$, where one is a particular solution is and the other is a homogeneous solution. For the particular solution, notice the RHS function has derivatives that are proportional to itself, so you can guess a solution of the form $$ u_p(x,y) = A\sin (x) \sin (2y) $$

Plugging this into the equation, you will obtain $A = \dfrac15$

For the homogeneous solution, you first have to subtract off the boundary from the particular solution. Lucky for you, $u_p(x,y)$ is zero everywhere on the boundary, so everything remains the same. The problem is reduced to

$$ v_{xx} + v_{yy} = 0 $$ $$ v(0,y) = v(\pi,y) = v(x,0) = 0, \ v(x,\pi)=\sin x $$

Let $v(x,y) = X(x)Y(y)$, then separation of variables gives \begin{cases} X'' + \lambda X = 0, & X(0) = X(\pi) = 0 \\ Y'' - \lambda Y = 0, & Y(0) = 0 \end{cases}

Solving these we get

$$ v(x,y) = \sum_{n=1}^\infty c_n\sin(nx) \sinh(ny) $$

Note that the inhomogeneous B.C is not a disadvantage here. You need it to find the remaining constants

$$ v(x,\pi) = \sin x = \sum_{n=1}^\infty c_n\sinh(n\pi) \sin(nx) $$

This implies \begin{cases} c_n\sinh(n\pi) = 1, & n = 1 \\ c_n\sinh(n\pi) = 0, & n \ne 1 \end{cases}

So the final solution is

$$ u(x,y) = \frac15 \sin (x) \sin (2y) + \frac{\sin (x)\sinh (y)}{\sinh (\pi)} $$