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, bcd}, ϕ, {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[ϕ[x],x],x] == 1/(exp (1 + 100000. (-1 - x))) - 1/(1 + 100000. exp (-1 + x)) + 2 exp ϕ[x], Derivative[1][ϕ][0] == 0, Derivative[1][ϕ][∞] == 0, ϕ[∞] == 0}, ϕ, {x, 0, ∞}] `

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.