[Physics] I don’t understand Ampere’s circuital law

electricityelectromagnetic-inductionelectromagnetismelectrostaticsmagnetic fields

Since, magnetic field is a vector quantity, two (or more) magnetic fields (when in close proximity) should influence their fields, according to the laws of vector.
And by that logic, Ampere's circuital law shouldn't work. Here's how-

enter image description here

So, according to Ampere's law,
$$∮\mathbf{B}\cdot d\mathbf{l}=\mu_0I_1$$

Since I've considered it to be an infinitely long wire, so
$$B\oint dl=\mu_0I_1$$

$$B=\frac{\mu_0I}{2πr_1}$$

That's the magnitude of the magnetic field at every point on that loop due to all the currents in the system, according to Ampere's law.
Now, that's the problem I've with Ampere's law. Both $I_1$ and $I_2$ produce magnetic field at $P$, but we take only one in consideration That is inside the loop, why's that?
Logically, what we should have at point $p$ must be a vector sum of magnetic fields produced by both the wires. The magnetic fields have to add up (vectorially) like every other vector quantity. In this way, Ampere's law is totally against the superposition principle.

And if all the above mentioned doesn't make my point clear, then consider this.

enter image description here

If we draw an amperian loop around $I_1$ through $P$. Then by Ampere's law
$$\oint\mathbf{B}\cdot d\mathbf{l}=\mu_0I_1$$
$$\Rightarrow B_1=\frac{\mu_0I_1}{2πr_1}=B_P$$

And now draw another amperian loop around $I_2$ through $P$. Then again by Ampere's law,

$$∮\mathbf{B}\cdot d\mathbf{l}=\mu_0I_2$$
$$ \Rightarrow B=\frac{\mu_0I_2}{2\pi r_2}=B_P$$

Now, how in the world is it possible that, at a unique point in space,we have two different values of magnetic field? It doesn't add up.

And I suppose so goes with, Gauss's law. Consider below,

enter image description here

Consider a gaussian surface around $q_1$ through $P$. According to Gauss's law,
$$\oint\mathbf{E}\cdot d\mathbf{A}=\frac{q_1}{\epsilon_0}$$
$$\Rightarrow E_1=\frac{q_1}{4\pi\epsilon_0r_1^2}$$

Now consider respectively the same for $q_2$
$$E=\frac{q_2}{4\pi\epsilon_0r_2^2}$$

Again same argument,$E_1$ and $E_2$ are not equal, which actually should be.

Best Answer

You are right, $\mathbf{B}$ is a vectorial quantity. Furthermore, it depends on position $\mathbf{r}$. Therefore we need to write $\mathbf{B}(\mathbf{r})$.

The magnetic field around two current-carrying wires (with the currents flowing in the same direction) looks like this:

enter image description here
(image from schoolphysics - electromagnetism - forces between currents)

Notice especially, how the magnetic field in the region between the two wires is very small, because the magnetic contributions from the left and the right wire nearly cancel each other there.

Now consider a loop around the right wire only.

enter image description here

Then the path integral along this loop $$\oint_\text{right loop} \mathbf{B}(\mathbf{r})\cdot d\mathbf{l}$$ is not easy to calculate because $\mathbf{B}(\mathbf{r})$ varies when we go along the loop. $\mathbf{B}(\mathbf{r})$ is not always parallel to $d\mathbf{l}$ of the loop. And even more importantly, it varies in magnitude along the loop. It is small in the left part of the loop (i.e. between the wires), and it is large in the right part of the loop.

That is why we cannot simply pull the $\mathbf{B}$ out of the integral and write $$B\oint_\text{right loop} dl.$$

But nevertheless the equation $$\oint_\text{right loop} \mathbf{B}(\mathbf{r})\cdot d\mathbf{r}=\mu_0 I_\text{right}$$ is still true. The total path integral depends only on the current enclosed by the loop.

You can understand this by decomposing the magnetic field $\mathbf{B}(\mathbf{r})$ into two parts, one part created by the left wire, the other part created by the right wire. $$\mathbf{B}(\mathbf{r})=\mathbf{B}_\text{left}(\mathbf{r})+\mathbf{B}_\text{right}(\mathbf{r})$$

Then you can write the path integral as $$\begin{align} &\oint_\text{right loop} \mathbf{B}(\mathbf{r})\cdot d\mathbf{l} \\ =& \oint_\text{right loop} (\mathbf{B}_\text{left}(\mathbf{r})+\mathbf{B}_\text{right}(\mathbf{r}))\cdot d\mathbf{l} \\ =& \oint_\text{right loop} \mathbf{B}_\text{left}(\mathbf{r})\cdot d\mathbf{l} + \oint_\text{right_loop} \mathbf{B}_\text{right}(\mathbf{r})\cdot d\mathbf{l} \\ =& \mu_0 0 + \mu_0 I_\text{right} \end{align}$$