# Magnetic Field Strength in Plane of and Outside Current Loop

I am trying to find a relationship between the magnitude of the magnetic field at distance $x$ in the plane of a wire loop with radius $R$, $n$ turns and a current of $I$ passing through it. $x$ is in one dimension, outside and normal to the loop.

I'm assuming that the entire coil can be treated as one loop of $nI$, and have been trying to use the Biot-Savart law in the form $$B=\frac{\mu_0nI}{4\pi}\frac{1}{[d(x,\theta)]^2}\sin{\theta} \ dL$$ where $d(x,\theta)$ is the distance from any point on the loop to the point $x$ distance from the loop in terms of $x$ and $\theta$. From examples of this law being applied in other situations, I know that because $L$ changed $\theta$, I need to express $dL$ in terms of $d\theta$ and then evaluate the integral from $\theta=0$ to $\theta=2\pi$.

Geometrically, using the law of cosines, I came to (this may be incorrect) $$d(x,\theta)=\sqrt{2R^2+2xR+2R(x+R)\sin{\theta}+x^2}$$ which brings the entire equation to $$B=\frac{\mu_0nI}{4\pi}\frac{1}{2R^2+2xR+2R(x+R)\sin{\theta}+x^2} \ dL$$ I have not had much luck with $d\theta$. The closest I got was $$L=R\arcsin{\left({-\frac{\cos{\theta}\sqrt{2R^2+2xR+2R(x+R)\sin{\theta}+x^2}}{R+x}}\right)}$$ Differentiating this gives a horribly complicated function which would probably be impossible to integrate.

We tested this experimentally, and got the results

Am I applying the law incorrectly or making a mistake? Is there an easy answer to this, or is it too complicated to quantify? I haven't been able to find anything online about this whatsoever, which is concerning. That, alongside how quickly complicated the maths becomes makes me think there isn't an easy answer to this at all.

Sorry if I didn't explain this very clearly.

I think your sin theta is off because it is based on the cross product of $r \times dl$. It should be the angle between your point at x and the dl, and is not the same as theta.