The magnetic field intensity on the shaft should be calculated by Biot-Savart law.
Assuming that the radius of the coil is r and the point is far away from the center D, it can be judged that the magnetic field intensity of the change point is along the axis according to the symmetry, so the field intensity of each line element of the coil at the change point is considered, and only the axial component is considered.
dB=uI*dl/4πS^2*R/S
R/S here is the component of field strength on the axis.
Here s = sqrt (d 2+r 2)
Then the integral of dl is 2πR, which is brought in.
B(d)=uIR^2/[2(R^2+d^2)^(3/2)]