General Physics (calculus based) Class Notes

Dr. Rakesh Kapoor, M.Sc., Ph.D.

Former Faculty-University of Alabama at Birmingham, Birmingham, AL 35294

Magnetic Fields Due to Currents


In this chapter we will explore the relationship between an electric current and the magnetic field it generates in the space around it.

For problems with low symmetry we will use the law of Biot-Savart law in combination with the principle of superposition.

For problems with high symmetry we will introduce Ampere’s law.

Both approaches will be used to explore the magnetic field generated by currents in a variety of geometries (straight wire, wire loop, solenoid coil, toroid coil).

We will also determine the force between two parallel, current-carrying conductors.  We will then use this force to define the SI unit for electric current (the ampere).

Magnetic Field Due to a current

A moving charge produce magnetic field and its magnitude and direction are given by "Biot-Savart law" (pronounced bee-oh sah-VAR)



MagneticField_due_to_Current_3.gif is the magnetic field  at a position MagneticField_due_to_Current_4.gif due to a charge q, moving  with velocity MagneticField_due_to_Current_5.gif.

Current in a wire is an example of moving charge, therefore it should produce a magnetic field.

Consider a small segment ds of a wire carrying current i.

If MagneticField_due_to_Current_6.gif is the drift velocity then time t taken by all the conduction electrons, in the segment ds, to cross the line A is given as



Total charge q moving in time t through this segment is


The magnetic field MagneticField_due_to_Current_11.gif due to this segment of wire at point P will be given as


Since direction of MagneticField_due_to_Current_13.gif and MagneticField_due_to_Current_14.gif is same therefore we can re write above equation by substituting the value of q.


Now MagneticField_due_to_Current_16.gif, therefore magnitude of MagneticField_due_to_Current_17.gif can be written as


Since the magnetic field MagneticField_due_to_Current_19.gif is proportional to the cross product (×) of vector MagneticField_due_to_Current_20.gif and MagneticField_due_to_Current_21.gif, therefore the direction of MagneticField_due_to_Current_22.gif will always be perpendicular to MagneticField_due_to_Current_23.gif and MagneticField_due_to_Current_24.gif.

Tips to find direction of magnetic field due to a wire carrying current:

Point the thumb of right hand in the direction of current, curled fingers point to the direction of magnetic field MagneticField_due_to_Current_25.gif.

MagneticField_due_to_Current_26.gif MagneticField_due_to_Current_27.gif

Draw a circle on a plane (page) perpendicular to the direction of current with wire at the center.

If current is going in the plane (page), magnetic field goes in clockwise direction.

If current is coming out of the plane (page), magnetic field is in anti-clockwise direction.


Magnetic field MagneticField_due_to_Current_30.gif at any point P on the circle will point in the direction of the tangent and will always be perpendicular to the radial vector MagneticField_due_to_Current_31.gif joining the point P and the wire at the center.

Magnetic Field of a Current carrying Long Straight Wire

Consider a very long (infinitely long ) wire.

How can we compute magnetic field due to this wire at a point P?

We know how to calculate magnetic field at a point due to a small segment of a wire carrying current.

We can divide the wire in several small segments of length ds, and can compute magnetic field MagneticField_due_to_Current_32.gif due to each of these segments at point P.

We know Magnetic field is a vector quantity and net field at any point can be computed by vector sum of the magnetic fields due to all these segments (law of superposition).

Net magnetic field MagneticField_due_to_Current_33.gif at point P due to all the segments will be



If we apply right hand rule, the direction of MagneticField_due_to_Current_36.gif at point P due to each element will point in the page. You can see that it is perpendicular to both MagneticField_due_to_Current_37.gif and MagneticField_due_to_Current_38.gif.

Therefore magnitude of net magnetic field B can be obtained by adding magnitude of magnetic field due to each segment


If the segment ds is very small, the above equation can be written as an integral


In the above figure


With the substitution of θ and r, the integral can be re written as


Solving this integral gives us the value


By substituting the value of the integral we get


In the above example point P was at the mid of the wire.

What will be the magnetic field if point P is located at one edge of the wire?

In this case integration limits will be from 0 to ∞, instead of from -∞ to ∞.

Therefore the magnetic field at the edge of the wire will be half of the magnetic field at the middle of the wire.


Magnetic Field of a Current carrying Circular arc of Wire

Let us calculate magnetic field at the center of a circular arc of wire carrying current i.


Magnitude of MagneticField_due_to_Current_47.gif, of each element at the center of the arc is given as


Since magnetic field due to all the segments point out of the page, the net field at the center can be computed by adding the sum of magnitude due to all the segments.


If the segment ds is very small then


The above summation can be written as an integral


When arc is a complete circle then φ=2π, therefore field at the center of a circular wire will be


