# Ampère's law with ellipse

Background information first: Using Ampère's law we can find the magnetic field due to a current, I. We do this with a line integral around a closed path encompassing the current (e.g. long straight wire).

$$\oint_c \vec B \cdot \vec dl$$ = $$\mu_0 I_{enc}$$

If we choose a circle centered on the wire (like the images below) we greatly simplify things because the magnetic field (right-hand-rule) is perpendicular to the current flow. With the selected path (circle) the B field is colinear with the circle so the dot product between $$\vec B$$ and $$\vec dl$$ reduces to |B||dl| since cosine $$0^\circ$$ is 1. Right-hand figure of image below is looking down from above with wire in center of circle.

This choice of using a circle for the closed path around the current conveniently reduces the problem to that of finding the circumference of the circle, resulting in the following equation for the magnetic field.

$$B = \frac{\mu_0 I_{enc}}{2\pi r}$$

So, i wanted to see if i could derive an equation for B using an ellipse instead.

In this case, since the magnetic field is perpendicular to the flow of current the incremental length $$\vec dl$$ and $$\vec B$$ will only be colinear at 4 points (on the axes). EDIT - i redrew the right-hand image above to clarify the relationship between the direction of $$\vec B$$ and the direction of $$\vec dl$$ at a point on the ellipse. The dashed-red circle is just used to find the direction of $$\vec B$$ which is tangential to the circle.

However, we know the slope of the ellipse at each (x,y) is $$\frac{-xb^2}{ya^2}$$. We know that the slope of $$\vec B$$ at (x,y) is the slope of a circle that has the same origin as the ellipse and passes through (x,y). So, the slope of $$\vec B$$ is $$\frac{-x}{y}$$...and now we know the slope of both the ellipse and the $$\vec B$$ at (x,y).

For the dot product we need $$\cos(θ)$$. We know that $$\tan(\theta) = \dfrac{m_2-m_1}{1+m_1m_2}$$ so knowing the 2 slopes we have $$\tan(\theta)$$. Knowing that $$\cos^2 = \frac{1}{1+\tan^2}$$ we end up with the following:

$$\cos^2(\theta) = \frac{1}{1+|\frac{-xya^2+xyb^2}{a^2y^2+x^2b^2}|^2}$$

Knowing the circumference of the ellipse, P, I believe that Ampère's integral is now as follows.

$$BP\oint_c \cos(\theta)$$ = $$\mu_0 I_{enc}$$

which reduces to,

$$B = \frac{\mu_0 I_{enc}}{P\oint_c \cos(\theta)}$$

Does this appear correct to this point? How can i work this into a form that is comparable to the circle case, $$B = \frac{\mu_0 I_{enc}}{2\pi r}$$, but for an ellipse? The idea is to be able to calculate the B at any (x,y) around the wire. Since $$r = \sqrt{x^2+y^2}$$ this is easy with the formula derived from the circle. We also know that at any point (x,y) on the ellipse i should get the same value of B as from $$B = \frac{\mu_0 I_{enc}}{2\pi \sqrt{x^2+y^2}}$$.

We know that $$B = \frac{\mu_0 I_{enc}}{2\pi r}$$ which is same as $$B = \frac{\mu_0 I_{enc}}{2\pi \sqrt{x^2+y^2}}$$.

So, $$\oint_c \vec B \cdot \vec dl = \oint_c |\frac{\mu_0 I_{enc}}{2\pi \sqrt{x^2+y^2}}||dl|\cos(\theta)$$, where $$\theta$$ is the angle between $$\vec B$$ and $$\vec dl$$ at each (x,y).

Knowing that $$\oint_c dl = P$$ (perimeter of ellipse) we can simplify the r.h.s,

$$= P\frac{\mu_0 I_{enc}}{2\pi} \oint_c |\frac{1}{\sqrt{x^2+y^2}}|\cos(\theta)$$

Which, since $$\oint_c \vec B \cdot \vec dl$$ = $$\mu_0 I_{enc}$$, we can now write

$$\oint_c |\frac{1}{\sqrt{x^2+y^2}}|\cos(\theta) = \frac{2\pi}{P}$$

Knowing formula for $$\cos^2(\theta)$$ this becomes,

$$\oint_c |\frac{1}{\sqrt{x^2+y^2}}| \sqrt{\frac{1}{1+|\frac{-xya^2+xyb^2}{a^2y^2+x^2b^2}|^2}} = \frac{2\pi}{P}$$

• We use circle as an integration contour to find the function $B (r)$. What is the aim of using an elliptic contour?
– user
Commented Jun 24, 2020 at 19:39
• To see if it can be done...and learn from the experience. Commented Jun 24, 2020 at 19:40
• Knowing the vector $B (r)$ you certainly are able to compute the integral. But this will not help you to find $B (r)$ from scratch, which seems to be your intention.
– user
Commented Jun 24, 2020 at 19:48
• Agree, and hence my question. I'm no mathematician. Commented Jun 24, 2020 at 19:52

Fact (2) was true in the circular case because of the symmetry of the set-up. The magnitude of the magnetic field depends only of the distance from the current that causes the field, so it's constant along your circle. But it's not constant along your ellipse. So you can't just factor $$B$$ out of the integral as if it were constant.
• Thank you. In the circle approach we don't know that B is constant until we finish the analysis. The point of my ellipse approach is to find a similar formulation for B at any (x,y) on the ellipse. If we are able to do a solution with the ellipse i expect it will look like $B = \frac{\mu_0 I_{enc}}{2\pi \sqrt{x^2+y^2}}$ and B will vary with distance from origin. Can you recommend a formulation to help me solve? Commented Jun 25, 2020 at 2:51
• If you don't know a priori that $|B|$ is constant along the circle, how did it get pulled out of the integral that you got from Ampère's law? Commented Jun 25, 2020 at 2:56
• @relayman357 It is not clear what you mean by "solvable". Of course you can compute the integral provided that you know the field $B(r)$. To compute $B(r)$ itself you should however resort to solving the Maxwell equations. Only in rare cases the symmetry of the problem allows one to find the field using the integral along a clever chosen path (or - in the case of electric field - surface).