13 Laplace PDE in Cartesian coordinates

13.1 Laplace PDE inside rectangle (Haberman 2.5.1 (a))
13.2 Laplace PDE inside rectangle (Haberman 2.5.1 (b))
13.3 Laplace PDE inside rectangle (Haberman 2.5.1 (c))
13.4 Laplace PDE inside rectangle (Haberman 2.5.1 (d))
13.5 Laplace PDE inside rectangle (Haberman 2.5.1 (e))
13.6 Laplace PDE inside rectangle, top/bottom edges non-zero
13.7 Laplace PDE inside rectangle, top edge at infinity, left edge nonhomogeneous constant
13.8 Laplace PDE inside rectangle, top edge at infinity, right edge nonhomogeneous constant
13.9 Laplace PDE inside rectangle, right edge at infinity, bottom edge nonhomogeneous constant
13.10 Laplace PDE inside rectangle, right edge at infinity, top edge nonhomogeneous function \(e^{-x}\)
13.11 Laplace PDE inside rectangle, right edge at infinity, top edge nonhomogeneous function \(f(x)\)
13.12 Laplace PDE in 2D Cartessian with boundary condition as Dirac function
13.13 Laplace PDE in rectangle, one side homogeneous and 3 sides are not
13.14 Laplace on all of the right half plane with \(u=f(y)\) on the \(y\) axes
13.15 Laplace PDE in rectangle with infinity in the \(x\) direction with \(u=\sin (y)\) on left edge.
13.16 Laplace PDE inside a disk, periodic boundary conditions
13.17 Dirichlet problem for the Laplace equation in upper half plan
13.18 Dirichlet problem for the Laplace equation in right half-plane:
13.19 Dirichlet problem for the Laplace equation in the first quadrant
13.20 Neumann problem for the Laplace equation in the upper half-plane
13.21 Dirichlet problem for the Laplace equation in a rectangle
13.22 Cartessian coordinates with boundary conditions on two sides only
13.23 in Rectangle, right edge at infinity
13.24 Laplace PDE inside quarter disk, Neumann BC at edge

____________________________________________________________________________________

13.1 Laplace PDE inside rectangle (Haberman 2.5.1 (a))

problem number 94

This is problem 2.5.1 part (a) from Richard Haberman applied partial differential 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

ClearAll[u, t, k, x, L, H, f]; 
 pde = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0; 
 bc = {Derivative[1, 0][u][0, y] == 0, Derivative[1, 0][u][L, y] == 0, u[x, 0] == 0, u[x, H] == f[x]}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {0 <= x <= L && 0 <= y <= H}], 60*10]]; 
 sol = sol /. {K[1] -> n};
 

\[ \left \{\left \{u(x,y)\to \sum _{n=1}^{\infty }\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

 
H:='H';L:='L'; u:='u'; y:='y'; x:='x';f:='f'; 
interface(showassumed=0); 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
assume(L>0 and H>0); 
bc:=D[1](u)(0,y)=0,D[1](u)(L,y)=0,u(x,0)=0,u(x,H)=f(x); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,bc],u(x,y)) assuming(0<=x and x<=L and 0<=y and y<=H)),output='realtime')); 
#these simplifications below to convert answer to one that match standard; 
sol:=convert(sol,trigh); 
sol:=simplify(expand(sol));
 

\[ 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 ) } \]

____________________________________________________________________________________

13.2 Laplace PDE inside rectangle (Haberman 2.5.1 (b))

problem number 95

This is problem 2.5.1 part (b) from Richard Haberman applied partial differential 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

ClearAll[u, t, k, x, L, H, g, f]; 
 pde = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0; 
 bc = {Derivative[1, 0][u][0, y] == g[y], Derivative[1, 0][u][L, y] == 0, u[x, 0] == 0, u[x, H] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {0 <= x <= L && 0 <= y <= H}], 60*10]]; 
 sol = sol /. {K[1] -> n};
 

\[ \left \{\left \{u(x,y)\to \sum _{n=1}^{\infty }-\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

 
H:='H';L:='L'; u:='u'; y:='y'; x:='x';f:='f';g:='g'; 
interface(showassumed=0); 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
assume(L>0 and H>0): 
bc:=D[1](u)(0,y)=g(y),D[1](u)(L,y)=0,u(x,0)=0,u(x,H)=0: 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,bc],u(x,y)) assuming(0<=x and x<=L and 0<=y and y<=H)),output='realtime')); 
sol:=convert(sol,trigh);
 

\[ 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 ) \]

____________________________________________________________________________________

13.3 Laplace PDE inside rectangle (Haberman 2.5.1 (c))

problem number 96

This is problem 2.5.1 part (c) from Richard Haberman applied partial differential 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

ClearAll[u, t, k, x, L, H, g, f]; 
 pde = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0; 
 bc = {Derivative[1, 0][u][0, y] == 0, u[L, y] == g[y], u[x, 0] == 0, u[x, H] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {0 <= x <= L && 0 <= y <= H}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
H:='H';L:='L'; u:='u'; y:='y'; x:='x';f:='f';g:='g'; 
interface(showassumed=0); 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
assume(L>0 and H>0); 
bc:=D[1](u)(0,y)=0,u(L,y)=g(y),u(x,0)=0,u(x,H)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,bc],u(x,y)) assuming(0<=x and x<=L and 0<=y and y<=H)),output='realtime')); 
sol:=convert(sol,trigh);
 

\[ 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 ) \]

____________________________________________________________________________________

13.4 Laplace PDE inside rectangle (Haberman 2.5.1 (d))

problem number 97