Magnetic Field on the axis of a Current carrying Circular loop

Let us calculate magnetic field at the center of a circular arc of wire carrying current i. In the figure cross section of the loop is shown.

MagneticField_due_to_Current_53.gif MagneticField_due_to_Current_54.gif

Here angle between MagneticField_due_to_Current_55.gif and segment MagneticField_due_to_Current_56.gif is 90°, therefore magnitude of MagneticField_due_to_Current_57.gif, of each element at point P on the axis of the circular loop is given as


As we have discussed earlier, the direction of MagneticField_due_to_Current_59.gif is perpendicular to the position vector MagneticField_due_to_Current_60.gif and segment MagneticField_due_to_Current_61.gif.

Let us decompose MagneticField_due_to_Current_62.gif into two components, One MagneticField_due_to_Current_63.gif parallel to z-axes and other MagneticField_due_to_Current_64.gif perpendicular to z-axes.

Due to symmetry, MagneticField_due_to_Current_65.gif due to the segment on left will be opposite to the MagneticField_due_to_Current_66.gif of symmetric segment on the right. Therefore the sum of all MagneticField_due_to_Current_67.gif components is equal to zero.

Thus only components contributing to the total magnetic field are MagneticField_due_to_Current_68.gif of all the segments. Net magnetic field will be sum of MagneticField_due_to_Current_69.gif component of all the segments.


Value of cos α  and value of r at a distance z from the center is given as


If ds is very small summation can be written as an integral and magnetic field at a distance z from the center is




When observation point is very far from the current loop or Rz, then the magnetic field at that point is given as


Here MagneticField_due_to_Current_75.gif, area of the current loop. In last chapter we have seen that the magnitude of magnetic moment μ of a dipole is


In present case number of loops N is one therefore


Since direction of MagneticField_due_to_Current_78.gif and MagneticField_due_to_Current_79.gif is same therefore in vector form we can write



Checkpoint 1

The figure here shows four arrangements of circular loops of radius r or 2r, centered on vertical axes (perpendicular to the loops) and carrying identical currents in the directions indicated. Rank the arrangements according to the magnitude of the net magnetic field at the dot, midway between the loops on the central axis, greatest first.


Hint : Magnetic field is proportional to area of the loop. Direction is given by right hand rule.

Force Between Two Parallel Currents.

Interactive Checkpoint - 1 (Force Between two Parallel Currents)

Two current carrying wires are placed parallel to each other.  We can say a current carrying wire is placed in the magnetic field produced by another current carrying wire.
(a) Will the wires attract or repel if the currents are parallel?
(b) Will the wires attract or repel if the currents are anti parallel?

Let us consider two parallel wires of length L each with current MagneticField_due_to_Current_84.gif and MagneticField_due_to_Current_85.gif.

How to calculate magnetic force between two current-carrying wires?

First find the magnetic field due to second (b) wire at the position of first (a)  wire.

Then calculate the force on first (a) wire due to the field of second (b) wire.

Magnetic force MagneticField_due_to_Current_86.gif on first (a) wire placed in a magnetic field MagneticField_due_to_Current_87.gif of second (b) wire is given as


Here MagneticField_due_to_Current_89.gif is length vector that has magnitude L and is directed along the direction of current MagneticField_due_to_Current_90.gif in the wire.

Magnitude of magnetic field MagneticField_due_to_Current_91.gif due to second (b) wire at a distance d is


Where MagneticField_due_to_Current_93.gif is the current through second wire. Now the force on first wire is


By right hand rule we can find the direction of force MagneticField_due_to_Current_95.gif and it follows the rule

Parallel currents attract each other, and anti parallel currents repel each other.

Checkpoint 2

The figure here shows three long, straight, parallel, equally spaced wires with identical currents either into or out of the page. Rank the wires according to the magnitude of the force on each due to the currents in the other two wires, greatest first.


Hint : Parallel currents attract and anti parallel repel. Magnitude of field reduces with distance.

Ampere's Law

Gauss law is used to compute electric field in certain symmetric charge distribution, similarly if the current distribution is considerably symmetric, Ampere's law can be used  to find the magnetic field with considerably less effort.
According to Amperes law



The loop on the integral sign means that the scalar (dot) product  is to be integrated around a closed loop, called an Amperian loop.

The current MagneticField_due_to_Current_99.gif is the net current encircled by that closed loop.

How to compute integral MagneticField_due_to_Current_100.gif?

Divide the closed path into n segments MagneticField_due_to_Current_101.gif, MagneticField_due_to_Current_102.gif,.......,MagneticField_due_to_Current_103.gif.

Compute the sum


Here MagneticField_due_to_Current_105.gif is the magnetic field at the location of ith segment. In the limiting case the summation can be replaced by an integral


