### 3.3 Laplace PDE inside square. 3 edges homogeneous boundary conditions.

Solve $$u_{xx}+u_{yy}=0$$ on the square $$0\leq x,y\leq 1$$. If $$u\left ( 0,y\right ) =u\left ( x,0\right ) =u\left ( x,1\right ) =0$$ and $$u\left ( 1,y\right ) =y-y^{2}$$.

$$a$$ is used for the length of the $$x$$ dimension and $$b$$ for the length of the $$y$$ dimension. This is a plot of boundary conditions

Solution

Let $$u\left ( x,y\right ) =X\left ( x\right ) Y\left ( x\right )$$. Substituting this into the PDE gives$X^{\prime \prime }Y+Y^{\prime \prime }X=0$ Dividing throughout by $$XY\neq 0\,$$ and simplifying gives$\frac{X^{\prime \prime }}{X}=-\frac{Y^{\prime \prime }}{Y}=\lambda$ This gives the eigenvalue ODE\begin{align} Y^{\prime \prime }+\lambda Y & =0\tag{1}\\ Y\left ( 0\right ) & =0\nonumber \\ Y\left ( b\right ) & =0\nonumber \end{align}

The solution to (1) gives the eigenvalues $$\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2}$$ for $$n=1,2,3\cdots$$ and since $$L=b$$, this becomes $\lambda _{n}=\left ( \frac{n\pi }{b}\right ) ^{2}\qquad n=1,2,\cdots$ And the corresponding eigenfunction\begin{align*} Y_{n}\left ( y\right ) & =c_{n}\sin \left ( \sqrt{\lambda _{n}}y\right ) \\ & =c_{n}\sin \left ( \frac{n\pi }{b}y\right ) \end{align*}

Therefore the corresponding nonhomogeneous $$X\left ( x\right )$$ ODE\begin{align} X_{n}^{\prime \prime }-\lambda _{n}X_{n} & =0\tag{2}\\ X_{n}\left ( 0\right ) & =0\nonumber \\ X_{n}\left ( a\right ) & =y-y^{2}\nonumber \end{align}

The solution to (2), since $$\lambda _{n}$$ is positive is \begin{align*} X_{n}\left ( x\right ) & =A_{n}\cosh \left ( \sqrt{\lambda _{n}}x\right ) +B_{n}\sinh \left ( \sqrt{\lambda _{n}}x\right ) \\ & =A_{n}\cosh \left ( \frac{n\pi }{b}x\right ) +B_{n}\sinh \left ( \frac{n\pi }{b}x\right ) \end{align*}

Boundary conditions $$X\left ( 0\right ) =0$$ gives$0=A_{n}$ The solution (3) now simpliﬁes to$X_{n}\left ( x\right ) =B_{n}\sinh \left ( \frac{n\pi }{b}x\right )$ Hence the fundamental solution is\begin{align*} u_{n}\left ( x,y\right ) & =X_{n}Y_{n}\\ & =c_{n}\sinh \left ( \frac{n\pi }{b}x\right ) \sin \left ( \frac{n\pi }{b}y\right ) \end{align*}

Where the constants $$B_{n}$$ is merged with $$c_{n}$$. The solution is$$u\left ( x,y\right ) =\sum _{n=1}^{\infty }c_{n}\sinh \left ( \frac{n\pi }{b}x\right ) \sin \left ( \frac{n\pi }{b}y\right ) \tag{3}$$ $$c_{n}$$ is now found by applying the boundary condition at $$x=a$$. The above becomes$y-y^{2}=\sum _{n=1}^{\infty }c_{n}\sinh \left ( \frac{n\pi }{b}a\right ) \sin \left ( \frac{n\pi }{b}y\right )$ Multiplying both sides by $$\sin \left ( \frac{m\pi }{b}y\right )$$ and integrating gives$\int _{0}^{b}\left ( y-y^{2}\right ) \sin \left ( \frac{m\pi }{b}y\right ) dy=\sum _{n=1}^{\infty }c_{n}\sinh \left ( \frac{n\pi }{b}a\right ) \left ( \int _{0}^{b}\sin \left ( \frac{m\pi }{b}y\right ) \sin \left ( \frac{n\pi }{b}y\right ) dy\right )$ By orthogonality the above reduces to \begin{align*} \int _{0}^{b}\left ( y-y^{2}\right ) \sin \left ( \frac{m\pi }{b}y\right ) dy & =c_{n}\sinh \left ( \frac{m\pi }{b}a\right ) \int _{0}^{b}\sin ^{2}\left ( \frac{m\pi }{b}y\right ) dy\\ & =\frac{b}{2}c_{m}\sinh \left ( \frac{m\pi }{b}a\right ) \end{align*}

Therefore$c_{n}=\frac{2}{b}\frac{1}{\sinh \left ( \frac{m\pi }{b}a\right ) }\int _{0}^{b}\left ( y-y^{2}\right ) \sin \left ( \frac{n\pi }{b}y\right ) dy$ Now replacing $$a=1,b=1$$, the above becomes\begin{align*} c_{n} & =\frac{2}{\sinh \left ( n\pi \right ) }\int _{0}^{1}\left ( y-y^{2}\right ) \sin \left ( n\pi y\right ) dy\\ & =\frac{2}{\sinh \left ( n\pi \right ) }\left ( \frac{-2\left ( -1+\left ( -1\right ) ^{n}\right ) }{n^{3}\pi ^{3}}\right ) \\ & =\frac{-4}{\sinh \left ( n\pi \right ) }\frac{\left ( -1+\left ( -1\right ) ^{n}\right ) }{n^{3}\pi ^{3}} \end{align*}

Hence the solution (3) becomes$u\left ( x,y\right ) =\frac{-4}{\pi ^{3}}\sum _{n=1}^{\infty }\frac{\left ( -1+\left ( -1\right ) ^{n}\right ) }{n^{3}}\frac{\sinh \left ( n\pi x\right ) }{\sinh \left ( n\pi \right ) }\sin \left ( n\pi y\right )$ This is a 3D plot of the solution.

This is a contour plot