<texit info> author=Ivan Savov title=Electomagnetisme I backgroundtext=off </texit>
Electrostatics is the study of charge and the electric forces that exist between charges. The same way that the force of gravity exists between any two objects with mass, the electric force (Coulomb force) exists between any two charged objects. We will see, however, that unlike gravity which is always attractive (tends to bring masses closer together), the electrostatic force can sometimes be repulsive (tends to push charges apart).
Electrostatics is a big deal. You are alive right now, because of the electric forces that exist between the amino acid chains (proteins) in your body. The attractive electric force that exists between protons and electrons helps to make atoms stable. The electric force is also an important factor in many chemical reactions.
The study of charged atoms and their chemistry can be kind of complicated. Each atom contains many charged particles: the positively charged protons in the negatively charged electrons. For example, a single iron atom has 26 positively charged particles (protons) in the nucleus and 26 negatively charged electrons in various energy shells surrounding the nucleus. To keep things simple, in this course we will study the electric force and potential energy of only a few charges at a time.
When I was growing up, television sets and computer monitors were bulky objects in which electrons were accelerated and crashed onto a phosphorescent surface to produce the image on the screen. A cathode ray tube (CRT) is a vacuum tube containing an electron gun (a source of electrons). What is the speed of the electrons which produce the image on an old-school TV?
Suppose the Voltage used to drive the electron gun is $4000$[V]. Since voltage is energy per unit charge, this means that each electron that goes through the electron gun will lose the following amount of potential energy \[ U_e = q_e V = 1.602\times10^{-19} \ \times \ 4000 \qquad \text{[J]}. \] In fact the potential energy is not lost but converted to kinetic energy \[ U_e \to K_e = \frac{1}{2}m_e v^2 = \frac{1}{2}(9.109\times10^{-31})v^2, \] where we have used the formula for the kinetic energy of an object with mass $m_e = 9.109\times10^{-31}$ [Kg]. Numerically we get: \[ 1.602\times10^{-19} \ \times \ 4000 = \frac{1}{2}(9.109\times10^{-31})v^2 \qquad \text{[J]}, \] where $v$, the velocity of the electrons, is the only unknown in the equation. Solving for $v$ we find that the elections inside the TV are flying at \[ v = \sqrt{\frac{2 q_e V}{m_e}} = \sqrt{\frac{2 \times 1.602\times10^{-19} \times 4000 }{9.109\times10^{-31}}} = 3.751\times 10^{7} \text{[m/s]}. \] This is pretty fast.
One of the fundamental properties of matter is charge, which is measured in Coulombs [C]. An electron has the charge $q_e=-1.602\times10^{-19}$ [C]. The electric charge of the nucleus of a Helium atom is $q_{He}=2\times1.602\times10^{-19}$, because it contains two protons and each proton has a charge of $1.602\times10^{-19}$ [C].
Unlike mass, of which there is only one kind, there are two kinds of charge: positive and negative. Using the sign (positive vs. negative) to denote the “type” of charge is nothing more than a convenient mathematical trick. We could have instead called the two types of charges “hot” and “cold”. The important thing is that there are two kinds with “opposite” properties in some sense. In what sense opposite? In the sense of their behaviour in physical experiments. If the two charges are of the same kind, then they try to push each other away, but if the two charges are of different kinds then they will attract each other.
Two point charges $Q$ and $q$ placed at a distance $r$ meters apart will interact via the electric force. The magnitude of the electric force is given by the following formula \[ |\vec{F}_e({r})| = \frac{k_eQq}{r^2} \qquad \text{[N]}, \] which is known as Coulomb's law.
If the charges are different (one positive and one negative) then the force will be attractive – it will tend to draw the two charges together. If the two charges are of the same sign then the force will be repulsive.
Every time you have a force, you can calculate the potential energy associated with that force, which represents the total effect (the integral) of the force over some distance. We now define the electric potential energy $U_e$, i.e., how much potential energy is stored in the configuration of two charges $Q$ and $q$ separated by a distance of $r$. The formula is \[ U({r}) = \frac{kQq}{r} \qquad \text{[J]}, \] which is very similar to the formulate for $|\vec{F}_e(Q,q,r)|$ above, but with a one-over-r relationship instead of a one-over-r-squared.
We learned in mechanics, that often times the most elegant way to solve problems in physics is not to calculate the forces involved directly, but to use the principle of conservation of energy. By simple accounting of the different types of energy: kinetic (K), potential (U) and the work done (W), we can often arrive at the answer.
In mechanics we studied the gravitational potential energy $U_g=mgh$ and the spring potential energy $U_s=\frac{1}{2}kx^2$ associated with the gravitational force and spring force respectively. Now you have a new kind of potential energy to account for: $U_e=\frac{kQq}{r}$.
A charge $Q=20$[$\mu$C] is placed 2.2 [m] away from a second charge $q=3$[$\mu$C]. What will be the magnitude of the force between them? Is the force attractive or repulsive?
A charge $Q=6$[$\mu$C] is placed at the origin $(0,0)$ and a second charge $q=-5$[$\mu$C] is placed at $(3,0)$ [m]. What will be the force on $q$. Express your answer as a vector.
If the charge $q$ was placed instead at $(0,3)$[m], what would be the resulting electric vector?
What if the charge $q$ is placed at $(2,4)$[m]. What will be the electric force on $q$ then? Express your answer both in terms of magnitude-and-direction and in component notation.
A fixed charge of $Q=3$[$\mu$C] and a movable charge $q=2$ [$\mu$C] are placed at a distance of 30 [cm] apart. If the charge $q$ is released it will fly off into the distance. How fast will it be going when it is $4$[m] away from $Q$?
The electric force is a vector quantity so the real formula for the electric force must be written as a vector.
Let $\vec{r}$ be the vector distance from $Q$ to $q$. The electric force on the charge $q$ is \[ \vec{F}_e({r}) = \frac{k_eQq}{r^2}\hat{r} \qquad \text{[N]}, \] where $\hat{r}$ is a direction vector pointing away from $Q$. This formula will automatically take care of the direction of the vector in both the attractive and repulsive cases. If $Q$ and $q$ are of the same charge the force will be in the positive $\hat{r}$ direction (repulsive force), but if the charges have opposite sign, the force will be in the negative $\hat{r}$ direction.
In general, it is easier to think of the magnitude of the electric force, and then add the vector part manually by thinking in terms of attractive/repulsive rather than to depend on the sign in the vector equation to figure out the direction for you.
The potential energy of a configuration of charges is defined as the negative of the amount of work which would be necessary in order to bring the charges into this configuration: $U_e = - W_{done}$.
To derive the potential energy formula for charges $Q$ and $q$ separated by a distance $R$ in meters, we can imagine that $Q$ is at the origin and the charge $q$ starts off infinitely far away on the $x$-axis and is brought to a distance of $R$ from the origin slowly. The electric potential energy is given by the following integral: \[ \Delta U_e = - W_{done} = - \int_{r=\infty}^{r=R} \vec{F}_{ext}({r}) \cdot d\vec{s}. \] By bringing the charge $q$ from infinitely far away we make sure that the initial potential energy is going to be zero. Just like with all potentials, we need to specify a reference point with respect to which we will measure it. We define the potential at infinity to be zero, so that $\Delta U_e = U_e({R})-U_e(\infty) = U_e({R})-0= U_e({R})$.
OK, so the charge $q$ starts at $(\infty,0)$ and we sum-up all the work that will be necessary to bring it to the coordinate $(R,0)$. Note that we need an integral an integral to calculate the work, because the strength of the force changes during the process.
Before we do the integral, we have to think about the direction of the force and the direction of the integration steps. If we want to obtain the correct sign, we better be clear about all the negative signs in the expression:
will be $\vec{F}_e({x}) = \frac{k_eQq}{x^2}\hat{x}$.
Therefore if we want to move the charge $q$ towards $Q$ we have to apply an external force $\vec{F}_{ext}$ on the charge in the opposite direction. The magnitude of the external force needed to hold the charge in place (or to move it towards the origin at a constant speed) is given by $\vec{F}_{ext}({x}) = -\frac{k_eQq}{x^2}\hat{x}$. * The displacement vector $d\vec{s}$ always points in the negative direction, since we start from $+\infty$ and move back to the origin. Therefore, in terms of the positive $x$-direction the displacements are small negative steps $d\vec{s} = - dx\; \hat{x}$.
The negative of the $W_{done}$ from $\infty$ to $R$ is given by the following integral: \[ \begin{align} \Delta U_e & = - W_{done} = - \int_{r=\infty}^{r=R} \vec{F}_{ext}({r}) \cdot d\vec{s} \nl & = -\int_{x=\infty}^{x=R} \left( - \frac{k_eQq}{x^2}\hat{x}\right) \cdot \left( -\hat{x}dx\right) \nl & = - \int_{\infty}^{R} \frac{k_eQq}{x^2} \ (\hat{x}\cdot\hat{x}) \ dx \nl & = - k_eQq \int_{\infty}^{R} \frac{1}{x^2} \ 1 \ dx \nl & = - k_eQq \left[ \frac{-1}{x} \right]_{\infty}^{R} \nl & = k_eQq \left[ \frac{1}{R} - \frac{1}{\infty} \right] \nl & = \frac{k_eQq}{R}. \end{align} \]
So we have that we have \[ \Delta U_e \equiv U_{ef} - U_{ei} = U_e({R}) - U_e(\infty), \] and since $U_e(\infty)=0$ we have derived that \[ U_e({R}) = \frac{k_eQq}{R}. \]
We say that the work done to bring the two charges together is stored in the electric potential energy $U_e({r})$ because if we were to let go of these charges they would fly away from each other, and give back all that energy as kinetic energy.
We can also use the relationship between force and potential energy in the other direction. If I were to tell you that the potential energy of two charges is \[ U({r}) = \frac{k_eQq}{r}, \] then, by definition, the force associated with that potential is given by \[ \vec{F}({r}) \equiv - \frac{dU({r}) }{dr} = \frac{k_eQq}{r^2} \hat{r}. \]
Opposite charges cancel out. If you have a sphere with $5$[$\mu$C] of charge on it, and you add some negative charge to it, say $-1$[$\mu$C], then the resulting charge on the sphere will be $4$[$\mu$C].
Charged particles will redistribute themselves between different objects brought into contact so as to minimize the repulsive force between them. This means that charge is always maximally spread out over the entire surface of the object. For example, if charge is placed on a metal ball made of conducting material the charge will all go to the surface of the body and will not penetrate into the interior.
As another example, consider two metal spheres that are connected by a conducting wire with a total charge $Q$ placed on the system. Because charge is free to move along the wire, it will end up distributed uniformly over the total area $A =A_1 +A_2$, where $A_1$ and $A_2$ are the surface areas of the two spheres. The surface charge density will be $\sigma = Q/A$ [C/m$^2$]. The charge on each sphere will be proportional to the surface area of the object: \[ Q_1 = \sigma A_1 = \frac{A_1}{A_1+A_2} Q, \qquad Q_2 = \sigma A_2 = \frac{A_2}{A_1+A_2} Q. \qquad \textrm{[C]} \] Note that the $Q_1 + Q_2=Q$ as expected.
We will now discuss a new language for dealing with electrostatic problems.
So far we saw that the electric force, $\vec{F}_e$, exists between two charges $Q$ and $q$, and that the formula is given by Coulomb's law $\vec{F}_e=\frac{k_eQq}{r^2}\hat{r}$. How exactly this force is produced, we don't know. We just know from experience that it exists.
The electric field is an intuitive way to explain how the electric force works. We imagine that the charge $Q$ creates an electric field everywhere in space described by the formula $\vec{E} = \frac{k_eQ}{r^2}\hat{r}$ $[N/C]$. We further say that any charge placed in an electric field will feel an electric force proportional to the strength of the electric field. A charge $q$ placed in an electric field of strength $\vec{E}$ will feel an electric force $\vec{F}_e = q \vec{E}=\frac{k_eQq}{r^2}\hat{r}$.
This entire chapter is about this change of narrative when explaining electrostatic phenomena. There is no new physics. The electric field is just a nice way of thinking in terms of cause and effect. The charge $Q$ caused the electric field $\vec{E}$ and the electric field $\vec{E}$ caused the force $\vec{F}_e$ on the charge $q$.
You have to admit that this new narrative is nicer, than just saying that somehow the electric force “happens”.
Recall the concepts from electrostatics:
In this section we will introduce a new language to talk about the same ideas.
The electric field caused by a charge $Q$ at a distance $r$ is given by \[ \vec{E}({r}) = \frac{kQ}{r^2}\hat{r} \qquad \text{[N/C]=[V/m]}. \]
When asked to calculate the force between two particles we simply have to multiply the electric field times the charge \[ \vec{F}_e({r}) = q\vec{E}({r}) = q\frac{kQ}{r^2}\hat{r} = \frac{kQq}{r^2}\hat{r} \qquad \text{[N]}. \]
The electric potential $V$ (not to be confused with the electric potential energy $U_e$) of a charge $Q$ is given by \[ V({r})= \frac{kQ}{r} \qquad \text{[V]} \equiv \text{[J/C]} \]
The electric potential energy necessary to bring charge $q$ to point where an electric potential $V({r})$ exists is given by \[ U_e({r}) = q V({r}) = q\frac{kQ}{r} = \frac{kQq}{r} \qquad \text{[J]}. \]
We can think of the electric field $\vec{E}$ as an electric force per unit charge. Indeed the dimensions of the electric field is $\text{[N/C]}$, so the electric field tells us the amount of force that a test charge of $q=1$[C] would feel at that point. Similarly, the electric potential is $V$ is the electric potential energy per unit charge, as can be seen from the dimensions: $\text{[V]}=\text{[J/C]}$.
In the electrostatics chapter we saw that, \[ U_e({R}) = - W_{done} = - \int_{\infty}^R \vec{F}_e({r}) \cdot d\vec{s}, \qquad \qquad \vec{F}_e({r}) = - \frac{dU({r}) }{dr}. \]
An analogous relation exists between the per unit charge quantities. \[ V({R}) = - \int_{\infty}^R \vec{E}({r}) \cdot d\vec{s}, \qquad \qquad \qquad \qquad \ \ \vec{E}({r}) = - \frac{dV({r}) }{dr}. \]
A major issue in understanding the ideas of electromagnetism is to get an intuitive understanding of the concept of electric potential $V$. First, there is the naming problem. There are at least four other terms for the concept: voltage, potential difference, electromotive force and even electromotance! Next, we have the possible source of confusion with the concept of electric potential energy, which doesn't help the situation. Perhaps the biggest problem with the concept of electric potential is that it doesn't exist in the real world: like the electric field to which it is related, it is simply a construct of the mind, which we use to solve problems and do calculations.
Despite the seemingly unsurmountable difficulty of describing the nature of something which doesn't exist, I will persist in this endeavour. I want to give you a proper intuition about voltage, because this concept will play an extremely important role in circuits. While it is true that voltage doesn't exist, energy does exist and energy is just $U=qV$. Voltage, therefore, is electric potential energy per unit charge, and we can talk about the voltage in the language of energy.
Every time you need to think about some electric potential, just imagine what would happen to a unit test charge: q=1[C], and then think in terms of energy. If the potential difference between point (a) and point (b) is $V_{ab}=16$[V], this means that a charge of 1[C] that goes from (a) to (b) will gain 16[J] of energy. If you have some circuit with a 3[V] battery in it, then each Coulomb of charge that is pumped through the battery gains $3$[J] of energy. This is the kind of reasoning we used in the opening example in the beginning of electrostatics, in which we calculated the kinetic energy of the electrons inside an old-school TV.
We can visualize the electric field caused by some charge as electric field lines everywhere around it. For a positive charge ($Q>0$), the field lines will be leaving it in all directions towards negative charges or expanding to infinity. We say that a positive charge is a source of electric field lines and that a negative charge ($Q<0$) is a sink for electric field lines, i.e., it will have electric field lines going into it The diagram on the right illustrates the field lines for two isolated charges. If these charges were placed next to each other, then the field lines leaving the (+) charge would all curve around and go into the (-) charge.
If you were to put two current-carrying wires close to each other you will see that there will be a force between the wires. If the current is going in the same direction for both wires, then they will attract (buckle inwards), whereas if the currents are in opposite directions, the the wires will be pushed apart (tend to spread apart). This is the magnetic force. The powerful magnetic force is also what makes motors, generators and electromagnets work.
Recall that the electric force will exists between any two charged particles. Recall also how we invented the notion of an electric field $\vec{E}$ as an intermediary phenomenon. The story we told ourselves to explain the emergence of the electric force was as follows. One of the charges, say charge $Q$, creates an electric field $\vec{E}$ in space everywhere around it. The other charge (say $q$), will feel an electric force $F_e = q\vec{E}$ because of the electric field.
In this section we will follow a similar reasoning using a new intermediary concept. To explain the magnetic force between two current carrying wires, we will say that the current in the first wire is causing a magnetic field $\vec{B}$ everywhere in space and that the second current-carrying wire feels a magnetic force because of the magnetic field it is placed in.
A good way to learn about the properties of the magnetic field is to describe what are its causes and what are its effects. This is the approach we take below.
General concepts:
$4\pi\times10^{-7}$ [Vs/Am] = $1.2566\times10^{-6}$ [H/m]=[N/A^2]
For solenoids we will have:
reacts to the magnetic field. A winding with $N$ turns produces a magnetic
field that is $N$ times stronger than a single loop of wire. * $L$: The length of a winding. * $n \equiv N/L$: Is the winding density, how many turns per meter.
Each moving charges causes a magnetic field around it. However, the magnetic field created by a single moving charge is very small, so we will usually discuss magnetic fields created by currents.
Current is measured in Amperes [A], which is a equal to Coulombs per second [C/s]. Consider the following piece of wire with a current $3$[A] in it:
a b -------------- I= 3 [A]
The above diagram makes no sense, since it does not specify the direction in whist the current is flowing. Let's fix it:
a b ------>------- I=3 [A]
That is better. When we say $I=3$[A], this means that there are 3[C] of charge flowing through this wire every second. The current enters the wire at $a$, and is confined to flow along the wire and thus it has to leave at point $b$.
If we say that the current is negative, this means that the current is flowing in the opposite direction of which the arrow points.
a b a b ------>------- = ------<------- I=-1 [A] I=1 [A]
In the above diagram the current flows from $b$ to $a$, which is equivalent to saying that a negative current flows from $a$ to $b$.
The magnetic field $\vec{B}$ caused at some point $\vec{r}$ by a piece of wire of length $\ell$ carrying a current $I$ is given by \[ \vec{B} = \frac{k_b\ell I}{r^2} \hat{ I} \times \hat{r} = \frac{\mu_0}{4\pi}\frac{\ell I}{r^2} \hat{I} \times \hat{r}. \]
Don't freak out on me now. I know it looks complicated and there a arrows (vectors), cross products ($\times$), but you shouldn't worry. We will brake it down until it makes sense.
First the magnitude part: \[ |\vec{B}| = \frac{k_b \ell I}{r^2}, \] which doesn't seem quite so foreign no? I mean the electric field was the same story $|\vec{E}| = \frac{k_e Q}{r^2}$, where you have some cause $Q$ and the one-over-r-squared weakening plus some constant of proportionality $k_e=\frac{1}{4\pi \epsilon_0}$. The important thing to remember is that the cause of magnetic field is $\ell I$ the product of the current in the wire times the length of the piece of wire. The longer the wire is, the more magnetic field it will cause. This is the reason that people make “magnetic windings” with hundreds of turns instead of using a single loop.
As for the direction, yes we need to think about that for a moment:
is perpendicular to both ${\hat I}$ and ${\hat r}$.
In general you will want to calculate not the magnetic field of a small piece, but of something more complicated. In this book (and in most E&M books), we will discuss three special cases of the magnetic field produced by:
Each of these configurations corresponds to a calculation involving an integral. When you see integral think “adding up the pieces” or “adding up the contributions”. We need an integral to calculate the total $\vec{B}$ field because different parts of the wire may contribute to the magnetic field unevenly. specific integral happens to be a vector integral. You don't need to understand the whole machinery of vector integration just yet, but you do need to know how to use the three formulas given below. If you are interested to see how we derived the formulas, you can check out the Derivations section below.
If you have take an infinitely long piece of wire and pass a current $I$ through it, you will be creating a magnetic field $\vec{B}$ everywhere around the wire. The magnetic field lines will be circulating around the wire. This is how the magnetic field works.
It is important to get the right direction for the circulation. If you grab a piece of wire with your right hand in such a way that your thumb points in the direction of the current, then the magnetic field lines are circulating around the wire in the same direction as your fingers.
The further away you move from the wire the weaker the magnetic field $\vec{B}$ will get. If a point is $r$ meters away from the wire, the magnitude of the magnetic field at that point will be given by: \[ |\vec{B}| = \mu_0 \frac{I}{2\pi r} \]
This formula was discovered by André-Marie Ampère in 1826.
If you have a loop of wire that is carrying a current, then the strength of the magnetic field in the centre is going to be: \[ |\vec{B}_{centre}| = 2\pi R \frac{\mu_0}{4\pi} \frac{I}{R^2} = \frac{\mu_0I}{2R}. \]
To get the direction of the magnetic field, you need use the right hand rule again: grab the loop with your thumb pointed in the same direction of the current and then see which way your fingers point inside the loop.
To create a stronger magnetic field, you can make loop the wire many times to create a winding. Each of the turns in the winding is going to contribute to the magnetic field inside and this way you can get some very strong magnetic fields.
Consider a winding that has $N$ turns and length $L$[m]. We call such a device a solenoid. The magnetic field $\vec{B}$ inside a solenoid is: \[ |\vec{B}| = \mu_0 n I, \] where $n$ is the winding density = number of windings per unit length $n=N/L$ [turns/m].
A charge which is not moving feels no magnetic forces. Only when the charge is moving will it feel a magnetic force, and the faster the charge is moving the stronger the magnetic force will be.
The magnetic force that a charge $q$, moving with velocity $\vec{v}_q$ will field when it is passing through a magnetic field $\vec{B}$ is given by the formula: \[ \vec{F}_b = q (\vec{v}_q \times \vec{B}). \] Observe that the formula involves a cross product. This means that the force on the particle will be perpendicular to both the direction in which it is moving and the direction of the magnetic field. This is the second right hand rule. Take your open right hand (don't curl your fingers) and place it so that your thumb points in the direction of the velocity and your fingers point in the direction of the magnetic field lines. The magnetic force will be in the direction of your palm.
It is interesting to point out that the magnetic force does zero work. This is because it always acts in a direction perpendicular to the displacement $\vec{d}$: \[ W_b = \vec{F}_b \cdot \vec{d} = 0. \] The magnetic force can change the direction in which the particle is travelling, but not make it go faster or slow it down. Indeed, a moving charged particle placed in a uniform magnetic field will turn around in a circle, because of the centripetal acceleration caused by the magnetic force.
More generally, we can write down the equation for the total electric + magnetic force that a charge feels. The combined force is called the Lorentz force, or electromagnetic force: \[ \vec{F}_{EM} = \underbrace{ q\vec{E} }_{\vec{F}_e} + \underbrace{ q (\vec{v}_q \times \vec{B}) }_{\vec{F}_b}. \]
Consider now a current $I$ flowing in a piece of wire of length $\ell$ placed in a magnetic field $\vec{B}$. The force on the piece of wire will be: \[ \vec{F}_b = \ell \vec{I} \times \vec{B}. \] Observe again that a cross product is used, so we need to use the second right hand rule again to figure out the direction of the force.
The two scenarios discussed above show how the magnetic field can produce a mechanical force on an object. Magnetic fields can also produce electromotive forces inside a given circuit, that is, the magnetic field can cause (we usually say induce to sound fancy) a voltage inside the circuit and made a current circulate. This phenomenon is called Faraday's law of induction and will be the subject of the next section.
Some of you may feel cheated by this chapter. Here I am telling you to memorizing five formulas without telling you where they come from. Let's fix that.
One of the most important laws for magnetism is Ampere's law. Like Gauss' law electromagnetism, it is not so much a law as a principle from which many laws can be derived.
The statement involves some area of space $A$ with a total current $I_{in}$ passing through that area. Let the closed path $\mathcal{C}$ correspond to the circumference of the area $A$ (the boundary). If you integrate the strength of the magnetic field along the path $\mathcal{C}$ (this is called the circulation), you will find that it is proportional to the total amount of current flowing inside the loop: \[ \oint_{\mathcal{C}} \vec{B} \cdot d\vec{s} = \mu_0 I_{in}. \] Like Gauss' law, Ampere's law simply tells us that we can do the accounting for magnetic phenomena in two different ways: either we calculate the circulation of the magnetic field along the boundary (the path $\mathcal{C}$) or we calculate the total current flowing inside.
The formula of for the strength of the $\vec{B}$ field around an infinitely long wire comes from Ampere's law. Let $\mathcal{C}$ be an imaginary circle of radius $r$ centred on the wire. The $\vec{B}$ field will be constant in magnitude and always pointing along the path of integration so we will get: \[ \oint_{\mathcal{C}} \vec{B} \cdot d\vec{s} = \int_{0}^{2\pi} |\vec{B}| \ r d\theta = |\vec{B}| 2\pi r = \mu_0 I_{in}. \] Solve for $|\vec{B}|$ to obtain the formula for the $\infty$-long wire.
More generally, to calculate the magnetic field produced by some arbitrarily shaped wire $\mathcal{L}$ that is carrying a current $I$ we use the following formula: \[ \vec{B}(\vec{r}) = \int_\mathcal{L}\frac{\mu_0}{4\pi} \frac{I}{|\vec{r}|^2} d\mathbf{l} \times {\hat r}, \] which tells you how strong the magnetic field $\vec{B}$ will be at a point $\vec{r}$. The cause of this field is the current $I$, that is flowing in the length of wire $\mathcal{L}$. The expression is an integral which tells us that we should split the entire length of the wire into little pieces of length $dl$ and add up all their magnetic contributions.
We need an integral because different parts of the wire may contribute to the magnetic field unevenly. This happens to be a vector integral, which you probably have not seen before, and I don't think you need to understand the whole machinery just yet. When you see integral think “adding up the pieces”.
Every time you have a moving charge, there will be a magnetic field $\vec{B}$. Here is a list of real-world phenomena that involve magnetic fields. In each case, when we analyze what is going on we see that some moving charge is causing the magnetic fields.
A photon is a wave of EM energy produced by an excited
electron dropping to a lower energy level in some atom. * permanent magnets (like a fridge magnet) exhibit magnetic properties because of the many tiny loops of "electron flow" circling around Fe atoms. * The magnetic field of the earth is caused by the flow of charged magma in the earth's core.
And Mankind saw that magnetic field was good, and decided to make more of it. If moving charges create lots of magnetic field, then let's get lots of charge moving (a current $I$) and then we will have lots of magnetic field!
The following are some practical applications of the magnetic fields and the magnetic forces they produce:
in the human body by using carefully chosen oscillating magnetic fields.