# Inhomogeneous Dirichlet problem in a rectangle

1. Oct 18, 2015

### Incand

1. The problem statement, all variables and given/known data
Solve the problem
\begin{cases}
u_{xx} + u_{yy} = y, \; \; 0 < x < 2, \; \; 0 < y < 1\\
u(x,0)=0, \; \; u(x,1)=0\\
u(0,y)=y-y^3, \; \; y(2,y)=0.
\end{cases}
2. Relevant equations
N/A

3. The attempt at a solution
I start by trying to find a steady-state solution $u_0(y)$ (or I guess a solution independent of $x$ since we don't have a time variable). We have
$u_0''=y \Longrightarrow y = \frac{y^3}{6}+ay+b$. The boundary values $u(x,0)=0, \; \; u(x,1)=0$ give us that $u_0 = \frac{y^3-y}{6}$.

Setting $u = v+u_0$ we end up with the new homogeneous problem
\begin{cases}v_{xx}+v_{yy}=0\\
v(x,0) = 0, \; \; v(x,1)=0\\
v(0,y) = \frac{7}{6}(y-y^3), \; \; v(2,y)=\frac{y-y^3}{6}\end{cases}
Separation of variables give us
$X(x) = c_1\cosh \lambda x + c_2 \sinh \lambda x$ and
$Y(y) = c_3\cos \lambda y + c_3\sin \lambda y$.
The boundary conditions $v(x,0) = 0, \; \; v(x,1)=0$ give us that $c_3=0$ and $\lambda = n\pi$. We then have solutions of the form
$v(x,y) = \sum_1^\infty \left( a_n\cosh n\pi x + b_n \sinh n\pi x \right) \sin n\pi y$.
Imposing the boundary condition $v(0,y) = \frac{7}{6}(y-y^3)$ we have that
$\frac{7}{6}(y-y^3) = \sum_1^\infty a_n \sin n\pi y$. Calculating the Fourier coefficients we have that
$a_n = \frac{7}{3}\int_0^1 (y-y^3)\sin n\pi y dy = \frac{14 (-1)^{n-1}}{\pi^3 n^3}$.
So we have
$v(x,y) = \sum_1^\infty \left( \frac{14 (-1)^{n-1}}{\pi^3 n^3}\cosh n\pi x + b_n \sinh n\pi x \right) \sin n\pi y$. Imposing the other boundary condition $v(2,y)=\frac{y-y^3}{6}$ we get
$\frac{y-y^3}{6} =\sum_1^\infty \left( \frac{14 (-1)^{n-1}}{\pi^3 n^3}\cosh n\pi 2 + b_n \sinh n\pi 2 \right) \sin n\pi y$ at which point I'm stuck not knowing how to proceed.

$u(x,y) = \frac{1}{6}(y^3-y)+\frac{2}{\pi^3}\sum_1^\infty \frac{(-1)^{n-1}}{n^3\sinh 2n \pi} (\sinh n\pi x + 7 \sinh n\pi(2-x) )\sin n\pi y$.
I guess they choose the eigenfunction basis to the Sturm-Liouville problem as
$\sinh n\pi x$ and $\sinh n\pi (2-x)$ instead which work just as well. Is there a way I can get the answer in this form or do I have to redo every calculation with these eigenfunctions?

2. Oct 18, 2015

### pasmith

Well, you know that $$\frac{14(-1)^{n-1}}{n^3 \pi^3}\cosh 2n\pi + b_n \sinh 2n\pi$$ must be equal to the $\sin n\pi y$ coefficient in the fourier series for $(y - y^3)/6$ - which you know, because you've just calculated the fourier series of $7(y - y^3)/6$. Then, if you wish, use the hyperbolic sine addition rule $$\sinh (a + b) = \sinh a \cosh b + \cosh a \sinh b$$ to express your linear combination of hyperbolic sines and cosines as a linear combination of $\sinh n\pi x$ and $\sinh n\pi(2-x)$.

But the natural choice of eigenfunctions here is indeed $\sinh n\pi x \sin n\pi y$ and $\sinh n\pi (2 - x) \sin n\pi y$: The boundary condition on $x = 2$ is just $\frac17$ times that on $x = 0$. Thus if $X_{n,1}$ and $X_{n,2}$ are linear combinations of $e^{n\pi x}$ and $e^{-n\pi x}$ subject to $X_{n,1}(0) = 1$, $X_{n,1}(2) = 0$ and $X_{n,2}(0) = 0$, $X_{n,2}(1) = 1$ then $$v(x,y) = \sum_{n=1}^\infty a_n (X_{n,1}(x) + \tfrac17 X_{n,2}(x)) \sin n\pi y$$ where $a_n$ is obtained from the fourier expansion on $x = 0$. And on investigation we find $$X_{n,1}(x) = \frac{\sinh n\pi (2 - x)}{\sinh 2n\pi}, \\ X_{n,2}(x) = \frac{\sinh n\pi x}{\sinh 2n\pi}.$$

3. Oct 18, 2015

### Incand

The alternative eigenfunctions really made it a lot easier. How would I go about finding them in the first place? or are they just something you get from experience where someone just happened upon them? Our book does indeed suggest them for a similar example problem but doesn't explain how they got them in the first place.

As for transforming the the $\cosh$ and $\sinh$ I think I got it right
$\frac{2(-1)^{n-1}}{\pi^3 n^3} = \frac{14 (-1)^{n-1}}{n^3\pi^3}\cosh 2n\pi + b_n \sinh 2n\pi$
Rearranging we have
$b_n= \frac{2(-1)^{n-1}(1-7\cosh 2n\pi)}{\pi^3 n^3 \sinh 2n\pi}$. Our expansion is then
$v(x,y) = \frac{2}{\pi^3}\sum_1^\infty \frac{(-1)^{n-1}\sin n\pi y}{n^3 \sinh 2n\pi} \left(7 \sinh 2n\pi \cosh n\pi x + (1-7\cosh 2n\pi)\sinh n\pi x \right)$
So I want to show that $(\sinh 2n\pi \cosh n\pi x-\cosh 2n\pi \sinh n\pi x) = \sinh n\pi (2-x)$ which follow immediately from your addition rule.