This is problem 2.5.1 part (d) from Richard Haberman applied partial differential 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

ClearAll[u, x, L, H, g, f]; 
 pde = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0; 
 bc = {u[0, y] == 0, u[L, y] == 0, Derivative[0, 1][u][x, 0] == 0, u[x, H] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {0 <= x <= L && 0 <= y <= H}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
H:='H';L:='L'; u:='u'; y:='y'; x:='x';f:='f';g:='g'; 
interface(showassumed=0); 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
assume(L>0 and H>0); 
bc:=u(0,y)=g(y),u(L,y)=0,D[2](u)(x,0)=0,u(x,H)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y)) assuming(0<=x and x<=L and 0<=y and y<=H)),output='realtime')); 
sol:=convert(sol,trigh);
 

\[ 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 { \left ( 1+2\,n \right ) \pi \, \left ( 2\,L-x \right ) }{H}} \right ) +\sinh \left ( 1/2\,{\frac { \left ( 1+2\,n \right ) \pi \, \left ( 2\,L-x \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 ) \]

____________________________________________________________________________________

13.5 Laplace PDE inside rectangle (Haberman 2.5.1 (e))

problem number 98

This is problem 2.5.1 part (e) from Richard Haberman applied partial differential 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

ClearAll[u, x, L, H, g, f]; 
 pde = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0; 
 bc = {u[0, y] == 0, u[L, y] == 0, u[x, 0] - Derivative[0, 1][u][x, 0] == 0, u[x, H] == f[x]}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {0 <= x <= L && 0 <= y <= H}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
H:='H';L:='L'; u:='u'; y:='y'; x:='x';f:='f';g:='g'; 
interface(showassumed=0); 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
assume(L>0 and H>0); 
bc:=u(0,y)=0,u(L,y)=0,u(x,0)-D[2](u)(x,0)=0,u(x,H)=f(x); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y)) assuming(0<=x and x<=L and 0<=y and y<=H)),output='realtime')); 
sol:=convert(sol,trigh);
 

\[ u \left ( x,y \right ) =\sum _{n=1}^{\infty } \left ( 4\,{\frac {1}{L}\int _{0}^{L}\!\sin \left ( {\frac {n\pi \,x}{L}} \right ) f \left ( x \right ) \,{\rm d}x \left ( \cosh \left ( {\frac {n\pi \,H}{L}} \right ) +\sinh \left ( {\frac {n\pi \,H}{L}} \right ) \right ) \sin \left ( {\frac {n\pi \,x}{L}} \right ) \left ( \pi \,\cosh \left ( {\frac {n\pi \,y}{L}} \right ) n+L\,\sinh \left ( {\frac {n\pi \,y}{L}} \right ) \right ) \left ( \pi \,\sinh \left ( 2\,{\frac {n\pi \,H}{L}} \right ) n+\pi \,\cosh \left ( 2\,{\frac {n\pi \,H}{L}} \right ) n+L\,\sinh \left ( 2\,{\frac {n\pi \,H}{L}} \right ) +L\,\cosh \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 different 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\begin {equation} X^{\prime \prime }+\lambda X=0 \tag {1} \end {equation} With the boundary conditions\begin {align*} X\left ( 0\right ) & =0\\ X\left ( L\right ) & =0 \end {align*}

And\begin {equation} Y^{\prime \prime }-\lambda Y=0 \tag {2} \end {equation} 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 {\left \vert \lambda \right \vert }x\right ) +B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }x\right ) \] At \(x=0\), the above gives \(0=A\). Hence \(X=B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }x\right ) \). At \(x=L\) this gives \(X=B\sinh \left ( \sqrt {\left \vert \lambda \right \vert }L\right ) \). But \(\sinh \left ( \sqrt {\left \vert \lambda \right \vert }L\right ) =0\) only at \(0\) and \(\sqrt {\left \vert \lambda \right \vert }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\begin {equation} X_{n}\left ( x\right ) =B_{n}\sin \left ( \frac {n\pi }{L}x\right ) \qquad n=1,2,3,\cdots \tag {3} \end {equation} 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\begin {equation} 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} \end {equation} 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).

____________________________________________________________________________________

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

problem number 99

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

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 L0 = 1; 
 H0 = 2; 
 bc = DirichletCondition[u[x, y] == Piecewise[{{UnitTriangle[2*x - L0], y == 0 || y == H0}}, 0], True]; 
 domain = Rectangle[{0, 0}, {L0, H0}]; 
 sol = AbsoluteTiming[TimeConstrained[Simplify[DSolve[{pde, bc}, u[x, y], Element[{x, y}, domain]]], 60*10]]; 
 sol = sol /. K[1] -> n;
 

\[ \left \{\left \{u(x,y)\to \sum _{n=1}^{\infty }\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:='u'; y:='y'; x:='x'; 
interface(showassumed=0); 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
f:=x-> piecewise(x>0 and x<1/2, 2*x, x>1/2 and x<1, 2-2*x); 
bc:=u(0,y)=0,u(1,y)=0,u(x,0)=f(x),u(x,2)=f(x); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y)) assuming x>0,y>0),output='realtime'));
 

\[ 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 ) }} \]

____________________________________________________________________________________

13.7 Laplace PDE inside rectangle, top edge at infinity, left edge nonhomogeneous constant

problem number 100

Added December 20, 2018.

Example 21, Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018

Solve Laplace equation \[ u_{xx}+u_{yy} = 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

ClearAll[u, x, y, L, A]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[0, y] == A, u[L, y] == 0, u[x, 0] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[Simplify[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {x > 0, y > 0, L > 0}]], 60*10]];
 

