How to get the magnetic field strength in space near a solenoid I am trying to find the magnetic field strength along the axis of a solenoid.
If I know the strength of the field at the center of the solenoid, and I know the distance from the center of the solenoid, would it be possible to calculate how strong the field will be at a given distance along the axis?
If this is possible, how would I go about doing this?
Edit: So I did some more looking around, and I found this: 

Would this work to find the magnetic field strength of a solenoid? (I'm not sure if it's accurate to use an equation for a current loop, for a solenoid calculation.)
 A: The field along the axis of a finite solenoid can be found by integrating the formula you found (for a current loop) from $z_1$ to $z_2$.  The current in a "slice" of width $dz$ is just $n I \, dz$, so we have
$$
d B_z = \frac{\mu_0 n I}{2} \frac{R^2}{(z^2 + R^2)^{3/2}} dz \Rightarrow B_z = \frac{\mu_0 n I R^2}{2} \int_{z_1}^{z_2} \frac{dz}{(z^2 + R^2)^{3/2}}
$$
I'll leave the exact form of this integral as an exercise for the reader, but I can't not include the following:  it turns out that the result of this integral can be expressed in a pretty slick geometric way.  Draw a line from the field point to the edge of the solenoid at $z = z_1$, and call the angle between this line and the axis $\theta_1$.  Define $\theta_2$ similarly.  (Note that these angles will be greater than $\pi/2$ if $z_1 < 0$ or $z_2 < 0$, respectively.)  Then the magnetic field along the axis will be proportional to $(\cos \theta_1 - \cos \theta_2)$.
If you're not along the axis, then abandon all hope.  I'm not sure that a closed-form solution even exists;  you might be able to write something down in terms of elliptic functions (or integrals thereof), but it's going to be pretty nasty.  My gut instinct is that you should either use approximation techniques if you're a little bit off-axis (i.e., a power series expansion of the components of $\vec{B}$ coupled with the fact that $\vec{B}$ is curl-free and divergence-free in the solenoid), or numerical techniques if you're significantly off-axis.
A: Absolutely. The answer you're looking for is somewhat surprising.
Suppose the axis of the solenoid coincides with the $z$-axis of our coordinate system. We'll make the approximation that the solenoid is infinitely long (in experiment the solenoid is probably not infinitely long - but this assumption makes this calculation easier, and is a pretty good approximation for the actual magnetic field).
Suppose the solenoid is tightly wound, with $n$ turns per unit length. We assume the solenoid is so tightly wound that the current $I$ running through the wire behaves essentially like it's going round in a circle, parallel to the $xy$-plane in each winding.
Furthermore, say the solenoid has a radius $R$.
If you define $s=\sqrt{x^{2}+y^{2}}$ as the distance from the $z$-axis, the magnetic field is given by:
$\mathbf{B} = \mu_{0} n I \mathbf{\hat{z}}\ \ $     for $s<R$
$\mathbf{B} = {0}\ \ $     for $s>R$
.....where $\mu_{0}$ is a constant, the permeability of free space.
It's strange, but the magnetic field is constant (and it points along the positive $z$-axis) inside the solenoid. On the outside of the solenoid, the magnetic field is exactly zero everywhere.
