Suppose we have some wire of length $2b$ with a current $I$ flowing through it and we want to evaluate the field at some distance $a$ radially outwards from the centre of the wire (so a distance b parallel to the wire from either end).
If we try to approach this using Ampere's law (yes I know you can't do that but we'll get to that), we obtain:
$\int \vec B \cdot \vec dl = \mu_0 I$ (the integral should be closed but I don't think MathJax has that).
For simplicity, we can choose a circular Amperian loop such that $\vec B$ is always parallel to the path. From here, the system appears symmetrical in both the directions parallel and perpendicular to the wire. So surely, by symmetry, $\lVert B\rVert$ will be the same everywhere along the loop and will always act in the same direction relative to the path? If it were different, that would imply some asymmetry rotationally along the axis of the wire which we clearly don't have for the simple case of a straight wire. So $\vec B \cdot \vec dl$ should simplify to just $\lVert B\rVert \lVert dl\rVert$, where $\lVert B\rVert$ should not depend on the point along the Amperian loop.
Well I must have made a mistake somewhere in the above logic because this would imply that I can factor out $\lVert B\rVert$ from the integral and just get:
$\lVert B\rVert \int dl = \mu_0 I$
$\lVert B\rVert 2 \pi a = \mu_0 I$
$\lVert B\rVert = \frac{\mu_0 I}{2 \pi a}$
And I know this can't be true because if we solve the problem using Biot-Savart, we instead obtain:
$\lVert B\rVert = \frac{\mu_0 I}{2 \pi a} \frac{1}{\frac{a^2}{b^2}+1}$
Could someone please point out where I've gone wrong?
Thanks,
David
EDIT: Is it something to do with Ampere's law implicitly assuming that the wire is infinitely long to start with? I've googled why this fails and the explanations all invoke symmetry arguments but the system looks pretty symmetrical to me...
EDIT 2: In this post I'm assuming that Ampere's law is still applicable for finite wires. My confusion stems from this post Ampere's circuital law for finite current carrying wire in which the answer implies that the only reason Ampere's law fails is due to a lack of symmetry.