Using the Biot-Savart Law we derived the equation for the field a distance r from a long straight wire carrying current I. Let's re-do it by applying Ampere's Law.
What does the field look like? The field lines are circular loops centered on the wire.
What shape should we choose for our amperian loop?
In theory Ampere's Law can be applied for any loop, but the one that makes the calculation easy in this case is a circular loop. To find the field a distance r from the wire, use a loop of radius r centered on the wire. The enclosed current is I directed out of the page, producing a counter-clockwise field. Carry out the integral in a counter-clockwise direction so the dot product will be positive.
Because the field is the same magnitude at all points on the loop, and the field is tangent to the loop everywhere:
ò B · ds = B ò ds = mo I
ò ds is the length of the loop, which is 2pr.
This gives B = moI/2pr
This agrees with what we got from the Biot-Savart Law, although there we had to work a lot harder to get the answer.