Vector Algebra
Every electric and magnetic field is a vector that lives at every point in space. Before we can describe a single field, we need a precise language of magnitude and direction — unit vectors, components, and the two products that quietly run all of electromagnetics.
- The difference between a scalar and a vector, and why fields demand vectors.
- How to write any vector with unit vectors and Cartesian components, and how to find its magnitude.
- The rules of vector addition, subtraction and scaling.
- Position and distance vectors — the backbone of every field calculation.
- The dot product (projection, work, flux) and the cross product (area, torque, the right-hand rule).
- The scalar and vector triple products and what each one measures.
Scalars & Vectors
A scalar is a quantity described completely by a single number (with its unit): temperature, mass, electric charge, time, or electric potential. A vector needs both a magnitude and a direction: force, velocity, and — at the heart of this course — the electric field \(\vec{E}\) and the magnetic field \(\vec{H}\).
In electromagnetics a field is a quantity defined at every point of a region. A scalar field, such as the potential \(V(x,y,z)\), assigns a number to each point; a vector field, such as \(\vec{E}(x,y,z)\), assigns an arrow — a magnitude and direction — to each point. Mastering the algebra of a single vector is the prerequisite for handling fields made of infinitely many of them.
We write a vector in boldface or with an arrow, \(\vec{A}\), and its magnitude as \(A = |\vec{A}|\). A vector of magnitude one is a unit vector, written \(\hat{a}\).
Any vector is its length \(A\) times a unit vector \(\hat{a}_A\) pointing the way. This single idea — peel off the magnitude, keep the direction — recurs throughout the course.
Unit Vectors & Components
In the Cartesian system, three mutually perpendicular unit vectors \(\hat{a}_x,\ \hat{a}_y,\ \hat{a}_z\) point along the \(x\), \(y\) and \(z\) axes. They form a right-handed set: curling the fingers of the right hand from \(\hat{a}_x\) to \(\hat{a}_y\) makes the thumb point along \(\hat{a}_z\). Any vector \(\vec{A}\) is the sum of its projections on these three axes:
The numbers \(A_x, A_y, A_z\) are the components (or scalar components) of \(\vec{A}\). Because the axes are perpendicular, the magnitude follows from the three-dimensional Pythagoras theorem, and the unit vector divides the whole thing by that length:
Vector Addition & Subtraction
Vectors add component by component. Geometrically this is the parallelogram (or head-to-tail) rule: place the tail of \(\vec{B}\) at the head of \(\vec{A}\), and the resultant \(\vec{C}\) runs from the start of \(\vec{A}\) to the end of \(\vec{B}\).
Addition is commutative (\(\vec{A}+\vec{B}=\vec{B}+\vec{A}\)) and associative. Multiplying by a scalar \(k\) scales every component, stretching the vector and — if \(k\) is negative — reversing it.
Position & Distance Vectors
The position vector \(\vec{r}_P\) of a point \(P(x,y,z)\) runs from the origin to \(P\):
The distance vector (or separation vector) from point \(P\) to point \(Q\) is the difference of their position vectors. It is the single most-used object in field theory: in Coulomb's law and the Biot–Savart law, the field at \(Q\) depends on the distance vector from the source at \(P\).
Subtract the source position from the field-point position, then normalise. Every "points away from the charge" or "perpendicular to the wire" statement later in the course is this formula in action.
The Dot Product
The dot (scalar) product multiplies two vectors to give a scalar. Geometrically it measures how much one vector lies along another — a projection:
Key consequences: the dot product is commutative; it is zero when the vectors are perpendicular (\(\cos 90^\circ = 0\)); and \(\vec{A}\cdot\vec{A} = |\vec{A}|^2\). For the base vectors, \(\hat{a}_x\cdot\hat{a}_x = 1\) and \(\hat{a}_x\cdot\hat{a}_y = 0\). In electromagnetics the dot product is how we compute work (\(\vec{F}\cdot\vec{L}\)) and flux (\(\vec{D}\cdot\vec{S}\)).
The Cross Product
The cross (vector) product multiplies two vectors to give a third vector, perpendicular to both, with magnitude equal to the area of the parallelogram they span:
The unit vector \(\hat{a}_n\) is fixed by the right-hand rule: point the fingers along \(\vec{A}\), curl them toward \(\vec{B}\), and the thumb gives \(\hat{a}_n\). In components the cross product is the determinant:
The cross product is anti-commutative: \(\vec{A}\times\vec{B} = -\,\vec{B}\times\vec{A}\). It is zero for parallel vectors, and \(\hat{a}_x\times\hat{a}_y = \hat{a}_z\) (cyclically). It powers the magnetic force \(\vec{F} = q\vec{v}\times\vec{B}\), torque, and the curl operator we meet in Chapter 3.
The Triple Products
Three vectors combine in two useful ways. The scalar triple product returns a number equal to the volume of the parallelepiped they span:
Its value is unchanged by cyclic rotation of the vectors: \(\vec{A}\cdot(\vec{B}\times\vec{C}) = \vec{B}\cdot(\vec{C}\times\vec{A}) = \vec{C}\cdot(\vec{A}\times\vec{B})\). The vector triple product returns a vector and is best remembered by the "bac–cab" rule:
Worked Examples
Problem. Given \(\vec{A} = 3\,\hat{a}_x - 4\,\hat{a}_y + \hat{a}_z\), find \(|\vec{A}|\) and the unit vector \(\hat{a}_A\).
Solution. Apply the magnitude formula, then divide:
Problem. Find the distance vector from \(P(1,2,3)\) to \(Q(4,0,5)\) and its length.
Solution. Subtract the position vectors component-wise:
Problem. Find the angle between \(\vec{A} = \hat{a}_x + \hat{a}_y\) and \(\vec{B} = \hat{a}_y + \hat{a}_z\).
Solution. Use \(\cos\theta = (\vec{A}\cdot\vec{B})/(|\vec{A}||\vec{B}|)\):
Problem. For \(\vec{A} = 2\,\hat{a}_x + \hat{a}_y\) and \(\vec{B} = \hat{a}_y + \hat{a}_z\), find \(\vec{A}\times\vec{B}\).
Solution. Expand the determinant:
Problem. Test whether \(\vec{A}=\hat{a}_x\), \(\vec{B}=\hat{a}_y\), \(\vec{C}=\hat{a}_x+\hat{a}_y\) are coplanar.
Solution. Coplanar vectors have zero scalar triple product:
Problem. Find the scalar projection of \(\vec{A} = 4\,\hat{a}_x + 3\,\hat{a}_y\) onto \(\vec{B} = \hat{a}_x\).
Solution. The projection of \(\vec{A}\) on \(\hat{a}_B\) is \(\vec{A}\cdot\hat{a}_B\):
Chapter Summary
A scalar has magnitude only; a vector has magnitude and direction. Fields assign one to every point in space.
\(\vec{A} = A_x\hat{a}_x + A_y\hat{a}_y + A_z\hat{a}_z\); magnitude \(\sqrt{A_x^2+A_y^2+A_z^2}\); \(\hat{a}_A = \vec{A}/|\vec{A}|\).
\(\vec{r}_{PQ}=\vec{r}_Q-\vec{r}_P\) — the workhorse of Coulomb's and Biot–Savart's laws.
\(\vec{A}\cdot\vec{B}=AB\cos\theta\); a scalar; zero when perpendicular; gives work and flux.
\(\vec{A}\times\vec{B}=AB\sin\theta\,\hat{a}_n\); a vector; right-hand rule; gives area, force, torque.
Scalar triple = volume (and coplanarity test); vector triple = bac–cab.
Problems
For each item, decide first which operation it tests — magnitude, projection, normal direction, or volume — then apply the matching rule. Difficulty rises down the list.
- Given \(\vec{A} = \hat{a}_x + 2\,\hat{a}_y - 2\,\hat{a}_z\), find \(|\vec{A}|\) and \(\hat{a}_A\).
- Find the position vector of \(P(2,-1,4)\) and its distance from the origin.
- For \(P(0,1,2)\) and \(Q(3,1,-1)\), write \(\vec{r}_{PQ}\) and the unit vector \(\hat{a}_{PQ}\).
- Compute \(\vec{A}\cdot\vec{B}\) and the angle between \(\vec{A}=2\,\hat{a}_x-\hat{a}_y\) and \(\vec{B}=\hat{a}_x+2\,\hat{a}_y\). What does the result tell you?
- Find a unit vector perpendicular to both \(\vec{A}=\hat{a}_x+\hat{a}_y\) and \(\vec{B}=\hat{a}_y+\hat{a}_z\).
- Find the area of the triangle with vertices \(P(0,0,0)\), \(Q(2,0,0)\), \(R(0,3,0)\) using a cross product.
- Resolve \(\vec{A}=3\,\hat{a}_x+4\,\hat{a}_y\) into components parallel and perpendicular to \(\vec{B}=\hat{a}_x\).
- Evaluate the scalar triple product of \(\vec{A}=\hat{a}_x\), \(\vec{B}=\hat{a}_x+\hat{a}_y\), \(\vec{C}=\hat{a}_x+\hat{a}_y+\hat{a}_z\) and interpret it as a volume.
- Verify the bac–cab identity for \(\vec{A}=\hat{a}_x\), \(\vec{B}=\hat{a}_y\), \(\vec{C}=\hat{a}_z\).
- Three forces \(\vec{F}_1=2\,\hat{a}_x\), \(\vec{F}_2=-\hat{a}_x+3\,\hat{a}_y\), \(\vec{F}_3=\hat{a}_y-\hat{a}_z\) act at a point. Find the resultant and its magnitude.
- Show that \(\vec{A}=\hat{a}_x+\hat{a}_y+\hat{a}_z\), \(\vec{B}=\hat{a}_x-\hat{a}_y\), \(\vec{C}=\hat{a}_x+\hat{a}_y-2\,\hat{a}_z\) are mutually perpendicular.
- Prove that \(|\vec{A}\times\vec{B}|^2 + (\vec{A}\cdot\vec{B})^2 = |\vec{A}|^2|\vec{B}|^2\) and explain it geometrically.