EDIT: I don't see this as a coursework question, even though I use a textbook example to set up my question. I feel that this is purely a conceptual question. If the staff disagrees, however, I am fine with this being moved to the homework forum. I have been very perplexed these past few hours, trying to figure out why Ampere's law (at least, as I applied it) does not seem to yield the correct magnetic field at some distance from a wire of finite length. Below is a picture showing the correct solution for one particular case using the Bio-Savart Law, and then a failed attempt using Ampere's law. The field found by Ampere's law would be correct if the wire were infinitely long, but I can't bring myself to believe that the law can only be applied to straight wires of infinite length. It makes sense to me conceptually that the field around the wire should vary with distance from the endpoints, but no such limitations were mentioned when I was introduced to Ampere's law. I am therefore unsure of when it is valid and when it isn't. It clearly isn't valid here - why isn't it valid, and how do I know when it is or isn't valid?