This is a derivation of the magnetic flux density around a solenoid that is long enough so that fringe effects can be ignored. In Figure 1, we immediately know that the flux density vector points in the positive "z" direction inside the solenoid, and in the negative "z" direction outside the solenoid. We confirm this by applying the right hand grip rule for the field around a wire. If we wrap our right hand around a wire with the thumb pointing in the direction of the current, the curl of the fingers shows how the field behaves. Since we are dealing with a long solenoid, all of the components of the magnetic field not pointing upwards cancel out by symmetry. Outside, a similar cancellation occurs, and the field is only pointing downwards.