\[ \text {Failed} \]

Maple

 
u:='u'; y:='y'; x:='x';L:='L';A:='A'; 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2) = 0; 
bc_left_edge := u(0, y) = A; 
bc_right_edge:= u(L, y) = 0; 
bc_bottom_edge:= u(x, 0) = 0; 
bc:=bc_left_edge ,bc_right_edge,bc_bottom_edge; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], HINT = boundedseries(y = infinity)) assuming x>0,y>0,L>0),output='realtime'));
 

\[ 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 ) } \]

Hand solution

Let \begin {equation} u=U+v\tag {1} \end {equation} Where \(U\) satisfies \(\nabla ^{2}U=0\) but with right edge boundary conditions zero, and \(v\left ( x\right ) \) satisfies the nonhomogeneous boundary conditions \(v\left ( 0\right ) =A,v\left ( L\right ) =0\). This implies \[ v\left ( x\right ) =A\left ( 1-\frac {x}{L}\right ) \] Hence \(u=U+A\left ( 1-\frac {x}{L}\right ) \). Substituting this back in \(\nabla ^{2}u=0\) gives\[ \nabla ^{2}U=0 \] But with boundary condition on right edge being zero now. Let \(U=X\left ( x\right ) Y\left ( x\right ) \). Substituting this in the above gives\[ \frac {X^{\prime \prime }}{X}+\frac {Y^{\prime \prime }}{Y}=0 \] We want the eigenvalue problem to be in the \(X\) direction. Hence \begin {align*} X^{\prime \prime }+\lambda X & =0\\ X\left ( 0\right ) & =0\\ X\left ( L\right ) & =0 \end {align*}

This has eigenvalues \(\lambda _{n}=\left ( \frac {n\pi }{L}\right ) ^{2},n=1,2,\cdots \) with eigenfunctions \(X_{n}\left ( x\right ) =\sin \left ( \sqrt {\lambda _{n}}x\right ) \). The \(Y\) ode is\begin {align*} Y_{n}^{\prime \prime }-\lambda _{n}Y_{n} & =0\\ Y_{n}\left ( 0\right ) & =0 \end {align*}

Since \(\lambda _{n}>0\) then the solution is \(Y_{n}\left ( y\right ) =c_{1_{n}}e^{\sqrt {\lambda _{n}}y}+c_{2_{n}}e^{-\sqrt {\lambda _{n}}y}\). Since \(Y_{n}\left ( y\right ) \) is bounded, then \(c_{1_{n}}=0\) and the \(Y_{n}\left ( y\right ) =c_{2_{n}}e^{-\sqrt {\lambda _{n}}y}\). Hence\begin {align*} U\left ( x,y\right ) & =\sum _{n=1}^{\infty }X_{n}\left ( x\right ) Y_{n}\left ( y\right ) \\ & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \sqrt {\lambda _{n}}x\right ) e^{-\sqrt {\lambda _{n}}y}\\ & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) e^{-\frac {n\pi }{L}y} \end {align*}

Using the above in (1) gives the solution\begin {equation} u\left ( x,y\right ) =A\left ( 1-\frac {x}{L}\right ) +\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) e^{-\frac {n\pi }{L}y}\tag {2} \end {equation} At \(y=0\) the above gives\begin {align*} 0 & =A\left ( 1-\frac {x}{L}\right ) +\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) \\ A\left ( \frac {x}{L}-1\right ) & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) \end {align*}

Therefore \(B_{n}\) are the Fourier sine coefficients of \(\frac {A}{L}x\)\begin {align*} B_{n} & =\frac {2}{L}\int _{0}^{L}A\left ( \frac {x}{L}-1\right ) \sin \left ( \frac {n\pi }{L}x\right ) dx\\ & =\frac {2A}{L}\int _{0}^{L}\left ( \frac {x}{L}-1\right ) \sin \left ( \frac {n\pi }{L}x\right ) dx\\ & =-\frac {2A}{L}\frac {L}{n\pi }\\ & =-\frac {2A}{n\pi } \end {align*}

Hence the solution (2) becomes\[ u\left ( x,y\right ) =A\left ( 1-\frac {x}{L}\right ) -2\frac {A}{\pi }\sum _{n=1}^{\infty }\frac {1}{n}\sin \left ( \frac {n\pi }{L}x\right ) e^{-\frac {n\pi }{L}y}\]

____________________________________________________________________________________

13.8 Laplace PDE inside rectangle, top edge at infinity, right edge nonhomogeneous constant

problem number 101

Added March 19, 2019

Solve Laplace equation \[ u_{xx} + u_{yy} = 0 \]

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

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

Mathematica

ClearAll[u, x, y, L, A]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[0, y] == 0, u[L, y] == A, u[x, 0] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[Simplify[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {x > 0, y > 0, L > 0}]], 60*10]];
 

\[ \text {Failed} \]

Maple

 
u:='u'; y:='y'; x:='x';L:='L';A:='A'; 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2) = 0; 
bc_left_edge := u(0, y) = 0; 
bc_right_edge:= u(L, y) = A; 
bc_bottom_edge:= u(x, 0) = 0; 
bc:=bc_left_edge ,bc_right_edge,bc_bottom_edge; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], HINT = boundedseries(y = infinity)) assuming x>0,y>0,L>0),output='realtime'));
 

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

Hand solution

