### 11 Laplace PDE in Cartesian coordinates

_______________________________________________________________________________________

#### 11.1 Laplace PDE inside rectangle (Haberman 2.5.1 (a))

problem number 83

This is problem 2.5.1 part (a) from Richard Haberman applied partial diﬀerential equations, 5th edition

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

inside a rectangle $$0 \leq x \leq L, 0 \leq y \leq H$$, with following boundary conditions

\begin{align*} \frac{\partial u}{\partial x}(0,y) &= 0 \\ \frac{\partial u}{\partial x}(L,y) &= 0 \\ u(x,0)&=0 \\ u(x,H)&=f(x) \\ \end{align*}

Mathematica

$\left \{\left \{u(x,y)\to \underset{n=1}{\overset{\infty }{\sum }}\frac{2 \cos \left (\frac{n \pi x}{L}\right ) \text{csch}\left (\frac{H n \pi }{L}\right ) \left (\int _0^L \cos \left (\frac{n \pi x}{L}\right ) f(x) \, dx\right ) \sinh \left (\frac{n \pi y}{L}\right )}{L}+\frac{y \int _0^L f(x) \, dx}{H L}\right \}\right \}$

Maple

$u \left ( x,y \right ) ={\frac{1}{H\,L} \left ( 4\,\sum _{n=1}^{\infty } \left ( 1/2\,{1\cos \left ({\frac{n\pi \,x}{L}} \right ) \int _{0}^{L}\!f \left ( x \right ) \cos \left ({\frac{n\pi \,x}{L}} \right ) \,{\rm d}x\sinh \left ({\frac{n\pi \,y}{L}} \right ) \left ( \sinh \left ({\frac{n\pi \,H}{L}} \right ) \right ) ^{-1}} \right ) H+\int _{0}^{L}\!f \left ( x \right ) \,{\rm d}xy \right ) }$

_______________________________________________________________________________________

#### 11.2 Laplace PDE inside rectangle (Haberman 2.5.1 (b))

problem number 84

This is problem 2.5.1 part (b) from Richard Haberman applied partial diﬀerential equations, 5th edition

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

inside a rectangle $$0 \leq x \leq L, 0 \leq y \leq H$$, with following boundary conditions

\begin{align*} \frac{\partial u}{\partial x}(0,y) &= g(y) \\ \frac{\partial u}{\partial x}(L,y) &= 0 \\ u(x,0)&=0 \\ u(x,H)&=0 \\ \end{align*}

Mathematica

$\left \{\left \{u(x,y)\to \underset{n=1}{\overset{\infty }{\sum }}-\frac{2 \cosh \left (\frac{n \pi (L-x)}{H}\right ) \text{csch}\left (\frac{L n \pi }{H}\right ) \left (\int _0^H g(y) \sin \left (\frac{n \pi y}{H}\right ) \, dy\right ) \sin \left (\frac{n \pi y}{H}\right )}{n \pi }\right \}\right \}$

Maple

$u \left ( x,y \right ) =\sum _{n=1}^{\infty } \left ( -2\,{\frac{1}{n\pi }\sin \left ({\frac{n\pi \,y}{H}} \right ) \int _{0}^{H}\!\sin \left ({\frac{n\pi \,y}{H}} \right ) g \left ( y \right ) \,{\rm d}y \left ( \cosh \left ({\frac{n\pi \, \left ( 2\,L-x \right ) }{H}} \right ) +\sinh \left ({\frac{n\pi \, \left ( 2\,L-x \right ) }{H}} \right ) +\cosh \left ({\frac{n\pi \,x}{H}} \right ) +\sinh \left ({\frac{n\pi \,x}{H}} \right ) \right ) \left ( \cosh \left ( 2\,{\frac{n\pi \,L}{H}} \right ) +\sinh \left ( 2\,{\frac{n\pi \,L}{H}} \right ) -1 \right ) ^{-1}} \right )$

_______________________________________________________________________________________

#### 11.3 Laplace PDE inside rectangle (Haberman 2.5.1 (c))

problem number 85

This is problem 2.5.1 part (c) from Richard Haberman applied partial diﬀerential equations, 5th edition

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

inside a rectangle $$0 \leq x \leq L, 0 \leq y \leq H$$, with following boundary conditions

\begin{align*} \frac{\partial u}{\partial x}(0,y) &= 0 \\ u(L,y) &= g(y) \\ u(x,0)&=0 \\ u(x,H)&=0 \\ \end{align*}

Mathematica

$\text{DSolve}\left [\left \{u^{(0,2)}(x,y)+u^{(2,0)}(x,y)=0,\left \{u^{(1,0)}(0,y)=0,u(L,y)=g(y),u(x,0)=0,u(x,H)=0\right \}\right \},u(x,y),\{x,y\},\text{Assumptions}\to \{0\leq x\leq L\land 0\leq y\leq H\}\right ]$

Maple

$u \left ( x,y \right ) =\sum _{n=1}^{\infty } \left ( 4\,{\frac{1}{H}\sin \left ({\frac{n\pi \,y}{H}} \right ) \int _{0}^{H}\!\sin \left ({\frac{n\pi \,y}{H}} \right ) g \left ( y \right ) \,{\rm d}y \left ( \cosh \left ({\frac{n\pi \,L}{H}} \right ) +\sinh \left ({\frac{n\pi \,L}{H}} \right ) \right ) \cosh \left ({\frac{n\pi \,x}{H}} \right ) \left ( \cosh \left ( 2\,{\frac{n\pi \,L}{H}} \right ) +\sinh \left ( 2\,{\frac{n\pi \,L}{H}} \right ) +1 \right ) ^{-1}} \right )$

