Ampere's law states that, the closed integral of B over the loop enclosed it equals uI, where u = permeability of the material and I = current "passing" through the loop. I feel confused, because, should the current be extended to infinity? I mean, when we have an infinite wire of current I, everything works very good; on the other hand, when we have a finite wire, this law FAILs(hm...I think it fails, am I right? please correct my viewpoint) The above example seems to imply that the current should be extended to infinity. However, I have another example which shows that the current no need to be extended to infinity! Let' look at a solenoid, we can calculate the magnetic field B along the central of the solenoid by using Ampere's law, yet the wire (current) is not infinitely long! The method we use is: we construct a rectangular loop that one of the sides lies along the central of the solenoid, 1 side outside the solenoid and parallel to the previos one, and the remaining 2 sides connect the previos 2 sides and perpendicular to them. This example shows that, we can use ampere's law here even though the current is not extended to infinity! So, should the current extended to infinity so that we can use Ampere's law? Notice that for each side (for and against) there is always a contradiction which is highlightened in the above 2 examples! Thanks, Twukwuw.