Electricity & Magnetism

The notes on this page will largely follow the sequence presented in David Griffiths’ book Introduction to Electrodynamics (4e). Rather than reproducing all the material contained in the textbook (which can easily be found elsewhere), my goal with these notes is to clarify points that Griffiths either glosses over or assumes the reader is already familiar with. It’s far and away one of the best textbooks I’ve ever used, but there’s always room for an alternate angle or additional explanation!

Note: I’ll be gradually fleshing this page out as I help one of my students through a summer independent study of Griffiths, so it might be a little sparse at first. I appreciate your patience as I build this out. πŸ™‚

Chapter 1: Vector Analysis

1.1 Vector Algebra

Vectors are commonly written in one of two ways: as a magnitude times a direction, or as a sum of orthogonal components.

In the former case, the magnitude of the vector can be thought of as its ‘size’ or ‘length’, and is denoted using absolute value bars. (Indeed, the absolute value of a real or complex number simply tells us its magnitude, i.e. its distance from zero.) If the vector $\vec v$ is 5 units long from tail to head, we would write $|\vec v| = 5.$ Since the magnitude of a vector is an ordinary scalar, we’ll often opt for the more economical notation $v = 5,$ where the scalar $v$ is defined as $v \doteq |\vec v|.$

Meanwhile, the direction in question is represented by a unit vector, i.e. a vector with magnitude 1. Unit vectors are conventionally named using a single letter with a ‘hat’ over it; for example, the unit vector $\hat v$ would be read as “v hat”. The most commonly-used unit vectors are $\hat x, \hat y,$ and $\hat z,$ which (respectively) point in directions parallel to the positive $x$-, $y$-, and $z$-axes. Multiplying a vector by a scalar scales its magnitude by that factor; for example, the vector $3\hat x$ still points parallel to the positive $x$-axis, but it has a magnitude of 3 rather than 1. To obtain a unit vector that points in the direction of an arbitrary vector $\vec u,$ we can simply divide $\vec u$ by its magnitude: $$\hat u = {\vec u \over u}.$$

Multiplying both sides by $u,$ we arrive at the expression for an arbitrary vector $\vec u$ in terms of its (scalar) magnitude and (unit vector) direction: $$\vec u = u \cdot \hat u.$$

Further additions:

  • component notation, subscripts for components (not partial derivatives), using angle brackets for Cartesian basis
  • vector fields
  • vector operations (dot product with unit vector is projection, bullet vs cdot for dot product vs multiplication)

1.2 Differential Calculus

The symbol $\nabla$ represents the vector operator del: $$\nabla = \left\langle {\partial \over \partial x},\; {\partial \over \partial y}, \;{\partial \over \partial z}\right\rangle.$$ To use a more economical (if less standard) notation, this can also be written as $$\nabla = \left\langle \partial_x,\;\partial_y,\;\partial_z\right\rangle,$$ wherein $\partial_q$ denotes ${\partial \over \partial q}$ for an arbitrary coordinate $q.$

Although vector operators don’t have magnitudes and directions like ordinary vectors do, $\nabla$ can do just about anything a vector can do, including scalar multiplication, dot products, and cross products. Since taking derivatives of constants always gives us zero, using $\nabla$ on individual vectors like $\langle 2, -5, 6 \rangle$ isn’t all that interesting. Instead, we’ll be using it on scalar functions and vector fields, the latter of which are functions $\vec v(x,y,z)$ that assign a vector to every point in 3D space. (The official definition is much more general, but for E&M we’ll be almost exclusively interested in vector fields over $\mathbb{R}^3.)$

Acting on a scalar function $f$ with the operator $\nabla$ creates a vector function called theΒ gradient of $f$: $$\nabla f = \left\langle {\partial \over \partial x}, \;{\partial \over \partial y}, \;{\partial \over \partial z}\right\rangle f = \left\langle {\partial f \over \partial x}, \;{\partial f \over \partial y}, \;{\partial f \over \partial z}\right\rangle.$$ Like $f$ itself, $\nabla f$ takes the coordinates of a point in 3D space as its input. The output is a vector whose components are the partial derivatives of $f$ with respect to the three coordinate axes, whose direction indicates the direction of steepest increase for $f,$ and whose magnitude indicates the size of that increase. (In other words: the rate of change of $f,$ in the direction parallel to $\nabla f,$ is equal to $|\nabla f|.$)

(One comment on notation: a lot of people add subscripts to a function to denote its partial derivative with respect to that coordinate. For example, they might use $f_x$ to mean ${\partial f \over \partial x}.$ There’s nothing wrong with this notation, but since we’ll be working so much with vector functions in this course, and vector functions have components which are regularly denoted using subscripts, I’ll reserve the subscript notation $v_x$ to mean “the $x$-component of $\vec v$”, and use either ${\partial f \over \partial x}$ or $\partial_x f$ to mean “the derivative of $f$ with respect to $x$”.)