_______________________________________________________________________________________

#### 11.4 Laplace PDE inside rectangle (Haberman 2.5.1 (d))

problem number 86

This is problem 2.5.1 part (d) from Richard Haberman applied partial diﬀerential equations, 5th edition

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

inside a rectangle $$0 \leq x \leq L, 0 \leq y \leq H$$, with following boundary conditions

\begin{align*} u(0,y) &= g(y) \\ u(L,y) &= 0 \\ \frac{\partial u}{\partial y}u(x,0)&=0 \\ u(x,H)&=0 \\ \end{align*}

Mathematica

$\text{DSolve}\left [\left \{u^{(0,2)}(x,y)+u^{(2,0)}(x,y)=0,\left \{u(0,y)=0,u(L,y)=0,u^{(0,1)}(x,0)=0,u(x,H)=0\right \}\right \},u(x,y),\{x,y\},\text{Assumptions}\to \{0\leq x\leq L\land 0\leq y\leq H\}\right ]$

Maple

$u \left ( x,y \right ) =\sum _{n=0}^{\infty } \left ( 2\,{\frac{1}{H}\sin \left ( 1/2\,{\frac{\pi \, \left ( 2\,ny+H+y \right ) }{H}} \right ) \int _{0}^{H}\!\sin \left ( 1/2\,{\frac{\pi \, \left ( 2\,ny+H+y \right ) }{H}} \right ) g \left ( y \right ) \,{\rm d}y \left ( \cosh \left ( 1/2\,{\frac{\pi \, \left ( -x+2\,L \right ) \left ( 1+2\,n \right ) }{H}} \right ) +\sinh \left ( 1/2\,{\frac{\pi \, \left ( -x+2\,L \right ) \left ( 1+2\,n \right ) }{H}} \right ) -\cosh \left ( 1/2\,{\frac{ \left ( 1+2\,n \right ) \pi \,x}{H}} \right ) -\sinh \left ( 1/2\,{\frac{ \left ( 1+2\,n \right ) \pi \,x}{H}} \right ) \right ) \left ( \cosh \left ({\frac{ \left ( 1+2\,n \right ) \pi \,L}{H}} \right ) +\sinh \left ({\frac{ \left ( 1+2\,n \right ) \pi \,L}{H}} \right ) -1 \right ) ^{-1}} \right )$

_______________________________________________________________________________________

#### 11.5 Laplace PDE inside rectangle (Haberman 2.5.1 (e))

problem number 87

This is problem 2.5.1 part (e) from Richard Haberman applied partial diﬀerential equations, 5th edition

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

inside a rectangle $$0 \leq x \leq L, 0 \leq y \leq H$$, with following boundary conditions

\begin{align*} u(0,y) &= 0 \\ u(L,y) &= 0 \\ u(x,0) - \frac{\partial u}{\partial y}u(x,0)&=0 \\ u(x,H)&= f(x) \\ \end{align*}

Mathematica

$\text{DSolve}\left [\left \{u^{(0,2)}(x,y)+u^{(2,0)}(x,y)=0,\left \{u(0,y)=0,u(L,y)=0,u(x,0)-u^{(0,1)}(x,0)=0,u(x,H)=f(x)\right \}\right \},u(x,y),\{x,y\},\text{Assumptions}\to \{0\leq x\leq L\land 0\leq y\leq H\}\right ]$

Maple

$u \left ( x,y \right ) =\sum _{n=1}^{\infty } \left ( 4\,{\frac{1}{L}\sin \left ({\frac{n\pi \,x}{L}} \right ) \int _{0}^{L}\!\sin \left ({\frac{n\pi \,x}{L}} \right ) f \left ( x \right ) \,{\rm d}x \left ( \pi \,\cosh \left ({\frac{n\pi \,y}{L}} \right ) n+L\,\sinh \left ({\frac{n\pi \,y}{L}} \right ) \right ) \left ( \cosh \left ({\frac{n\pi \,H}{L}} \right ) +\sinh \left ({\frac{n\pi \,H}{L}} \right ) \right ) \left ( \pi \,\cosh \left ( 2\,{\frac{n\pi \,H}{L}} \right ) n+\pi \,\sinh \left ( 2\,{\frac{n\pi \,H}{L}} \right ) n+L\,\cosh \left ( 2\,{\frac{n\pi \,H}{L}} \right ) +L\,\sinh \left ( 2\,{\frac{n\pi \,H}{L}} \right ) +\pi \,n-L \right ) ^{-1}} \right )$

Hand solution

Let $$u\left ( x,y\right ) =X\left ( x\right ) Y\left ( x\right )$$. Substituting this into the PDE $$\frac{\partial ^{2}u}{\partial x^{2}}+\frac{\partial ^{2}u}{\partial y^{2}}=0$$ and simplifying gives$\frac{X^{\prime \prime }}{X}=-\frac{Y^{\prime \prime }}{Y}$ Each side depends on diﬀerent independent variable and they are equal, therefore they must be equal to same constant.$\frac{X^{\prime \prime }}{X}=-\frac{Y^{\prime \prime }}{Y}=\pm \lambda$ Since the boundary conditions along the $$x$$ direction are the homogeneous ones, $$-\lambda$$ is selected in the above. Two ODE’s (1,2) are obtained as follows$$X^{\prime \prime }+\lambda X=0\tag{1}$$ With the boundary conditions\begin{align*} X\left ( 0\right ) & =0\\ X\left ( L\right ) & =0 \end{align*}