Let \begin {equation} u=U+v\tag {1} \end {equation} Where \(U\) satisfies \(\nabla ^{2}U=0\) but with right edge boundary conditions zero, and \(v\left ( x\right ) \) satisfies the nonhomogeneous boundary conditions \(v\left ( 0\right ) =0A,v\left ( L\right ) =A\). This implies \[ v\left ( x\right ) =A\frac {x}{L}\] Hence \(u=U+\frac {A}{L}x\). Substituting this back in \(\nabla ^{2}u=0\) gives\[ \nabla ^{2}U=0 \] But with boundary condition on right edge being zero now. Let \(U=X\left ( x\right ) Y\left ( x\right ) \). Substituting this in the above gives\[ \frac {X^{\prime \prime }}{X}+\frac {Y^{\prime \prime }}{Y}=0 \] We want the eigenvalue problem to be in the \(X\) direction. Hence \begin {align*} X^{\prime \prime }+\lambda X & =0\\ X\left ( 0\right ) & =0\\ X\left ( L\right ) & =0 \end {align*}

This has eigenvalues \(\lambda _{n}=\left ( \frac {n\pi }{L}\right ) ^{2},n=1,2,\cdots \) with eigenfunctions \(X_{n}\left ( x\right ) =\sin \left ( \sqrt {\lambda _{n}}x\right ) \). The \(Y\) ode is\begin {align*} Y_{n}^{\prime \prime }-\lambda _{n}Y_{n} & =0\\ Y_{n}\left ( 0\right ) & =0 \end {align*}

Since \(\lambda _{n}>0\) then the solution is \(Y_{n}\left ( y\right ) =c_{1_{n}}e^{\sqrt {\lambda _{n}}y}+c_{2_{n}}e^{-\sqrt {\lambda _{n}}y}\). Since \(Y_{n}\left ( y\right ) \) is bounded, then \(c_{1_{n}}=0\) and the \(Y_{n}\left ( y\right ) =c_{2_{n}}e^{-\sqrt {\lambda _{n}}y}\). Hence\begin {align*} U\left ( x,y\right ) & =\sum _{n=1}^{\infty }X_{n}\left ( x\right ) Y_{n}\left ( y\right ) \\ & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \sqrt {\lambda _{n}}x\right ) e^{-\sqrt {\lambda _{n}}y}\\ & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) e^{-\frac {n\pi }{L}y} \end {align*}

Using the above in (1) gives the solution\begin {equation} u\left ( x,y\right ) =\frac {A}{L}x+\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) e^{-\frac {n\pi }{L}y}\tag {2} \end {equation} At \(y=0\) the above gives\begin {align*} 0 & =\frac {A}{L}x+\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) \\ -\frac {A}{L}x & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}x\right ) \end {align*}

Therefore \(B_{n}\) are the Fourier sine coefficients of \(-\frac {A}{L}x\)\begin {align*} B_{n} & =-\frac {2}{L}\int _{0}^{L}\frac {A}{L}x\sin \left ( \frac {n\pi }{L}x\right ) dx\\ & =-\frac {2A}{L^{2}}\int _{0}^{L}x\sin \left ( \frac {n\pi }{L}x\right ) dx\\ & =-\frac {2A}{L^{2}}\frac {\left ( -1\right ) ^{n+1}L^{2}}{n\pi }\\ & =\frac {2A}{n\pi }\left ( -1\right ) ^{n} \end {align*}

Hence the solution (2) becomes\[ u\left ( x,y\right ) =\frac {A}{L}x+\frac {2A}{\pi }\sum _{n=1}^{\infty }\frac {\left ( -1\right ) ^{n}}{n}\sin \left ( \frac {n\pi }{L}x\right ) e^{-\frac {n\pi }{L}y}\]

____________________________________________________________________________________

13.9 Laplace PDE inside rectangle, right edge at infinity, bottom edge nonhomogeneous constant

problem number 102

Added March 19, 2019.

Solve Laplace equation \[ u_{xx}+u_{yy}= 0 \]

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

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

Mathematica

ClearAll[u, x, y, L, A]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[0, y] == 0, u[x, 0] == A, u[x, L] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[Simplify[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {x > 0, y > 0, L > 0}]], 60*10]];
 

\[ \text {Failed} \]

Maple

 
u:='u'; y:='y'; x:='x';L:='L';A:='A'; 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2) = 0; 
bc_left_edge := u(0, y) = 0; 
bc_top_edge:= u(x, L) = 0; 
bc_bottom_edge:= u(x, 0) = A; 
bc:=bc_left_edge ,bc_top_edge,bc_bottom_edge; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], HINT = boundedseries(x = infinity)) assuming x>0,y>0,L>0),output='realtime'));
 

\[ \text { sol=() } \]

Hand solution

Let \begin {equation} u\left ( x,y\right ) =U\left ( x,y\right ) +v\left ( y\right ) \tag {1} \end {equation} Where \(U\) satisfies \(\nabla ^{2}U=0\) but with bottom edge boundary conditions zero, and \(v\left ( y\right ) \) satisfies the nonhomogeneous boundary conditions \(v\left ( 0\right ) =A,v\left ( L\right ) =0\). This implies \[ v\left ( y\right ) =A\left ( 1-\frac {y}{L}\right ) \] Substituting (1) back in \(\nabla ^{2}u=0\) results in\[ \nabla ^{2}U=0 \] But with boundary condition on bottom edge as \(U=0\). Now we can use separation of variables. Let \(U=X\left ( x\right ) Y\left ( x\right ) \). Substituting this in the above gives\[ \frac {X^{\prime \prime }}{X}+\frac {Y^{\prime \prime }}{Y}=0 \] We want the eigenvalue problem to be in the \(Y\) direction. Hence\[ \frac {Y^{\prime \prime }}{Y}=-\frac {X^{\prime \prime }}{X}=-\lambda \] Therefore the eigenvalue problem is\begin {align*} Y^{\prime \prime }+\lambda Y & =0\\ Y\left ( 0\right ) & =0\\ Y\left ( L\right ) & =0 \end {align*}

