# Solving Poisson equation with Robin boundary condition with DSolve

I have the following BVP: $$-\Delta u = f \;\;\;\text{in}\;\Omega=(0,1)^{2}$$

$$u+\varepsilon\nabla u\cdot n = 0, \;\;\;\text{on}\;\partial\Omega$$

where $$f(x,y) = 2x(1-x) + 2y(1-y)$$ and $$\varepsilon>0$$. I would like to use DSolve to obtain a solution but I'm not sure how to implement the BC, as all examples I've found so far only deal with pure Dirichlet or Neumann conditions. The Mathematica documentation states that NeumannCondition handles both Neumann and Robin BCs but I didn't see any examples that do it.

• The first example in the Scope section of NeumannValue is a Robin bc (a generalized NeumannValue). Also note that your notion of the Robin bc is not quite correct: You needs the epsilon also in the equation or remove the epsilon from the Robin condition. See FEMDocumentation/tutorial/FiniteElementBestPractice#1529668360 that has an example of a DSolve and how it relates to NDSolve with Robin bcs. Commented Feb 3, 2020 at 7:04

Mathematica DSolve (V 12) can not solve this. You did not show your attempt. Here is what I tried.

ClearAll[x, y];
eps = 1;
L = 1; (*length of x side*)
H = 1; (*Length of y side*)
f = 2 x (1 - x) + 2 y (1 - y);
pde = -Laplacian[u[x, y], {x, y}] == f;
bc = {u[x, 0] + eps* Derivative[0, 1][u][x, 0] == 0,
u[x, H] + eps* Derivative[0, 1][u][x, H] == 0,
u[0, y] + eps* Derivative[1, 0][u][0, y] == 0,
u[L, y] + eps* Derivative[1, 0][u][L, y] == 0
};
DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> {0 <= x <= L && 0 <= y <= H}]


But Maple 2019.2.1 can solve it

restart;
eps:=1;
L:=1;H:=1;
f:=2*x*(1 - x) + 2*y*(1 - y);
pde := diff(u(x,y),x$$2)+diff(u(x,y),y$$2)=-f;
bc:=u(x,0)+eps*D[2](u)(x,0)=0,
u(x,H)+eps*D[2](u)(x,H)=0,
u(0,y)+eps*D[1](u)(0,y)=0,
u(L,y)+eps*D[1](u)(L,y)=0;
pdsolve([pde,bc],u(x,y)) assuming 0<=x , x<=L , 0<=y , y<=H


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

• I want to know why MMA's ability of solving partial differentiation is not as good as maple's and when it can reach Maple's computing power... Commented Feb 2, 2020 at 3:00
• @PleaseCorrectGrammarMistakes you had better chose method by hand , run ?DSolve*` to see some undocumented functions. Commented Feb 2, 2020 at 3:18