And$$Y^{\prime \prime }-\lambda Y=0\tag{2}$$ With the boundary conditions\begin{align*} Y\left ( 0\right ) & =Y^{\prime }\left ( 0\right ) \\ Y\left ( H\right ) & =f\left ( x\right ) \end{align*}

In all these cases $$\lambda$$ will turn out to be positive. This is shown for this problem only and not be repeated again.

Case $$\lambda <0$$

The solution to (1) us

$X=A\cosh \left ( \sqrt{\lambda }x\right ) +B\sinh \left ( \sqrt{\lambda }x\right )$ At $$x=0$$, the above gives $$0=A$$. Hence $$X=B\sinh \left ( \sqrt{\lambda }x\right )$$. At $$x=L$$ this gives $$X=B\sinh \left ( \sqrt{\lambda }L\right )$$. But $$\sinh \left ( \sqrt{\lambda }L\right ) =0$$ only at $$0$$ and $$\sqrt{\lambda }L\neq 0$$, therefore $$B=0$$ and this leads to trivial solution. Hence $$\lambda <0$$ is not an eigenvalue.

Case $$\lambda =0$$

$X=Ax+B$ Hence at $$x=0$$ this gives $$0=B$$ and the solution becomes $$X=B$$. At $$x=L$$, $$B=0$$. Hence the trivial solution. $$\lambda =0$$ is not an eigenvalue.

Case $$\lambda >0$$

Solution is $X=A\cos \left ( \sqrt{\lambda }x\right ) +B\sin \left ( \sqrt{\lambda }x\right )$ At $$x=0$$ this gives $$0=A$$ and the solution becomes $$X=B\sin \left ( \sqrt{\lambda }x\right )$$. At $$x=L$$ $0=B\sin \left ( \sqrt{\lambda }L\right )$ For non-trivial solution $$\sin \left ( \sqrt{\lambda }L\right ) =0$$ or $$\sqrt{\lambda }L=n\pi$$ where $$n=1,2,3,\cdots$$, therefore$\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2}\qquad n=1,2,3,\cdots$ Eigenfunctions are$$X_{n}\left ( x\right ) =B_{n}\sin \left ( \frac{n\pi }{L}x\right ) \qquad n=1,2,3,\cdots \tag{3}$$ For the $$Y$$ ODE, the solution is\begin{align*} Y_{n} & =C_{n}\cosh \left ( \frac{n\pi }{L}y\right ) +D_{n}\sinh \left ( \frac{n\pi }{L}y\right ) \\ Y_{n}^{\prime } & =C_{n}\frac{n\pi }{L}\sinh \left ( \frac{n\pi }{L}y\right ) +D_{n}\frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}y\right ) \end{align*}

Applying B.C. at $$y=0$$ gives\begin{align*} Y\left ( 0\right ) & =Y^{\prime }\left ( 0\right ) \\ C_{n}\cosh \left ( 0\right ) & =D_{n}\frac{n\pi }{L}\cosh \left ( 0\right ) \\ C_{n} & =D_{n}\frac{n\pi }{L} \end{align*}

The eigenfunctions $$Y_{n}$$ are\begin{align*} Y_{n} & =D_{n}\frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}y\right ) +D_{n}\sinh \left ( \frac{n\pi }{L}y\right ) \\ & =D_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}y\right ) +\sinh \left ( \frac{n\pi }{L}y\right ) \right ) \end{align*}

Now the complete solution is produced\begin{align*} u_{n}\left ( x,y\right ) & =Y_{n}X_{n}\\ & =D_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}y\right ) +\sinh \left ( \frac{n\pi }{L}y\right ) \right ) B_{n}\sin \left ( \frac{n\pi }{L}x\right ) \end{align*}

Let $$D_{n}B_{n}=B_{n}$$ since a constant. (no need to make up a new symbol).$u_{n}\left ( x,y\right ) =B_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}y\right ) +\sinh \left ( \frac{n\pi }{L}y\right ) \right ) \sin \left ( \frac{n\pi }{L}x\right )$ Sum of eigenfunctions is the solution, hence$u\left ( x,y\right ) =\sum _{n=1}^{\infty }B_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}y\right ) +\sinh \left ( \frac{n\pi }{L}y\right ) \right ) \sin \left ( \frac{n\pi }{L}x\right )$ The nonhomogeneous boundary condition is now resolved.  At $$y=H$$$u\left ( x,H\right ) =f\left ( x\right )$ Therefore$f\left ( x\right ) =\sum _{n=1}^{\infty }B_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}H\right ) +\sinh \left ( \frac{n\pi }{L}H\right ) \right ) \sin \left ( \frac{n\pi }{L}x\right )$ Multiplying both sides by $$\sin \left ( \frac{m\pi }{L}x\right )$$ and integrating gives\begin{align*} \int _{0}^{L}f\left ( x\right ) \sin \left ( \frac{m\pi }{L}x\right ) dx & =\int _{0}^{L}\sin \left ( \frac{m\pi }{L}x\right ) \sum _{n=1}^{\infty }B_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}H\right ) +\sinh \left ( \frac{n\pi }{L}H\right ) \right ) \sin \left ( \frac{n\pi }{L}x\right ) dx\\ & =\sum _{n=1}^{\infty }B_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}H\right ) +\sinh \left ( \frac{n\pi }{L}H\right ) \right ) \int _{0}^{L}\sin \left ( \frac{n\pi }{L}x\right ) \sin \left ( \frac{m\pi }{L}x\right ) dx\\ & =B_{m}\left ( \frac{m\pi }{L}\cosh \left ( \frac{m\pi }{L}H\right ) +\sinh \left ( \frac{m\pi }{L}H\right ) \right ) \frac{L}{2} \end{align*}

