# Ampere's Law Confusion

I had this question recently in a test. Different methods are yielding different answers. Can someone point out the mistake?
We are given 4 infinite wires carrying current out of the plane as shown. Find $$\int_{-\infty}^{+\infty} \vec{B}\cdot\,\mathrm d\vec{x} ,$$ (along x axis)

My logic for line integral along the infinity part being zero is that by using Biot-Savart law, the field produced by the current carrying wires would definitely tend to 0 at infinity.
The answer given is $$\bar u (-3)$$ , which seems like average of both the values. Can someone point out my mistake?

• Sorry for the trouble, its not a vector, i meant u• (meu not) at the end – Red Floyd Feb 9 '17 at 17:01

When you do the loop integral about one set of wires you are ignoring the other set of wires. Going from $-\infty$ to $+\infty$ around your first loop, you "collect" half of the B field due to one set of currents (the other half comes when you go back in the other direction - your assumption that it's zero "because you are far away" is wrong. You know it is, because a complete loop integral "at infinity" must give you the same value as if you were close).
• Take a straight line from - to + infinity, then a semicircle to get back. The integral of the semicircle is exactly half the integral if you went all the way around the circle. So you get a value of $+\frac32 \mu_0$ for the first integral (around the 1 and 2 A wires), and $-\frac92 \mu_0$ for the second. Their sum is $-3\mu_0$. – Floris Feb 9 '17 at 17:14