= Solution
Use the <Green-function representation> to integrate over the charged segment:
$$
\varphi(x,y)=-\frac1{4\pi\epsilon_0}\int_0^L\log((x-s)^2+y^2)\,ds+C_0.
$$
For $y\ne0$, a primitive with respect to $u$ is
$$
F(u,y)=u\log(u^2+y^2)-2u+2y\arctan(u/y),
$$
as direct <differentiation> verifies using the <derivative> of <inverse tangent>. Therefore
$$
\boxed{\varphi(x,y)=-\frac{F(x,y)-F(x-L,y)}{4\pi\epsilon_0}+C_0.}
$$
This expression is even in $y$, since $y\arctan(u/y)$ is even. On $y=0$, take the continuous limit $F(u,0)=u\log u^2-2u$, with $u\log u^2=0$ at $u=0$. The finite segment has a logarithmically growing potential at large distance, but its <electric field> decays; the boundary condition constrains the field rather than the potential.
Back to article page