Hence$$B_{n}=\frac{2}{L}\frac{\int _{0}^{L}f\left ( x\right ) \sin \left ( \frac{n\pi }{L}x\right ) dx}{\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}H\right ) +\sinh \left ( \frac{n\pi }{L}H\right ) \right ) }\tag{4}$$ This completes the solution. In summary$u\left ( x,y\right ) =\sum _{n=1}^{\infty }B_{n}\left ( \frac{n\pi }{L}\cosh \left ( \frac{n\pi }{L}y\right ) +\sinh \left ( \frac{n\pi }{L}y\right ) \right ) \sin \left ( \frac{n\pi }{L}x\right )$ With $$B_{n}$$ given by (4).

_______________________________________________________________________________________

#### 11.6 Laplace PDE inside rectangle, top/bottom edges non-zero

problem number 88

Taken from Mathematica DSolve help pages.

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

inside a rectangle $$0 \leq x \leq 1, 0 \leq y \leq 2$$, with following boundary conditions

\begin{align*} u(0,y) &= 0 \\ u(1,y) &= 0 \\ u(x,0) &= \text{UnitTriagle(2 x-1)} \\ u(x,2) &= \text{UnitTriagle(2 x-1)} \end{align*}

Mathematica

$\left \{\left \{u(x,y)\to \underset{n=1}{\overset{\infty }{\sum }}\frac{8 \text{csch}(2 n \pi ) \sin \left (\frac{n \pi }{2}\right ) \sin (n \pi x) (\sinh (n \pi (2-y))+\sinh (n \pi y))}{n^2 \pi ^2}\right \}\right \}$

Maple

$u \left ( x,y \right ) =\sum _{n=1}^{\infty }8\,{\frac{\sin \left ( 1/2\,\pi \,n \right ){{\rm e}^{2\,\pi \,n}}\sin \left ( n\pi \,x \right ) \left ({{\rm e}^{-\pi \,n \left ( -2+y \right ) }}-{{\rm e}^{\pi \,n \left ( -2+y \right ) }}+{{\rm e}^{n\pi \,y}}-{{\rm e}^{-n\pi \,y}} \right ) }{{n}^{2}{\pi }^{2} \left ({{\rm e}^{4\,\pi \,n}}-1 \right ) }}$

_______________________________________________________________________________________

#### 11.7 Laplace PDE inside rectangle, top edge at inﬁnity

problem number 89

Added December 20, 2018.

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

Inside a rectangle $$0 \leq x \leq L, 0 \leq y \leq \infty$$, with following boundary conditions

\begin{align*} u(0,y) &= A \\ u(L,y) &= 0 \\ u(x,0) &= 0 \end{align*}

Mathematica

$\text{DSolve}\left [\left \{u^{(0,2)}(x,y)+u^{(2,0)}(x,y)=0,\{A=u(0,y),u(L,y)=0,u(x,0)=0\}\right \},u(x,y),\{x,y\},\text{Assumptions}\to \{x>0,y>0,L>0\}\right ]$ May be there is workaround.

Maple

$u \left ( x,y \right ) ={\frac{1}{L} \left ( \sum _{n=1}^{\infty }-2\,{\frac{A}{\pi \,n}\sin \left ({\frac{n\pi \,x}{L}} \right ){{\rm e}^{-{\frac{n\pi \,y}{L}}}}}L+A \left ( L-x \right ) \right ) }$

_______________________________________________________________________________________

#### 11.8 Laplace PDE in 2D Cartessian with boundary condition as Dirac function

problem number 90

Added December 20, 2018

Solve Laplace equation for $$u(x,y)$$

$\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

With boundary condition

\begin{align*} u(x,0) &= \delta (x) \end{align*}

Mathematica