This has eigenvalues \(\lambda _{n}=\left ( \frac {n\pi }{L}\right ) ^{2},n=1,2,\cdots \) with eigenfunctions \(Y_{n}\left ( x\right ) =\sin \left ( \sqrt {\lambda _{n}}y\right ) \). The \(X\) ode is\begin {align*} X_{n}^{\prime \prime }-\lambda _{n}X_{n} & =0\\ X_{n}\left ( 0\right ) & =0 \end {align*}

Since \(\lambda _{n}>0\) then the solution is \(X_{n}\left ( y\right ) =c_{1_{n}}e^{\sqrt {\lambda _{n}}x}+c_{2_{n}}e^{-\sqrt {\lambda _{n}}x}\). Since \(X_{n}\left ( x\right ) \) is bounded, then \(c_{1_{n}}=0\) and the \(X_{n}\left ( x\right ) =c_{2_{n}}e^{-\sqrt {\lambda _{n}}x}\). Hence by superposition the solution is\begin {align*} U\left ( x,y\right ) & =\sum _{n=1}^{\infty }X_{n}\left ( x\right ) Y_{n}\left ( y\right ) \\ & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \sqrt {\lambda _{n}}y\right ) e^{-\sqrt {\lambda _{n}}x}\\ & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}y\right ) e^{-\frac {n\pi }{L}x} \end {align*}

Substituting the above in (1) gives\begin {equation} u\left ( x,y\right ) =A\left ( 1-\frac {y}{L}\right ) +\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}y\right ) e^{-\frac {n\pi }{L}x}\tag {2} \end {equation} At \(x=0\) the above gives\begin {align*} 0 & =A\left ( 1-\frac {y}{L}\right ) +\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}y\right ) \\ A\left ( \frac {y}{L}-1\right ) & =\sum _{n=1}^{\infty }B_{n}\sin \left ( \frac {n\pi }{L}y\right ) \end {align*}

Therefore \(B_{n}\) are the Fourier sine coefficients of \(A\left ( \frac {y}{L}-1\right ) \)\begin {align*} B_{n} & =\frac {2}{L}\int _{0}^{L}A\left ( \frac {y}{L}-1\right ) \sin \left ( \frac {n\pi }{L}y\right ) dy\\ & =\frac {2A}{L}\int _{0}^{L}\left ( \frac {y}{L}-1\right ) \sin \left ( \frac {n\pi }{L}y\right ) dy\\ & =-\frac {2A}{L}\frac {L}{n\pi }\\ & =-\frac {2A}{n\pi } \end {align*}

Hence the solution (2) becomes\[ u\left ( x,y\right ) =A\left ( 1-\frac {y}{L}\right ) -\frac {2A}{\pi }\sum _{n=1}^{\infty }\frac {1}{n}\sin \left ( \frac {n\pi }{L}y\right ) e^{-\frac {n\pi }{L}x}\]

____________________________________________________________________________________

13.10 Laplace PDE inside rectangle, right edge at infinity, top edge nonhomogeneous function \(e^{-x}\)

problem number 103

Added March 20, 2019.

Solve Laplace equation \[ u_{xx}+u_{yy} = 0 \]

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

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

Mathematica

ClearAll[u, x, y, L, A]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[0, y] == 0, u[x, L] == Exp[-x], u[x, 0] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[Simplify[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {x > 0, y > 0, L > 0}]], 60*10]];
 

\[ \text {Failed} \]

Maple

 
u:='u'; y:='y'; x:='x';L:='L';A:='A'; 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2) = 0; 
bc_left_edge := u(0, y) = 0; 
bc_top_edge:= u(x, L) = exp(-x); 
bc_bottom_edge:= u(x, 0) = 0; 
bc:=bc_left_edge ,bc_top_edge,bc_bottom_edge; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc],u(x,y)) assuming x>0,y>0,L>0),output='realtime'));
 

\[ u \left ( x,y \right ) ={\frac {1}{L} \left ( \sum _{n=1}^{\infty }-{\frac {1}{\pi \,n \left ( \pi \,n+L \right ) }\sin \left ( {\frac {n\pi \,y}{L}} \right ) \left ( {\it \_C5} \left ( n \right ) \left ( -{\pi }^{2}{n}^{2}+{L}^{2} \right ) {{\rm e}^{-{\frac {n\pi \,x}{L}}}}+ \left ( \left ( 2\,\pi \,n+4\,L \right ) \left ( -1 \right ) ^{n+1}+{\it \_C5} \left ( n \right ) \left ( \pi \,n+L \right ) ^{2} \right ) {{\rm e}^{{\frac {n\pi \,x}{L}}}}-2\,L \left ( - \left ( -1 \right ) ^{n}{{\rm e}^{-x}}+{\it \_C5} \left ( n \right ) \left ( \pi \,n+L \right ) \right ) \right ) }L+y{{\rm e}^{-x}} \right ) } \] I need to find out how Maple obtained the above solution. It seems to have unknown constant in it

Hand solution

Let \(u=X\left ( x\right ) Y\left ( x\right ) \). Substituting this in \(\nabla ^{2}u=0\)\[ \frac {X^{\prime \prime }}{X}+\frac {Y^{\prime \prime }}{Y}=0 \] We want the eigenvalue problem to be in the \(X\) direction. Hence\[ \frac {X^{\prime \prime }}{X}=-\frac {Y^{\prime \prime }}{Y}=-\lambda \] Therefore the eigenvalue problem is\begin {align*} X^{\prime \prime }+\lambda X & =0\\ X\left ( 0\right ) & =0\\ \left \vert X\left ( x\right ) \right \vert & <\infty \end {align*}

