Skip to main content
Physics LibreTexts


  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    At this stage, you understand roughly as much about the classification of interactions as physicists understood around the year 1800. There appear to be three fundamentally different types of interactions: gravitational, electrical, and magnetic. Many types of interactions that appear superficially to be distinct --- stickiness, chemical interactions, the energy an archer stores in a bow --- are really the same: they're manifestations of electrical interactions between atoms. Is there any way to shorten the list any further? The prospects seem dim at first. For instance, we find that if we rub a piece of fur on a rubber rod, the fur does not attract or repel a magnet. The fur has an electric field, and the magnet has a magnetic field. The two are completely separate, and don't seem to affect one another. Likewise we can test whether magnetizing a piece of iron changes its weight. The weight doesn't seem to change by any measurable amount, so magnetism and gravity seem to be unrelated.

    That was where things stood until 1820, when the Danish physicist Hans Christian Oersted was delivering a lecture at the University of Copenhagen, and he wanted to give his students a demonstration that would illustrate the cutting edge of research. He generated a current in a wire by making a short circuit across a battery, and held the wire near a magnetic compass. The ideas was to give an example of how one could search for a previously undiscovered link between electricity (the electric current in the wire) and magnetism. One never knows how much to believe from these dramatic legends, but the story is2 that the experiment he'd expected to turn out negative instead turned out positive: when he held the wire near the compass, the current in the wire caused the compass to twist!

    People had tried similar experiments before, but only with static electricity, not with a moving electric current. For instance, they had hung batteries so that they were free to rotate in the earth's magnetic field, and found no effect; since the battery was not connected to a complete circuit, there was no current flowing. With Oersted's own setup, h, the effect was only produced when the “circuit was closed, but not when open, as certain very celebrated physicists in vain attempted several years ago.”3


    Figure 1. When the circuit is incomplete, no current flows through the wire, and the magnet is unaffected. It points in the direction of the Earth's magnetic field. 2. The circuit is completed, and current flows through the wire. The wire has a strong effect on the magnet, which turns almost perpendicular to it. If the earth's field could be removed entirely, the compass would point exactly perpendicular to the wire; this is the direction of the wire's field.

    Oersted was eventually led to the conclusion that magnetism was an interaction between moving charges and other moving charges, i.e., between one current and another. A permanent magnet, he inferred, contained currents on a microscopic scale that simply weren't practical to measure with an ammeter. Today this seems natural to us, since we're accustomed to picturing an atom as a tiny solar system, with the electrons whizzing around the nucleus in circles. As shown in figure i, a magnetized piece of iron is different from an unmagnetized piece because the atoms in the unmagnetized piece are jumbled in random orientations, whereas the atoms in the magnetized piece are at least partially organized to face in a certain direction.


    Figure i: A schematic representation of an unmagnetized material, 1, and a magnetized one, 2.

    Figure j shows an example that is conceptually simple, but not very practical. If you try this with a typical vacuum tube, like a TV or computer monitor, the current in the wire probably won't be enough to produce a visible effect. A more practical method is to hold a magnet near the screen. We still have an interaction between moving charges and moving charges, but the swirling electrons in the atoms in the magnet are now playing the role played by the moving charges in the wire in figure j. Warning: if you do this, make sure your monitor has a demagnetizing button! If not, then your monitor may be permanently ruined.


    Figure j: Magnetism is an interaction between moving charges and moving charges. The moving charges in the wire attract the moving charges in the beam of charged particles in the vacuum tube.

    Relativity requires magnetism

    So magnetism is an interaction between moving charges and moving charges. But how can that be? Relativity tells us that motion is a matter of opinion. Consider figure k. In this figure and in figure l, the dark and light coloring of the particles represents the fact that one particle has one type of charge and the other particle has the other type.


    Figure k./ One observer sees an electric field, while the other sees both an electric field and a magnetic one.

    Observer k/2 sees the two particles as flying through space side by side, so they would interact both electrically (simply because they're charged) and magnetically (because they're charges in motion). But an observer moving along with them, k/1, would say they were both at rest, and would expect only an electrical interaction. This seems like a paradox. Magnetism, however, comes not to destroy relativity but to fulfill it. Magnetic interactions must exist according to the theory of relativity. To understand how this can be, consider how time and space behave in relativity. Observers in different frames of reference disagree about the lengths of measuring sticks and the speeds of clocks, but the laws of physics are valid and self-consistent in either frame of reference. Similarly, observers in different frames of reference disagree about what electric and magnetic fields there are, but they agree about concrete physical events. An observer in frame of reference k/1 says there are electric fields around the particles, and predicts that as time goes on, the particles will begin to accelerate towards one another, eventually colliding. She explains the collision as being due to the electrical attraction between the particles. A different observer, k/2, says the particles are moving. This observer also predicts that the particles will collide, but explains their motion in terms of both an electric field and a magnetic field. As we'll see shortly, the magnetic field is required in order to maintain consistency between the predictions made in the two frames of reference.

    To see how this really works out, we need to find a nice simple example. An example like figure k is not easy to handle, because in the second frame of reference, the moving charges create fields that change over time at any given location, like when the V-shaped wake of a speedboat washes over a buoy. Examples like figure j are easier, because there is a steady flow of charges, and all the fields stay the same over time. Figure l/1 shows a simplified and idealized model of figure j. The charge by itself is like one of the charged particles in the vacuum tube beam of figure j, and instead of the wire, we have two long lines of charges moving in opposite directions. Note that, as discussed in discussion question C on page 106, the currents of the two lines of charges do not cancel out. The dark balls represent particles with one type of charge, and the light balls have the other type. Because of this, the total current in the “wire” is double what it would be if we took away one line.

    As a model of figure j, figure l/1 is partly realistic and partly unrealistic. In a real piece of copper wire, there are indeed charged particles of both types, but it turns out that the particles of one type (the protons) are locked in place, while only some of the other type (the electrons) are free to move. The model also shows the particles moving in a simple and orderly way, like cars on a two-lane road, whereas in reality most of the particles are organized into copper atoms, and there is also a great deal of random thermal motion. The model's unrealistic features aren't a problem, because the point of this exercise is only to find one particular situation that shows magnetic effects must exist based on relativity.

    What electrical force does the lone particle in figure l/1 feel? Since the density of “traffic” on the two sides of the “road” is equal, there is zero overall electrical force on the lone particle. Each “car” that attracts the lone particle is paired with a partner on the other side of the road that repels it. If we didn't know about magnetism, we'd think this was the whole story: the lone particle feels no force at all from the wire.


    Figure l: A model of a charged particle and a current-carrying wire, seen in two different frames of reference. The relativistic length contraction is highly exaggerated. The force on the lone particle is purely magnetic in 1, and purely electric in 2.

    Figure l/2 shows what we'd see if we were observing all this from a frame of reference moving along with the lone charge. Here's where the relativity comes in. Relativity tells us that moving objects appear contracted to an observer who is not moving along with them. Both lines of charge are in motion in both frames of reference, but in frame 1 they were moving at equal speeds, so their contractions were equal. In frame 2, however, their speeds are unequal. The dark charges are moving more slowly than in frame 1, so in frame 2 they are less contracted. The light-colored charges are moving more quickly, so their contraction is greater now. The “cars” on the two sides of the “road” are no longer paired off, so the electrical forces on the lone particle no longer cancel out as they did in l/1. The lone particle is attracted to the wire, because the particles attracting it are more dense than the ones repelling it. Furthermore, the attraction felt by the lone charge must be purely electrical, since the lone charge is at rest in this frame of reference, and magnetic effects occur only between moving charges and other moving charges.

    Now observers in frames 1 and 2 disagree about many things, but they do agree on concrete events. Observer 2 is going to see the lone particle drift toward the wire due to the wire's electrical attraction, gradually speeding up, and eventually hit the wire. If 2 sees this collision, then 1 must as well. But 1 knows that the total electrical force on the lone particle is exactly zero. There must be some new type of force. She invents a name for this new type of force: magnetism. This was a particularly simple example, because the force was purely magnetic in one frame of reference, and purely electrical in another. In general, an observer in a certain frame of reference will measure a mixture of electric and magnetic fields, while an observer in another frame, in motion with respect to the first, says that the same volume of space contains a different mixture.

    We therefore arrive at the conclusion that electric and magnetic phenomena aren't separate. They're different sides of the same coin. We refer to electric and magnetic interactions collectively as electromagnetic interactions. Our list of the fundamental interactions of nature now has two items on it instead of three: gravity and electromagnetism.


    FigureFgm: Magnetic interactions involving only two particles at a time. In these figures, unlike figure l/1, there are electrical forces as well as magnetic ones. The electrical forces are not shown here. Don't memorize these rules!

    The basic rules for magnetic attractions and repulsions, shown in figure m, ar enot quite as simple as the ones for gravity and electricity. Rules m/1 and m/2 follow directly from our previous analysis of figure l. Rules 3 and 4 are obtained by flipping the type of charge that the bottom particle has. For instance, rule 3 is like rule 1, except that the bottom charge is now the opposite type. This turns the attraction into a repulsion. (We know that flipping the charge reverses the interaction, because that's the way it works for electric forces, and magnetic forces are just electric forces viewed in a different frame of reference.)

    Example 1: A magnetic weathervane placed near a current

    Figure n shows a magnetic weathervane, consisting of two charges that spin in circles around the axis of the arrow. (The magnetic field doesn't cause them to spin; a motor is needed to get them to spin in the first place.)


    Figure n: Example 1

    Just like the magnetic compass in figure h, the weathervane's arrow tends to align itself in the direction perpendicular to the wire. This is its preferred orientation because the charge close to the wire is attracted to the wire, while the charge far from the wire is repelled by it.

    Magnetic fields

    How should we define the magnetic field? When two objects attract each other gravitationally, their gravitational energy depends only on the distance between them, and it seems intuitively reasonable that we define the gravitational field arrows like a street sign that says “this way to lower gravitational energy.” The same idea works fine for the electric field. But what if two charged particles are interacting magnetically? Their interaction doesn't just depend on the distance, but also on their motions.

    We need some way to pick out some direction in space, so we can say, “this is the direction of the magnetic field around here.” A natural and simple method is to define the magnetic field's direction according to the direction a compass points. Starting from this definition we can, for example, do experiments to show that the magnetic field of a current-carrying wire forms a circular pattern, o.


    FIgure o: The magnetic field curls around the wire in circles. At each point in space, the magnetic compass shows the direction of the field.

    But is this the right definition? Unlike the definitions of the gravitational and electric fields' directions, it involves a particular human-constructed tool. However, compare figure h with figure n. Note that both of these tools line themselves up along a line that's perpendicular to the wire. In fact, no matter how hard you try, you will never be able to invent any other electromagnetic device that will align itself with any other line. All you can do is make one that points in exactly the opposite direction, but along the same line. For instance, you could use paint to reverse the colors that label the ends of the magnetic compass needle, or you could build a weathervane just like figure n, but spinning like a left-handed screw instead of a right-handed one. The weathervane and the compass aren't even as different as they appear. Figure p shows their hidden similarities.


    Figure p: 1. The needle of a magnetic compass is nothing more than a bar magnet that is free to rotate in response to the earth's magnetic field. 2. A cartoon of the bar magnet's structure at the atomic level. Each atom is very much like the weathervane of figure n.

    Nature is trying to tell us something: there really is something special about the direction the compass points. Defining the direction of the magnetic field in terms of this particular device isn't as arbitrary as it seems. The only arbitrariness is that we could have built up a whole self-consistent set of definitions that started by defining the magnetic field as being in the opposite direction.

    Example 2: Head-to-tail alignment of bar magnets

    • If you let two bar magnets like the one in figure p interact, which way do they want to line up, head-to-head or head-to-tail?
    • Each bar magnet contains a huge number of atoms, but that won't matter for our result; we can imagine this as an interaction between two individual atoms. For that matter, let's model the atoms as weathervanes like the one in figure n. Suppose we put two such weather vanes side by side, with their arrows both pointing away from us. From our point of view, they're both spinning clockwise. As one of the charges in the left-hand weather vane comes down on the right side, one of the charges in the right-hand vane comes up on the left side. These two charges are close together, so their magnetic interaction is very strong at this moment. Their interaction is repulsive, so this is an unstable arrangement of the two weathervanes.

    On the other hand, suppose the left-hand weathervane is pointing away from is, while its partner on the right is pointing toward us. From our point of view, we see the one on the right spinning counterclockwise. At the moment when their charges come as close as possible, they're both on the way up. Their interaction is attractive, so this is a stable arrangement.

    Translating back from our model to the original question about bar magnets, we find that bar magnets will tend to align themselves head-to-tail. This is easily verified by experiment.


    Figure q: The force on a charged particle moving through a magnetic field is perpendicular to both the field and its direction of motion. The relationship is right-handed for one type of charge, and left-handed for the other type.

    If you go back and apply this definition to all the examples we've encountered so far, you'll find that there's a general rule: the force on a charged particle moving through a magnetic field is perpendicular to both the field and its direction of motion. A force perpendicular to the direction of motion is exactly what is required for circular motion, so we find that a charged particle in a vacuum will go in a circle around the magnetic field arrows (or perhaps a corkscrew pattern, if it also has some motion along the direction of the field). That means that magnetic fields tend to trap charged particles.


    Figure r: A beam of electrons circles around the magnetic field arrows.

    Figure r shows this principle in action. A beam of electrons is created in a vacuum tube, in which a small amount of hydrogen gas has been left. A few of the electrons strike hydrogen molecules, creating light and letting us see the path of the beam. A magnetic field is produced by passing a current (meter) through the circular coils of wire in front of and behind the tube. In the bottom figure, with the magnetic field turned on, the force perpendicular to the electrons' direction of motion causes them to move in a circle.

    Example 3: Sunspots

    Sunspots, like the one aove, are places where the sun's magnetic field is unusually strong. Charged particles are trapped there for months at a time. This is enough time for the sunspot to cool down significantly, and it does not get heated back up because the hotter surrounding material is kept out by the same magnetic forces.


    Figure: This sunspot is a product of the sun's magnetic fields. The darkest region in the center is about the size of our planet.

    Example 4: The aurora and life on earth's surface

    A strong magnetic field seems to be one of the prerequisites for the existence of life on the surface of a planet. Energetic charged particles from the sun are trapped by our planet's magnetic field, and harmlessly spiral down to the earth's surface at the poles. In addition to protecting us, this creates the aurora, or “northern lights.”

    The astronauts who went to the moon were outside of the earth's protective field for about a week, and suffered significant doses of radiation during that time. The problem would be much more serious for astronauts on a voyage to Mars, which would take at least a couple of years. They would be subjected to intense radiation while in interplanetary space, and also while on Mars's surface, since Mars lacks a strong magnetic field.

    Features in one Martian rock have been interpreted by some scientists as fossilized bacteria. If single-celled life evolved on Mars, it has presumably been forced to stay below the surface. (Life on Earth probably evolved deep in the oceans, and most of the Earth's biomass consists of single-celled organisms in the oceans and deep underground.)

    Contributors and Attributions

    • Benjamin Crowell, Conceptual Physics

    Electromagnetism is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.