$\left \{\left \{u(x,y)\to \begin{array}{cc} \{ & \begin{array}{cc} \frac{y}{\pi \left (x^2+y^2\right )} & y\geq 0 \\ \text{Indeterminate} & \text{True} \\\end{array} \\\end{array}\right \}\right \}$

Maple

$u \left ( x,y \right ) =1/2\,{\frac{\int _{-\infty }^{\infty }\!{{\rm e}^{-sy+isx}}\,{\rm d}s}{\pi }}$

_______________________________________________________________________________________

#### 11.9 Laplace PDE in rectangle, one side homogeneous and 3 sides are not

problem number 91

Added December 20, 2018

Solve Laplace equation for $$u(x,y)$$

$\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = 0$

With boundary condition

\begin{align*} u(0,y)&=0 \ u(\pi ,y) &= \sinh (\pi ) \cos (y) \ u(x,0) &= \sin (x) \ u(x,\pi ) &= -\sinh (x) \end{align*}

Mathematica

$\left \{\left \{u(x,y)\to \underset{K[1]=1}{\overset{\infty }{\sum }}\left (\frac{2 \left (1+(-1)^{K[1]}\right ) \text{csch}(\pi K[1]) K[1] \sin (y K[1]) \sinh (\pi ) \sinh (x K[1])}{\pi \left (K[1]^2-1\right )}+\text{csch}(\pi K[1]) \delta (K[1]-1) \sin (x K[1]) \sinh ((\pi -y) K[1])+\frac{2 (-1)^{K[1]} \text{csch}(\pi K[1]) K[1] \sin (x K[1]) \sinh (\pi ) \sinh (y K[1])}{\pi K[1]^2+\pi }\right )\right \}\right \}$

Maple

$u \left ( x,y \right ) ={\frac{1}{{{\rm e}^{2\,\pi }}-1} \left ( \left ({{\rm e}^{2\,\pi }}-1 \right ) \sum _{n=1}^{\infty }{\frac{ \left ( -1 \right ) ^{n}n \left ({{\rm e}^{2\,\pi }}-1 \right ){{\rm e}^{n \left ( \pi -y \right ) -\pi }}\sin \left ( nx \right ) \left ({{\rm e}^{2\,ny}}-1 \right ) }{\pi \, \left ({n}^{2}+1 \right ) \left ({{\rm e}^{2\,\pi \,n}}-1 \right ) }}+ \left ({{\rm e}^{2\,\pi }}-1 \right ) \sum _{n=2}^{\infty }2\,{\frac{\sin \left ( ny \right ){{\rm e}^{n \left ( \pi -x \right ) }}n\sinh \left ( \pi \right ) \left ( \left ( -1 \right ) ^{n}+1 \right ) \left ({{\rm e}^{2\,nx}}-1 \right ) }{\pi \, \left ({{\rm e}^{2\,\pi \,n}}-1 \right ) \left ({n}^{2}-1 \right ) }}+\sin \left ( x \right ) \left ({{\rm e}^{-y+2\,\pi }}-{{\rm e}^{y}} \right ) \right ) }$

_______________________________________________________________________________________

#### 11.10 Laplace PDE example 18 from Maple help page

problem number 92

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2}=0$

With boundary conditions

\begin{align*} u(0,y) &= \frac{\sin y}{y} \end{align*}

Mathematica

$\left \{\left \{u(x,y)\to \frac{(\sinh (x)-\cosh (x)) (x \cos (y)-y \sin (y))+x}{x^2+y^2}\right \}\right \}$

Maple

$u \left ( x,y \right ) ={\frac{\sin \left ( -y+ix \right ) +{\it \_F2} \left ( y-ix \right ) \left ( y-ix \right ) + \left ( -y+ix \right ){\it \_F2} \left ( y+ix \right ) }{-y+ix}}$

_______________________________________________________________________________________

#### 11.11 Laplace PDE on rectangle with one edge at inﬁnity

problem number 93

Solve Laplace equation $\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2}=0$

With boundary conditions

\begin{align*} u(0,y) &= \sin y \\ u(x,0) &= 0 \\ u(x,a) &= 0 \\ u(\infty ,y) &= 0 \end{align*}

Mathematica

$\text{DSolve}\left [\left \{u^{(0,2)}(x,y)+u^{(2,0)}(x,y)=0,\{u(x,0)=0,u(x,a)=0,u(0,y)=\sin (y),u(\infty ,y)=0\}\right \},u(x,y),\{x,y\},\text{Assumptions}\to a>0\right ]$

Maple

$u \left ( x,y \right ) =\sum _{n=1}^{\infty }2\,{\frac{1}{a}\cases{1/2\,\pi \,n&a=\pi \,n\cr -{\frac{\pi \, \left ( -1 \right ) ^{n}\sin \left ( a \right ) na}{{\pi }^{2}{n}^{2}-{a}^{2}}}&otherwise\cr }{{\rm e}^{-{\frac{n\pi \,x}{a}}}}\sin \left ({\frac{\pi \,ny}{a}} \right ) }$

_______________________________________________________________________________________

#### 11.12 Laplace PDE inside a disk, periodic boundary conditions

problem number 94

Solve Laplace equation in polar coordinates inside a disk

Solve for $$u\left ( r,\theta \right )$$

\begin{align*} \frac{\partial ^{2}u}{\partial r^{2}}+\frac{1}{r}\frac{\partial u}{\partial r} +\frac{1}{r^{2}}\frac{\partial ^{2}u}{\partial \theta ^{2}} & =0\\ 0 & \leq r\leq a\\ 0 & <\theta \leq 2\pi \end{align*}

Boundary conditions

\begin{align*} u\left ( a,\theta \right ) & =f\left ( \theta \right ) \\ \left \vert u\left ( 0,\theta \right ) \right \vert & <\infty \\ u\left ( r,0\right ) & =u\left ( r,2\pi \right ) \\ \frac{\partial u}{\partial \theta }\left ( r,0\right ) & =\frac{\partial u}{\partial \theta }\left ( r,2\pi \right ) \end{align*}

Mathematica