case \(\lambda <0\)

Solution is \(X\left ( x\right ) =c_{1}\cosh \left ( \sqrt {-\lambda }x\right ) +c_{2}\sinh \left ( \sqrt {-\lambda }x\right ) \). Since \(X\left ( 0\right ) =0\) then \(c_{1}=0\). Solution becomes \(X\left ( x\right ) =c_{2}\sinh \left ( \sqrt {-\lambda }x\right ) \). Since \(\sinh \) is not bounded on \(x>0\) as \(x\rightarrow \infty \) then \(c_{2}=0\). Therefore \(\lambda <0\) is not eigenvalue.

case \(\lambda =0\)

Solution is \(X\left ( x\right ) =c_{1}x+c_{2}\). At \(x=0\) this gives \(c_{2}=0\).  Hence solution is \(X\left ( x\right ) =c_{1}x\). This is bounded as \(x\rightarrow \infty \) only when \(c_{1}=0\). Therefore \(\lambda =0\) is not eigenvalue.

case \(\lambda >0\)

Let \(\lambda =\alpha ^{2},\alpha >0\). Then solution is \(X\left ( x\right ) =c_{1}\cos \left ( \alpha x\right ) +c_{2}\sin \left ( \alpha x\right ) \). At \(x=0\) this results in \(0=c_{1}\). Hence the eigenvalues are \(\lambda =\alpha ^{2}\) for all real positive real numbers and eigenfunctions are \[ X_{\alpha }\left ( x\right ) =\sin \left ( \alpha x\right ) \] For the \(Y\) ode, \begin {align*} Y^{\prime \prime }-\alpha ^{2}Y & =0\\ Y\left ( 0\right ) & =0 \end {align*}

The solution is \(Y_{\alpha }\left ( y\right ) =c_{1}e^{\alpha y}+c_{2}e^{-\alpha y}\). Since \(Y\left ( 0\right ) =0\) then \(c_{2}=-c_{1}\) and the solution becomes \(Y_{\alpha }\left ( y\right ) =c_{1}\left ( e^{\alpha y}-e^{-\alpha y}\right ) =c_{1}\sinh \left ( \alpha y\right ) \). Hence the solution is generalized linear combination of \(Y\left ( y\right ) X\left ( x\right ) \) given by Fourier integral (since eigenvalues are continuous now and not discrete)\begin {align} u\left ( x,y\right ) & =\int _{0}^{\infty }A\left ( \alpha \right ) Y_{\alpha }\left ( y\right ) X_{\alpha }\left ( x\right ) d\alpha \nonumber \\ & =\int _{0}^{\infty }A\left ( \alpha \right ) \sinh \left ( \alpha y\right ) \sin \left ( \alpha x\right ) d\alpha \tag {1} \end {align}

When \(y=L\), then above becomes\[ e^{-x}=\int _{0}^{\infty }\left ( A\left ( \alpha \right ) \sinh \left ( \alpha L\right ) \right ) \sin \left ( \alpha x\right ) d\alpha \] Hence the coefficient\(\ A\left ( \alpha \right ) \sinh \left ( \alpha L\right ) \) is given by\begin {align*} A\left ( \alpha \right ) \sinh \left ( \alpha L\right ) & =\frac {2}{\pi }\int _{0}^{\infty }e^{-x}\sin \left ( \alpha x\right ) dx\\ & =\frac {2}{\pi }\frac {\alpha }{1+\alpha ^{2}} \end {align*}

Therefore \(A\left ( \alpha \right ) =\frac {2}{\pi \sinh \left ( \alpha L\right ) }\frac {\alpha }{1+\alpha }\). The solution (1) becomes\[ u\left ( x,y\right ) =\frac {2}{\pi }\int _{0}^{\infty }\frac {\alpha \sinh \left ( \alpha y\right ) \sin \left ( \alpha x\right ) }{\left ( 1+\alpha ^{2}\right ) \sinh \left ( \alpha L\right ) }d\alpha \]

____________________________________________________________________________________

13.11 Laplace PDE inside rectangle, right edge at infinity, top edge nonhomogeneous function \(f(x)\)

problem number 104

Added April 4, 2019.

Exam problem, Math 4567, UMN. Spring 2019.

Solve Laplace equation \[ u_{xx}+u_{yy} = 0 \]

Inside a rectangle \(0 \leq y \leq 1, 0 \leq x \leq \infty \), with following boundary conditions

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

Mathematica

ClearAll[u, x, y, L, A]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[0, y] == 0, u[x, 1] == f[x], u[x, 0] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[Simplify[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {x > 0, y > 0}]], 60*10]];
 

\[ \text {Failed} \]

Maple

unassign('u,y,x,f'); 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2) = 0; 
bc_left_edge := u(0, y) = 0; 
bc_top_edge:= u(x, 1) = f(x); 
bc_bottom_edge:= u(x, 0) = 0; 
bc:=bc_left_edge ,bc_top_edge,bc_bottom_edge; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc],u(x,t)) assuming x>0,y>0),output='realtime'));
 

\[ \text { Exception } \] Maple can not solve it when using boundedseries(x = infinity)

____________________________________________________________________________________

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

problem number 105

