I am doing my homework and I'm really stuck on this problem. It asks for the magnetic field due to a square, lying in the $xy$-plane, of side lenght $a$ and with a electric current $I$ running throught it and I am not supposed to calculate it just in the center of the square. My professor have shown that the vector potential of a finite wire of lenght $a$, lying in the $z$-axis, is given by (in cilyndrical coordinates) $$\vec{A}=\frac{\mu_0I}{4\pi}\left[\frac{z+a/2+\sqrt{\rho^2+(z+a/2)^2}}{z-a/2+\sqrt{\rho^2+(z-a/2)^2}}\right]\,\hat{z}$$$$\vec{A}=\frac{\mu_0I}{4\pi}\ln\left[\frac{z+a/2+\sqrt{\rho^2+(z+a/2)^2}}{z-a/2+\sqrt{\rho^2+(z-a/2)^2}}\right]\,\hat{z}$$ So, I was trying to use this to say that the vector potential due to the wires placed in $y=\pm a/2$ is given by $$\vec{A}=\frac{\mu_0I}{4\pi}\left[\frac{x+a/2+\sqrt{z^2+(y-a/2)^2+(x+a/2)^2}}{x-a/2+\sqrt{z^2+(y-a/2)^2+(x-a/2)^2}}\right]\,\hat{x}+\frac{\mu_0I}{4\pi}\left[\frac{x+a/2+\sqrt{z^2+(y+a/2)^2+(x+a/2)^2}}{x-a/2+\sqrt{z^2+(y+a/2)^2+(x-a/2)^2}}\right]\,\hat{x}$$$$\vec{A}=\frac{\mu_0I}{4\pi}\ln\left[\frac{x+a/2+\sqrt{z^2+(y-a/2)^2+(x+a/2)^2}}{x-a/2+\sqrt{z^2+(y-a/2)^2+(x-a/2)^2}}\right]\,\hat{x}+\frac{\mu_0I}{4\pi}\ln\left[\frac{x+a/2+\sqrt{z^2+(y+a/2)^2+(x+a/2)^2}}{x-a/2+\sqrt{z^2+(y+a/2)^2+(x-a/2)^2}}\right]\,\hat{x}$$ where I shifted $z$ with $x$ because the wires are parallel to the $x$-axis and $\rho^2=z^2+(y-a)^2$, when $y>0$ and $\rho^2=z^2+(y+a)^2$, when $y<0$ . There is, of course, a similar expression for the ones placed in $x=\pm a/2$. Then, I summed up all of the components and calculated its curl to get the magnetic field, but it does not feel right since the magnetic field at the origin is zero according to my results, and I think it should not be. I just want to ask what do you think I'm doing wrong, because I have no clue what to do. Any help will be appreciated.
Post Closed as "Not suitable for this site" by Voulkos, Vincent Thacker, John Rennie, jng224, Jon Custer