# Why do we consider a circle as a closed loop while deriving the magnetic field of a infinitely long wire [closed]

Why do we consider a circle as a closed loop while deriving the magnetic field of a infinitely long wire. How does it affect if I take another shape.

• Are you asking why we choose a circular (constant radius) path vs an ellipse, or why we choose a closed path? – Bill N Mar 29 '18 at 12:48
• @BillN this is not the main question but I have problem in which you mentioned also – user190600 Mar 29 '18 at 15:03

Because of the symmetry of the problem, we know that the magnitude of the magnetic field is dependent only on the distance from the wire (because the wire looks the same from any angle and after any displacement parallel to the wire). Therefore, the magnitude of the magnetic field should be constant along a circle with the wire at its center. This makes the line integral present in Ampere's Law very simple; for a circle of radius $r$,
$$\oint \vec{B}\cdot d\vec{\ell}=2\pi rB$$