Added December 20, 2018

Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-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

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = u[x, 0] == DiracDelta[x]; 
 sol = AbsoluteTiming[TimeConstrained[Simplify[DSolve[{pde, bc}, u[x, y], x, y]], 60*10]];
 

\[ \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:='u'; y:='y'; x:='x'; 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
bc := u(x, 0) = Dirac(x); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc],u(x,y),method=Fourier)),output='realtime')); 
sol:=convert(sol,Int);
 

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

____________________________________________________________________________________

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

problem number 106

Added December 20, 2018

Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018

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

\[ u_{xx}+u_{yy} = 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

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[0, y] == 0, u[Pi, y] == Sinh[Pi]*Cos[y], u[x, 0] == Sin[x], u[x, Pi] == -Sinh[x]}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], x, y], 60*10]];
 

\[ \left \{\left \{u(x,y)\to \sum _{K[1]=1}^{\infty }\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:='u'; y:='y'; x:='x'; 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2) = 0; 
bc_left_side:=  u(0,y)=0; 
bc_right_side:= u(Pi,y)=sinh(Pi)*cos(y); 
bc_bottom_side:= u(x,0)=sin(x); 
bc_top_side:= u(x,Pi)=-sinh(x); 
bc:= bc_left_side,bc_right_side,bc_bottom_side,bc_top_side; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime'));
 

\[ 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 ) } \]

____________________________________________________________________________________

13.14 Laplace on all of the right half plane with \(u=f(y)\) on the \(y\) axes

problem number 107

PDE example 18 from Maple help page

see march_20_2019_11_pm.tex for start of solution. Not completed yet

Solve Laplace equation \[ u_{xx} + u_{yy} = 0 \]

With boundary conditions

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

Mathematica

ClearAll[u, x, y]; 
 pde = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0; 
 bc = u[0, y] == Sin[y]/y; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {0 <= x && 0 <= y}], 60*10]];
 

\[ \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

 
x:='x'; y:='y'; u:='u'; 
interface(showassumed=0); 
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
bc:=u(0,y)=sin(y)/y; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime'));
 

\[ 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}} \]

____________________________________________________________________________________

13.15 Laplace PDE in rectangle with infinity in the \(x\) direction with \(u=\sin (y)\) on left edge.

problem number 108

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

ClearAll[x, y, a]; 
 ode = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0; 
 bc = {u[x, 0] == 0, u[x, a] == 0, u[0, y] == Sin[y], u[Infinity, y] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{ode, bc}, u[x, y], {x, y}, Assumptions -> a > 0], 60*10]];
 

\[ \text {Failed} \]

Maple

 
x:='x'; y:='y'; a:='a'; 
interface(showassumed=0); 
ode:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0; 
bc:=u(x,0)=0, u(x,a)=0, u(0,y)=sin(y), u(infinity,y)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve({ode, bc}, u(x,y)) assuming a>0),output='realtime'));
 

\[ \text {Bad latex generated} \]

____________________________________________________________________________________

13.16 Laplace PDE inside a disk, periodic boundary conditions

problem number 109

Solve Laplace equation in polar coordinates inside a disk

Solve for \(u\left ( r,\theta \right ) \) \begin {align*} u_{rr} + \frac {1}{r} u_r + \frac {1}{r^2} u_{\theta \theta }=0 \end {align*}

With \(0 \leq r\leq a, 0 < \theta \leq 2\pi \)

Boundary conditions \begin {align*} u(a,\theta ) & = f(\theta ) \\ \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

ClearAll[u, theta, r, a, f]; 
 pde = D[u[r, theta], {r, 2}] + (1*D[u[r, theta], r])/r + (1*D[u[r, theta], {theta, 2}])/r^2 == 0; 
 bc = u[a, theta] == f[theta]; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[r, theta], {r, theta}, Assumptions -> a < r && a > 0 && Inequality[0, Less, theta, LessEqual, 2*Pi]], 60*10]]; 
 sol = sol /. K[1] -> n;
 

\[ \left \{\left \{u(r,\theta )\to \sum _{n=1}^{\infty }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

 
r:='r'; theta:='theta'; a:='a'; r:='r';f:='f'; 
interface(showassumed=0); 
pde := (diff(r*(diff(u(r, theta), r)), r))/r +(diff(u(r, theta), theta, theta))/r^2 = 0; 
bc := u(a, theta) = f(theta), 
      u(r, -Pi) = u(r, Pi), 
      (D[2](u))(r, -Pi) = (D[2](u))(r, Pi); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc], u(r, theta), HINT = boundedseries(r=0))),output='realtime'));
 

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

____________________________________________________________________________________

13.17 Dirichlet problem for the Laplace equation in upper half plan

problem number 110

Taken from Mathematica DSolve help pages

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

\begin {align*} u_{xx}+ y_{yy} =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

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = u[x, 0] == UnitBox[x]; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]];
 

\[ \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

 
x:='x'; y:='y'; u:='u'; 
pde:=diff(u(x,y),x$2)+ diff(u(x,y),y$2)=0; 
bc := u(x,0) =piecewise( x< -1/2 or x>1/2,0, 1); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime')); 
sol:=convert(sol,Int);
 

\[ 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 ) \]

____________________________________________________________________________________

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

problem number 111

Taken from Mathematica DSolve help pages

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

\begin {align*} u_{xx}+ y_{yy} =0 \end {align*}

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

Mathematica

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = u[0, y] == Sinc[y]; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]];
 

\[ \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

 
x:='x'; y:='y'; u:='u'; 
pde:=diff(u(x,y),x$2)+ diff(u(x,y),y$2)=0; 
bc := u(0,y) =sin(y)/y; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime'));
 

\[ 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}} \]