$\left \{\left \{u(r,\theta )\to \underset{n=1}{\overset{\infty }{\sum }}r^n \left (\frac{\cos (n \theta ) \left (\int _{-\pi }^{\pi } \cos (n \theta ) f(\theta ) \, d\theta \right ) a^{-n}}{\pi }+\frac{\left (\int _{-\pi }^{\pi } f(\theta ) \sin (n \theta ) \, d\theta \right ) \sin (n \theta ) a^{-n}}{\pi }\right )+\frac{\int _{-\pi }^{\pi } f(\theta ) \, d\theta }{2 \pi }\right \}\right \}$

Maple

$u \left ( r,\theta \right ) =1/2\,{\frac{1}{\pi } \left ( 2\,\sum _{n=1}^{\infty } \left ({\frac{\int _{-\pi }^{\pi }\!f \left ( \theta \right ) \sin \left ( n\theta \right ) \,{\rm d}\theta \sin \left ( n\theta \right ) +\int _{-\pi }^{\pi }\!f \left ( \theta \right ) \cos \left ( n\theta \right ) \,{\rm d}\theta \cos \left ( n\theta \right ) }{\pi } \left ({\frac{a}{r}} \right ) ^{-n}} \right ) \pi +\int _{-\pi }^{\pi }\!f \left ( \theta \right ) \,{\rm d}\theta \right ) }$

_______________________________________________________________________________________

#### 11.13 Dirichlet problem for the Laplace equation in upper half plan

problem number 95

Taken from Mathematica DSolve help pages

Solve for $$u( x,y)$$

