I need help how to set up this integral $$V(\mathbf r)=\frac{1}{4\pi\epsilon_0} \int_L \frac{\rho'_l}{\lvert \mathbf r - \mathbf{r'} \rvert}\mathrm{d}l'. $$
I have a uniform line charge along the $z$-axis and want to calculate the electric potential between two points $A=(r_A,\phi_A,0)$ and $B=(r_B,\phi_B,0)$ (cylindrical coordinates).
Solution: The line charge is aligned along the $z$-axis and the the source vector is $\mathbf{r}=z\hat{\mathbf z}$ and the field vector is $\mathbf{r'}=r'\hat{\mathbf r}+z'\hat{\mathbf z}$ so $$\lvert \mathbf{r}-\mathbf{r'} \rvert=\sqrt{(r')^2+(z-z')^2}.$$ I integrate along $z'$ from $-\infty$ to $\infty$ \begin{align} V(\mathbf r) &=\frac{1}{4\pi\epsilon_0} \int_L \frac{\rho'_l}{\lvert \mathbf r - \mathbf{r'} \rvert}\mathrm{d}l' \\ &=\frac{\rho_l}{4\pi\epsilon_0} \int_{-\infty}^{\infty}\frac{1}{\sqrt{(r')^2+(z-z')^2}}\mathrm{d}z'\\ &=\frac{1}{4\pi\epsilon_0} \big [ \ln(z-z'+\sqrt{(r')^2+(z-z')^2})\big ]^{\infty}_{-\infty}\\ &= -\infty +\infty \end{align} The integral is indeterminate and I'm stuck here. Are the vectors wrong, the limits? What have I missed?
Thanks!
If I calculate the line integral of the electric field I find the correct potential (however, I want to calculate with the integral above).
I integrate in the radial direction $\mathrm{d}\mathbf{r}$ from $r_A$ to $r_B$. The electric field is $\mathbf{E}(\mathbf{r})=\frac{\rho_l}{2\pi\epsilon_0 r}\hat{\mathbf{r}}$ so \begin{align}V(\mathbf{r})&=-\int_L \mathbf{E}(\mathbf r) \cdot \mathrm{d}\mathbf{l}\\&=\frac{\rho_l}{2\pi\epsilon_0}\int_{r_A}^{r_B}\frac{1}{r}\mathrm{d}r=\frac{\rho_l}{2\pi\epsilon_0}\ln{\frac{\rho_B}{\rho_A}}\end{align}