Magnetic Field Due to a Cylindrical Wire
Magnetic field due to a cylindrical wire is obtained by the application of Ampere’s law.
1) Outside the Cylinder:

In all above cases magnetic field outside the wire at P, ∫B̄.dl̄̄ = µ₀I ⇒ B ∫dl = µ₀i.
B x 2πr = µ₀i ⇒ Bout = µ₀i/ 2πr
In all the above cases, Bsurface = µ₀i/ 2πR
2) Inside the hollow cylinder: Magnetic field inside the hollow cylinder is zero.

3) Inside the solid cylinder: Current enclosed by loop (I) is lesser than the total current.

Current density is uniform, i.e. J = J ⇒ i’ = i x (A’ x A) = i (r²/R²), hence at inside point ∫B̄in.dl̄ = µ₀’ ⇒ B = µ₀ir/ 2πR².
4) Inside the thick portion of hollow cylinder: Current enclosed by loop is given by as, i’ = i x (A’/ A) = i x [(r² – R₁²)/ (R₂² – R₁²)]
