I have tried calculating the potential of a charged wire the direct way. If lambda is the charge density of the wire, then I get
$$\phi(r) = \frac{\lambda}{4 \pi \epsilon_0 r} \int_{-\infty}^\infty \frac{1}{(1+z^2/r^2)^{1/2}} dz.$$ But this comes to $+\infty$ unless I am doing the calculation wrong. Why doesn't this work the direct way?
Also, is it possible to calculate the potential of a charged wire using Gauss' differential law? What about in the case of an infinite charged sheet? Or does Gauss' differential law only apply to charged volumes?