\begin{align*} \frac{\partial ^2 u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0 \end{align*}

Boundary conditions $$u(x,0)=1$$ for $$-\frac{1}{2}\leq x \leq \frac{1}{2}$$ and $$x=0$$ otherwise. This is called UnitBox in Mathematica.

Mathematica

$\left \{\left \{u(x,y)\to \begin{array}{cc} \{ & \begin{array}{cc} \frac{\begin{array}{cc} \{ & \begin{array}{cc} \tan ^{-1}\left (\frac{\frac{1}{2}-x}{y}\right )+\tan ^{-1}\left (\frac{x+\frac{1}{2}}{y}\right ) & y>0\lor x>\frac{1}{2}\lor x<-\frac{1}{2} \\ 0 & \text{True} \\\end{array} \\\end{array}}{\pi } & y\geq 0 \\ \text{Indeterminate} & \text{True} \\\end{array} \\\end{array}\right \}\right \}$

Maple

$u \left ( x,y \right ) =i \left ( 1/2\,{\frac{1}{\pi }\int _{-\infty }^{\infty }\!{\frac{{{\rm e}^{-1/2\,s \left ( 2\,y+i \right ) +isx}}}{s}}\,{\rm d}s}-1/2\,{\frac{1}{\pi }\int _{-\infty }^{\infty }\!{\frac{{{\rm e}^{1/2\,s \left ( -2\,y+i \right ) +isx}}}{s}}\,{\rm d}s} \right )$ used convert(sol,Int)

_______________________________________________________________________________________

#### 11.14 Dirichlet problem for the Laplace equation in right half-plane:

problem number 96

Taken from Mathematica DSolve help pages

Solve for $$u( x,y)$$

\begin{align*} \frac{\partial ^2 u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0 \end{align*}

Boundary conditions $$u(0,y)=\sinc (y)$$.

Mathematica

$\left \{\left \{u(x,y)\to \begin{array}{cc} \{ & \begin{array}{cc} \frac{x+(x \cos (y)-y \sin (y)) (\sinh (x)-\cosh (x))}{x^2+y^2} & x\geq 0 \\ \text{Indeterminate} & \text{True} \\\end{array} \\\end{array}\right \}\right \}$

Maple

$u \left ( x,y \right ) ={\frac{\sin \left ( -y+ix \right ) +{\it \_F2} \left ( y-ix \right ) \left ( y-ix \right ) + \left ( -y+ix \right ){\it \_F2} \left ( y+ix \right ) }{-y+ix}}$

_______________________________________________________________________________________

#### 11.15 Dirichlet problem for the Laplace equation in the ﬁrst quadrant

problem number 97

Taken from Mathematica DSolve help pages

Solve for $$u( x,y)$$

\begin{align*} \frac{\partial ^2 u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0 \end{align*}

Boundary conditions $$u(0,y)=\sinc (y)$$.

Mathematica

$\left \{\left \{u(x,y)\to \begin{array}{cc} \{ & \begin{array}{cc} \frac{2 \left (\frac{3 \left (y \left (3 \pi (x+1) \left (x^4-4 x^3+2 \left (y^2+12\right ) x^2-4 \left (y^2+10\right ) x+y^4-16 y^2+100\right )+x \left (\left (6 \tan ^{-1}(3)-\log (10)\right ) x^4+2 \left (\left (6 \tan ^{-1}(3)-\log (10)\right ) y^2+10 \left (6 \tan ^{-1}(3)+\log (10)\right )\right ) x^2-20 y^2 \left (6 \tan ^{-1}(3)+\log (10)\right )+260 \log (10)+y^4 \left (6 \tan ^{-1}(3)-\log (10)\right )+360 \tan ^{-1}(3)\right )+x \left (x^4+2 \left (y^2-10\right ) x^2+y^4+20 y^2-260\right ) \log \left (x^2+y^2\right )\right )-\left (x^6+\left (y^2+6\right ) x^4-\left (y^4-92 y^2+60\right ) x^2-y^6+6 y^4+60 y^2-1000\right ) \tan ^{-1}\left (\frac{y}{x}\right )\right )}{\left (x^2-2 x+y^2-6 y+10\right ) \left (x^2+2 x+y^2-6 y+10\right ) \left (x^2-2 x+y^2+6 y+10\right ) \left (x^2+2 x+y^2+6 y+10\right )}-\frac{3 \left (x^6+\left (y^2+5\right ) x^4-\left (y^4+46 y^2-35\right ) x^2-y^6+5 y^4-35 y^2+343\right ) \tan ^{-1}\left (\frac{x}{y}\right )+x \left (2 \pi \left (\sqrt{3} y^5-9 y^4+14 \sqrt{3} y^3-6 y^2-35 \sqrt{3} y+x^4 \left (\sqrt{3} y+3\right )+2 x^2 \left (\sqrt{3} y^3-3 y^2-7 \sqrt{3} y-3\right )+147\right )+y \left (\left (4 \sqrt{3} \tan ^{-1}\left (\frac{2}{\sqrt{3}}\right )-3 \log (7)\right ) x^4+2 \left (y^2 \left (4 \sqrt{3} \tan ^{-1}\left (\frac{2}{\sqrt{3}}\right )-3 \log (7)\right )-7 \left (4 \sqrt{3} \tan ^{-1}\left (\frac{2}{\sqrt{3}}\right )+\log (343)\right )\right ) x^2+14 y^2 \left (4 \sqrt{3} \tan ^{-1}\left (\frac{2}{\sqrt{3}}\right )+\log (343)\right )+189 \log (7)+y^4 \left (4 \sqrt{3} \tan ^{-1}\left (\frac{2}{\sqrt{3}}\right )-3 \log (7)\right )-140 \sqrt{3} \tan ^{-1}\left (\frac{2}{\sqrt{3}}\right )\right )+3 y \left (x^4+2 \left (y^2+7\right ) x^2+y^4-14 y^2-63\right ) \log \left (x^2+y^2\right )\right )}{\left (x^4-8 x^3+2 \left (y^2+15\right ) x^2-8 \left (y^2+7\right ) x+y^4+2 y^2+49\right ) \left (x^4+8 x^3+2 \left (y^2+15\right ) x^2+8 \left (y^2+7\right ) x+y^4+2 y^2+49\right )}\right )}{3 \pi } & x\geq 0\land y\geq 0 \\ \text{Indeterminate} & \text{True} \\\end{array} \\\end{array}\right \}\right \}$

Maple

$\text{ sol=() }$

_______________________________________________________________________________________

#### 11.16 Neumann problem for the Laplace equation in the upper half-plane

problem number 98

Taken from Mathematica DSolve help pages

Solve for $$u( x,y)$$

\begin{align*} \frac{\partial ^2 u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0 \end{align*}

Boundary conditions $$\frac{u}{y}(x,0)=\text{UnitBox[x]}$$ where $$\text{UnitBox[x]}$$ is $$1$$ for $$-\frac{1}{2}\leq x \leq \frac{1}{2}$$ and $$0$$ otherwise. This is called UnitBox in Mathematica.

Mathematica

$\left \{\left \{u(x,y)\to \begin{array}{cc} \{ & \begin{array}{cc} \frac{-4 y \tan ^{-1}\left (\frac{x-\frac{1}{2}}{y}\right )+4 y \tan ^{-1}\left (\frac{x+\frac{1}{2}}{y}\right )-2 x \log \left (4 x^2-4 x+4 y^2+1\right )+\log \left (4 x^2-4 x+4 y^2+1\right )+2 x \log \left (4 x^2+4 x+4 y^2+1\right )+\log \left (4 x^2+4 x+4 y^2+1\right )-2 \log (4)-4}{4 \pi } & y\geq 0 \\ \text{Indeterminate} & \text{True} \\\end{array} \\\end{array}\right \}\right \}$

Maple

$u \left ( x,y \right ) =i \left ( 1/2\,{\frac{1}{\pi }\int _{-\infty }^{\infty }\!{\frac{{{\rm e}^{1/2\,s \left ( -2\,y+i \right ) +isx}}}{{s}^{2}}}\,{\rm d}s}-1/2\,{\frac{1}{\pi }\int _{-\infty }^{\infty }\!{\frac{{{\rm e}^{-1/2\,s \left ( 2\,y+i \right ) +isx}}}{{s}^{2}}}\,{\rm d}s} \right )$ used convert(sol,Int).

_______________________________________________________________________________________

#### 11.17 Dirichlet problem for the Laplace equation in a rectangle

problem number 99

Taken from Mathematica DSolve help pages

Solve for $$u( x,y)$$

\begin{align*} \frac{\partial ^2 u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0 \end{align*}

Boundary conditions $$u(x, 0) = x^2 (1 - x), u(x, 2) = 0, u(0, y) = 0, u(1, y) = 0$$.

Mathematica

$\left \{\left \{u(x,y)\to \underset{n=1}{\overset{\infty }{\sum }}-\frac{4 \left (1+2 (-1)^n\right ) \text{csch}(2 n \pi ) \sin (n \pi x) \sinh (n \pi (2-y))}{n^3 \pi ^3}\right \}\right \}$

Maple

$u \left ( x,y \right ) =\sum _{n=1}^{\infty }4\,{\frac{\sin \left ( n\pi \,x \right ) \left ( 2\, \left ( -1 \right ) ^{1+n}{{\rm e}^{-\pi \,n \left ( y-4 \right ) }}+2\,{{\rm e}^{\pi \,ny}} \left ( -1 \right ) ^{n}-{{\rm e}^{-\pi \,n \left ( y-4 \right ) }}+{{\rm e}^{\pi \,ny}} \right ) }{{n}^{3}{\pi }^{3} \left ({{\rm e}^{4\,\pi \,n}}-1 \right ) }}$

_______________________________________________________________________________________

#### 11.18 Cartessian coordinates with boundary conditions on two sides only

problem number 100

Added December 20, 2018.

Solve for $$u( x,y)$$

\begin{align*} \frac{\partial ^2 u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0 \end{align*}

Boundary conditions \begin{align*} u(x, 0) &= 0 \\ u(x, b) &= h(x) \end{align*}

Mathematica

$\text{DSolve}\left [\left \{u^{(0,2)}(x,y)+u^{(2,0)}(x,y)=0,\{u(x,0)=0,u(x,b)=h(x)\}\right \},u(x,y),\{x,y\}\right ]$

Maple

$u \left ( x,y \right ) =-1/2\,{\frac{1}{\pi }\int _{-\infty }^{\infty }\!-{\frac{\int _{-\infty }^{\infty }\!h \left ( x \right ){{\rm e}^{-isx}}\,{\rm d}x{{\rm e}^{s \left ( b+y \right ) +isx}}}{{{\rm e}^{2\,sb}}-1}}\,{\rm d}s}+1/2\,{\frac{1}{\pi }\int _{-\infty }^{\infty }\!-{\frac{\int _{-\infty }^{\infty }\!h \left ( x \right ){{\rm e}^{-isx}}\,{\rm d}x{{\rm e}^{s \left ( b-y \right ) +isx}}}{{{\rm e}^{2\,sb}}-1}}\,{\rm d}s}$

_______________________________________________________________________________________

#### 11.19 in Rectangle, right edge at inﬁnity

problem number 101

Added December 20, 2018.

Solve for $$u( x,y)$$

\begin{align*} \frac{\partial ^2 u}{\partial x^2}+\frac{\partial ^2 u}{\partial y^2}=0 \end{align*}

Boundary conditions \begin{align*} u(x, 0) &= 0 \\ u(x, a) &= 0\\ u(0,y) &= \sin (y) \\ u(\infty ,y) &=0 \end{align*}

Mathematica

$\text{DSolve}\left [\left \{u^{(0,2)}(x,y)+u^{(2,0)}(x,y)=0,\{u(x,0)=0,u(x,a)=0,u(0,y)=\sin (y),u(\infty ,y)=0\}\right \},u(x,y),\{x,y\},\text{Assumptions}\to a>0\right ]$

Maple

$u \left ( x,y \right ) =\sum _{n=1}^{\infty }2\,{\frac{1}{a}\cases{1/2\,\pi \,n&a=\pi \,n\cr -{\frac{\pi \, \left ( -1 \right ) ^{n}\sin \left ( a \right ) na}{{\pi }^{2}{n}^{2}-{a}^{2}}}&otherwise\cr }{{\rm e}^{-{\frac{n\pi \,x}{a}}}}\sin \left ({\frac{\pi \,ny}{a}} \right ) }$

_______________________________________________________________________________________

#### 11.20 Laplace PDE inside quarter disk, Neumann BC at edge

problem number 102

Added December 20, 2018.

Solve Laplace equation in polar coordinates inside quarter disk with $$0<r<1$$ and $$0<\theta <\frac{\pi }{2}$$

Solve for $$u\left ( r,\theta \right )$$

\begin{align*} \frac{\partial ^{2}u}{\partial r^{2}}+\frac{1}{r}\frac{\partial u}{\partial r} +\frac{1}{r^{2}}\frac{\partial ^{2}u}{\partial \theta ^{2}} & =0\\ \end{align*}

Boundary conditions

\begin{align*} u(r,0) &= 0 \\ u(r,\frac{\pi }{2}) &=0 \ \frac{\partial u}{\partial r}(1,\theta ) &= f(\theta ) \end{align*}

Mathematica

$\text{DSolve}\left [\left \{\frac{u^{(0,2)}(r,\theta )}{r^2}+\frac{u^{(1,0)}(r,\theta )}{r}+u^{(2,0)}(r,\theta )=0,\left \{u^{(1,0)}(1,\theta )=f(\theta )\right \},\left \{u(r,0)=0,u\left (r,\frac{\pi }{2}\right )=0\right \}\right \},u(r,\theta ),\{r,\theta \},\text{Assumptions}\to \left \{r>0,r<1,\theta >0,\theta <\frac{\pi }{2}\right \}\right ]$

Maple

$u \left ( r,\theta \right ) =\sum _{n=1}^{\infty } \left ( 2\,{\frac{\int _{0}^{\pi /2}\!f \left ( \theta \right ) \sin \left ( 2\,n\theta \right ) \,{\rm d}\theta{r}^{2\,n}\sin \left ( 2\,n\theta \right ) }{\pi \,n}} \right )$