We can also calculate the rate of change of $f$ in the direction of an arbitrary unit vector $\hat u.$ This is called the directional derivative of $f$ (in the direction of $\hat u),$ and it is calculated as the dot product between the gradient and the direction vector: $$D_{\hat u}f = \nabla f \bullet \hat u.$$ According to the formula above for the magnitude of a dot product, we can also write this as $D_{\hat u}f = |\nabla f|\cos\alpha,$ where $\alpha$ is the angle between $\nabla f$ and $\hat u.$ (Since $\hat u$ is a unit vector, the standard factor of $|\hat u|$ simply multiplies the expression by $1.)$ Due to the range of output values for cosine, this shows us that the derivative of $f$ is largest when $\alpha = 0$ (i.e. when $\hat u$ points in the same direction as $\nabla f$), smallest when $\alpha = \pi$ (i.e. when $\hat u$ points opposite the direction of $\nabla f$), and zero when $\alpha = \tfrac\pi2$ (i.e. in any direction perpendicular to the direction of $\nabla f$).

Further additions:

  • divergence (net flow through a particular point, flow out minus flow in)
  • curl (both the magnitude and direction of the cross product are meaningful, which is a theme that will later resurface when we discuss surface integrals)
  • summary table of inputs and outputs for these different uses of del (e.g. gradient, input scalar function, output $\nabla f = \langle \partial_x f, \partial_y f, \partial_z f \rangle$ (vector) )

1.3 Integral Calculus

Further additions:

  • differential area comes from $d\vec{r} = {\partial \vec r \over \partial u}du + {\partial \vec r \over \partial v}dv$ (diagonal of a parallelogram expressed in terms of the legs, take the cross product of the legs to get area)

1.5 The Dirac Delta Function

The Dirac delta function is a generalised function $\delta(x)$ defined by the piecewise description $$\delta(x) = \begin{cases} 0 & x \ne 0 \\ \infty & x = 0\end{cases}$$ and by the integral $\int_{a}^b\delta(x)dx = 1$ for $a<0<b.$ (We call it a “generalised function” because it’s nonzero at a finite number of points but has a nonzero integral, which isn’t possible for ordinary functions.) The delta function can be pictured as an infinitely tall, infinitesimally thin spike with an area of $1$ square unit, centred at $x = 0.$ Any integral of $\delta(x)$ that captures the spike (i.e. whose interval includes $x = 0$) evaluates to $1,$ while any integral that doesn’t include the spike simply integrates the zero function, and hence evaluates to $0.$

For any function $f,$ we have $f(x)\delta(x) = f(0)\delta(x).$ This follows directly from the definition of $\delta(x)$: the only place where the product $f(x)\delta(x)$ is nonzero is at $x=0,$ so at every value of $x,$ the product $f(x)\delta(x)$ has the same value as the product $f(0)\delta(x).$

By using this fact under an integral that includes $x = 0,$ we obtain one of the main applications of delta functions: $$\int_a^b f(x)\delta(x)dx = \int_a^b f(0)\delta(x)dx = f(0)\int_a^b\delta(x)dx = f(0)\cdot 1 = f(0).$$ (Again, we must have $a<0<b$ in order to capture the spike; otherwise, the whole thing just evaluates to $0.$) This shows that multiplying a function by $\delta(x)$ under a spike-including integral “picks out” the value of the function at $x = 0.$ Note that this is a simple function evaluation β€” we don’t need to integrate anything!

For example, an integral without a delta function might look something like this: $$\begin{align*}\int_{-2}^3 (3x^2 +4x – 5)dx &= [x^3 + 2x^2 – 5x]_{-2}^3 \\ &= 3^3 + 2(3)^2 – 5(3) -\big((-2)^3 + 2(-2)^2 – 5(-2)\big)\\ &= 30 – 10 \\ &= 20.\end{align*}$$ On the other hand, integrating the same function over the same bounds with a delta function gives us something noticeably different (and usually much simpler): $$\begin{align*}\int_{-2}^3 (3x^2 +4x – 5)\delta(x)dx &= 3(0)^2 + 4(0) – 5 \\ &= -5.\end{align*}$$ Notice how the only relevant fact about the integration bounds was that they included $x = 0$ β€” we would have gotten the same result of $-5$ if we had integrated from $-10$ to $10,$ or from $-0.000003$ to $3{,}000{,}000.$

This raises a natural follow-up question: what if we want to use a delta function integral to pick out the value of $f(x)$ somewhere other than at $x = 0?$ What if we wanted to pick out $f(c)$ at some nonzero number $c?$

Further additions:

  • shifting the spike, connect to function transformations in general and explain why they work
  • equality of delta-style functions