# 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] == 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[1][\[Phi]][0] == 0, Derivative[1][\[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.


• Is exp supposed to denote the exponentional function? Then it should be Exp[ ... ], not exp(...). – Henrik Schumacher Apr 15 at 22:00