# How to solve a Poisson's differential equation with a boundary condition at infinity?

Context: This question is relevant to the physical problem of calculating potential for a set of p-n-p junctions. We have to solve a Poisson's differential equation for a p-n-p junction with potential equal zero outside it on the left and right sides. For simplification and due to symmetry law we analyze only right side from 0 to some delta (from which potential is the same as for Infinity) and do not analyze left side. Boundary conditions are that in point on Infinity function and its 1st derivative is equal 0. Derivative in x=0 is equal 0. Alpha is a random very small number for Fermi step. In code bcd are boundary conditions

α = 0.00001;
bcd1 = ϕ' == 0;
bcd2 = ϕ'[Infinity] == 0;
bcd3 = ϕ[Infinity] == 0;
eqn = Div[ Grad  [ϕ[x], x], x] == -((1/(Exp [(x - 1)/α] + 1)) - (1/Exp [((-x - 1)/α)] + 1) + Exp[-ϕ[x]] - Exp [ϕ[x]]);
DSolve[{eqn, bcd1, bcd2, bcd3}, ϕ, {x, 0, Infinity}]


i have tried to use numbers(some delta from which Phi is 0) instead of Infinity or set boundary conditions like

ϕ'[x == 0] == 0
ϕ[x == -Infinity] == 0
ϕ'[x == -Infinity] == 0


and put it directly into eqn but it does not seem to work. And I obtain as a result

DSolve[{Div[Grad[\[Phi][x],x],x] ==  1 + E^(-100000. (-1 - x)) - E^-\[Phi][x] + E^\[Phi][x] - 1/( 1 + E^(100000. (-1 + x))), Derivative[\[Phi]] == 0, Derivative[\[Phi]][\[Infinity]] == 0, \[Phi][\[Infinity]] ==  0}, \[Phi], {x, 0, \[Infinity]}]


If I try to vary boundary conditions or use more complex version of equation I obtain this

DSolve::dsvar: ∞ (-∞..) cannot be used as a variable.


Thank you for your time.

• Is exp supposed to denote the exponentional function? Then it should be Exp[ ... ], not exp(...). – Henrik Schumacher Apr 15 at 22:00
• Moreover, you have three boundary conditions for a an elliptic second order differential equation which should allow for only two. – Henrik Schumacher Apr 15 at 22:06
• Thank you for your answer. 1) I have tried both Exp[ ] and exp ( ) to check correct form, it was a mistype. I corrected it. 2) Can you please explain why it supports only 2 boundary conditions? For example if we take x from -Infinity to Infinity, as it is in original case, we would have 5 boundary conditions. As far as I know, similar problems are solvable with 5 conditions p.s.(I have tried to solve it with only 2 boundary conditions and still got no result thou) – Archdenis Apr 16 at 6:41
• We are solving Boundary value problem, not Cauchy problem so why we can not set more boundary conditions? – Archdenis Apr 16 at 6:47
• Because Poisson problems are well-posed only for at most one boundary condition per boundary component (typically, either Dirichlet, Neumann, or Robin boundary conditions). Also recall how you solve ODEs analytically (this one is actually an ODE): For second order equations, you obtain precisely two integration constants. So you can apply two initial conditions (for a Cauchy problem) or one boundary condition per boundary component of the interval (for boundary value problems). – Henrik Schumacher Apr 16 at 7:02