____________________________________________________________________________________

13.19 Dirichlet problem for the Laplace equation in the first quadrant

problem number 112

Taken from Mathematica DSolve help pages

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

\begin {align*} u_{xx}+ y_{yy} =0 \end {align*}

Boundary conditions

\begin {align*} u(x,0) &= - \frac {1}{(x-2)^2+3}\\ u(0,y) &= \frac {1}{(y-3)^2+1}\\ \end {align*}

Mathematica

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[x, 0] == -((x - 2)^2 + 3)^(-1), u[0, y] == 1/((y - 3)^2 + 1)}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]];
 

\[ \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

 
x:='x'; y:='y'; u:='u'; 
pde:=diff(u(x,y),x$2)+ diff(u(x,y),y$2)=0; 
bc:=u(x, 0) = (-1/((x - 2)^2 + 3)), u(0, y) = 1/((y - 3)^2 + 1); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime'));
 

\[ \text { sol=() } \]

____________________________________________________________________________________

13.20 Neumann problem for the Laplace equation in the upper half-plane

problem number 113

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

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = Derivative[0, 1][u][x, 0] == UnitBox[x]; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]];
 

\[ \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

 
x:='x'; y:='y'; u:='u'; 
pde:=diff(u(x,y),x$2)+ diff(u(x,y),y$2)=0; 
bc:=(D[2](u))(x, 0) = piecewise( x< -1/2 or x>1/2,0, 1); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime')); 
sol:=convert(sol,Int);
 

\[ 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).

____________________________________________________________________________________

13.21 Dirichlet problem for the Laplace equation in a rectangle

problem number 114

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

ClearAll[u, x, y]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[x, 0] == x^2*(1 - x), u[x, 2] == 0, u[0, y] == 0, u[1, y] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]]; 
 sol = sol /. K[1] -> n
 

\[ \left \{\left \{u(x,y)\to \sum _{n=1}^{\infty }-\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

 
x:='x'; y:='y'; u:='u'; 
pde:=diff(u(x,y),x$2)+ diff(u(x,y),y$2)=0; 
bc:=u(x, 0) = x^2*(1 - x),u(x, 2) = 0, u(0, y) = 0, u(1, y) = 0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime'));
 

\[ 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 ) }}-{{\rm e}^{-\pi \,n \left ( y-4 \right ) }}+2\,{{\rm e}^{n\pi \,y}} \left ( -1 \right ) ^{n}+{{\rm e}^{n\pi \,y}} \right ) }{{n}^{3}{\pi }^{3} \left ( {{\rm e}^{4\,\pi \,n}}-1 \right ) }} \]

____________________________________________________________________________________

13.22 Cartessian coordinates with boundary conditions on two sides only

problem number 115

Added December 20, 2018.

Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-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

ClearAll[u, x, y, h, b]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[x, 0] == 0, u[x, b] == h[x]}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
x:='x'; y:='y'; u:='u';h:='h'; 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2)=0; 
bc:=u(x,0)=0,u(x,b)=h(x); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc],u(x,y))),output='realtime')); 
sol:=convert(sol,Int);
 

\[ 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} \]

____________________________________________________________________________________

13.23 in Rectangle, right edge at infinity

problem number 116

Added December 20, 2018.

Example 23, Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-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

ClearAll[u, x, y, a]; 
 pde = Laplacian[u[x, y], {x, y}] == 0; 
 bc = {u[x, 0] == 0, u[x, a] == 0, u[0, y] == Sin[y], u[Infinity, y] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> a > 0], 60*10]];
 

\[ \text {Failed} \]

Maple

 
x:='x'; y:='y'; u:='u';a:='a'; 
pde := diff(u(x, y), x$2)+diff(u(x, y), y$2) = 0; 
bc_left_edge:=u(0, y) = sin(y); 
bc_lower_edge:=u(x, 0) = 0; 
bc_top_edge:=u(x,a)=0; 
bc_right_edge:=u(infinity,y)=0; 
bc:=bc_left_edge,bc_lower_edge,bc_top_edge,bc_right_edge; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc ], u(x, y)) assuming a>0),output='realtime'));
 

\[ \text {Bad latex generated} \]

____________________________________________________________________________________

13.24 Laplace PDE inside quarter disk, Neumann BC at edge

problem number 117

Added December 20, 2018.

Example 20, Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-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

ClearAll[u, theta, r, f]; 
 pde = D[u[r, theta], {r, 2}] + (1*D[u[r, theta], r])/r + (1*D[u[r, theta], {theta, 2}])/r^2 == 0; 
 bcOnR = {Derivative[1, 0][u][1, theta] == f[theta]}; 
 bcOnTheta = {u[r, 0] == 0, u[r, Pi/2] == 0}; 
 sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bcOnR, bcOnTheta}, u[r, theta], {r, theta}, Assumptions -> {r > 0, r < 1, theta > 0, theta < Pi/2}], 60*10]];
 

\[ \text {Failed} \]

Maple

 
r:='r'; theta:='theta';  r:='r';f:='f'; 
pde := diff(u(r, theta), r$2)+1/r* diff(u(r, theta), r)+1/r^2* diff(u(r, theta), theta$2)= 0; 
bc_on_theta:=u(r, 0) = 0, u(r,Pi/2) = 0; 
bc_on_r:= eval( diff(u(r,theta),r),r=1)=f(theta); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc_on_theta,bc_on_r], u(r, theta), HINT = boundedseries(r = [0])) assuming theta>0, theta < (1/2)*Pi, r>0, r < 1),output='realtime'));
 

\[ 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 ) \]