# Electric potential of uniformly charged wire with Green function

I want to calculate the electric potential of a uniformly charged wire with infinite length $$\rho(\vec{r}') = \lambda \delta(x') \delta(y')$$ with Green function $$G(\vec{r}, \vec{r}') = \frac{1}{4\pi \epsilon_0}\frac{1}{|\vec{r} - \vec{r}'|}$$.

$$\nabla^2 \phi(\vec{r}) = - \frac{\rho(\vec{r})}{\epsilon_0}$$ $$\phi(\vec{r}) = \int_V G(\vec{r}, \vec{r}') \rho(\vec{r}') d\vec{r}'$$

I get $$\phi(\vec{r}) = \frac{\lambda}{4\pi \epsilon_0} \int_{-\infty}^{\infty} \frac{1}{\sqrt{x^2 + y^2 + (z-z')^2}} dz'$$ which yields $$\phi{(\vec{r})} = \frac{\lambda}{4 \pi \epsilon_0} \left[ \ln|(z-z') + \sqrt{x^2 + y^2 + (z-z')^2}| \right]_{-\infty}^{\infty}$$ and not $$\phi(\vec{r}) = \frac{\lambda}{2\pi \epsilon_0} \ln r$$ what I should get if we assume that potential at $$\phi(r=1) = 0$$.

How do I get the known potential whit green function?

Here, you actually need to find the Green's function in 2-d by solving the Laplace's equation and then imposing the necessary boundary conditions at $$x = 0$$ and $$y = 0$$. This should give you the green's function in 2-D and the solution to your problem!