I understand the usual argument for calculating the vector potential outside of a solenoid of radius $R$ with $n$ turns per unit length carrying current $I_0$ using $$ \oint \mathbf{A} \cdot d \mathbf{l} = \iint \nabla \times \mathbf{A} \cdot d\mathbf{a} = \iint \mathbf{B} \cdot d\mathbf{a} $$ which gives (in Gaussian units) $$ A_{\varphi} = \frac{2\pi}{c} \frac{nI_0 R^2}{r} $$ However, I am asked explicitly to find the vector potential in the Coulomb gauge. I have two main questions:
1) Is showing that this vector potential satisfies $\nabla \cdot \mathbf{A} = 0$ and $\mathbf{B} = \nabla \times \mathbf{A}$ sufficient? That seems a bit too much like a 'physicist proof' to me.
2) How can I compute the vector potential explicitly from the form $$ \mathbf{A} = \frac{1}{c} \int \frac{\mathbf{J}(\mathbf{r}',t)}{|\mathbf{r}-\mathbf{r}'|} d^3 r $$ I have written $$ \mathbf{J}(\mathbf{r}',t) = n I_0 \frac{\delta(r'-R)}{R} \ \hat{\varphi} $$ which gives after some algebra and one integration $$ \mathbf{A} = \frac{n I_0}{c} \int_0^{2\pi} \int_{-\infty}^{\infty} \frac{1}{\sqrt{r^2+R^2 - 2rR \cos(\varphi-\varphi') + (z-z')^2 }}dz' d\varphi' \ \hat{\varphi} $$ But doesn't the integral over $z$ diverge? This integral isn't doable by Mathematica. Have I done something wrong?
EDIT:
I suppose I can simplify this integral by (without loss of generality) letting $\phi = 0$ and $z=0$. The integral becomes \begin{align*} \mathbf{A} &= \frac{n I_0}{c} \int_0^{2\pi} \int_{-\infty}^{\infty} \frac{1}{\sqrt{r^2+R^2 - 2rR \cos(\varphi') + (z')^2 }}dz' d\varphi' \ \hat{\varphi} \\ &= \frac{n I_0}{c} \int_{-\infty}^{\infty} \frac{2 K\left(-\frac{4 r R}{(r-R)^2+(z')^2}\right)}{\sqrt{(r-R)^2+(z')^2}}+\frac{2 K\left(\frac{4 r R}{(r+R)^2+(z')^2}\right)}{\sqrt{(r+R)^2+(z')^2}} dz' \end{align*} But this still seems to diverge. How can I show that this reduces to $\frac{2\pi}{c} \frac{nI_0 R^2}{r} $?