For calculating MagneticField_due_to_Current_107.gif, choose any arbitrary direction as direction of Amperian loop

Curl the fingers of right hand in the direction of Amperian loop and note the direction of thumb.

All the currents inside the loop parallel to the thumb are counted as positive.

All the currents inside the loop anti parallel to the thumb are counted as negative.

All the currents outside the loop are not counted.

MagneticField_due_to_Current_108.gif MagneticField_due_to_Current_109.gif

For the above example


Checkpoint 3

The figure here shows three equal currents i (two parallel and one anti parallel) and four Amperian loops. Rank the loops according to the magnitude of MagneticField_due_to_Current_111.gif  along each, greatest first.


Hint : Only count currents inside the loop.

Application of Ampere' s Law

Example - 1 (Magnetic Field Outside a Long Straight Wire with Current)

Let us calculate magnetic field MagneticField_due_to_Current_113.gif due to a long straight wire that carries current i  straight through the page.

Draw an Amperian loop as a circle of radius r around the wire with its center at the wire center.

Since all the points on the circle are equidistant from the wire, the magnitude of MagneticField_due_to_Current_114.gif will be same at any point on the circle.


At any point the angle between MagneticField_due_to_Current_116.gif and  MagneticField_due_to_Current_117.gif is MagneticField_due_to_Current_118.gif, therefore


According to Ampere's law, the direction of current is parallel to thumb so it will be taken as positive and




This is the relation we have derived using long calculus method.

Ampere's law holds true for any closed path. We choose the path that makes the calculation of MagneticField_due_to_Current_122.gif as easy as possible.

Example - 2 (Magnetic Field inside a Long Straight Wire with Current)

Let us calculate magnetic field MagneticField_due_to_Current_123.gif due to a long straight wire of radius R, that carries current i  straight through the page. Assume that the distribution of current with in the cross-section is uniform, or current density in the wire is a constant.

Draw an Amperian loop as a circle of radius r<R, around the wire with its center at the wire center.

Since all the points on the circle are equidistant from the wire, the magnitude of MagneticField_due_to_Current_124.gif will be same at any point on the circle.


At any point the angle between MagneticField_due_to_Current_126.gif and  MagneticField_due_to_Current_127.gif is MagneticField_due_to_Current_128.gif, therefore


MagneticField_due_to_Current_130.gif is the fraction of the total current i which is passing through the area of the circle r.  MagneticField_due_to_Current_131.gif is given as


According to Ampere's law, the direction of current parallel to thumb should be taken as positive and




Let us plot magnetic field inside and outside a wire as function of the distance r from the center of wire.


Solenoid and Toroid

Magnetic field of a solenoid

A solenoid is a coil of conducting wire as shown below


Following figure shows a vertical cross-section through the central axis of a stretched out solenoid. Magnetic field lines of a stretched out solenoid.


Magnetic field lines of a real solenoid.

The field is strong and uniform at the interior point MagneticField_due_to_Current_138.gif but relatively weak at external points such as MagneticField_due_to_Current_139.gif.

In an ideal solenoid we take field at any external point as zero and uniform at any point inside the solenoid.


Let us now apply Ampere's law to a real solenoid.



We can consider a rectangular Amperian loop abcda. Since MagneticField_due_to_Current_143.gif is uniform inside the solenoid and zero out side we can write  MagneticField_due_to_Current_144.gif as sum of four integrals


The first integral on the right is Bh, where B is the magnitude of the field and h is the length of segment ab.  

Second and fourth integral are zero because B is perpendicular to the direction MagneticField_due_to_Current_146.gif inside the solenoid and B is zero out side the solenoid.

Third integral is also zero as B is zero outside the solenoid.

total value of integral will be


If n is the number of wire turns per unit length then total number of turns enclosed by the Amperian loop will nh. If i is the current through each turn, total enclosed current will be


According to Ampere' s law, magnitude of B inside the solenoid will be given as




Although it is derived for an infinite solenoid but it holds true for actual solenoid if we measure at a point inside the solenoid away from the edges.

Magnetic field inside a solenoid depends only on the number of turns per unit length and current, it is independent of the area (radius of solenoid) of the loops

Magnetic Field of a Toroid

A toroid is a ring shaped solenoid as shown below


Following figure shows a horizontal cross-section of the toroid.


What is the magnetic field inside a toroid?

We can find out by applying Ampere' s law. From symmetry we see that B forms concentric circles inside toroid.

Consider a circular Amperian loop of radius r inside the toroid .


If N is the total number of turns, the enclosed current MagneticField_due_to_Current_154.gif. According to Ampere's law


The magnetic field B inside the toroid at a distance r from the center of the toroid ring, will be given as