Line integrals

Recall

A vector field is a function that takes in a vector and spits out a vector, and a scalar field is a function that takes in a vector and spits out a scalar.

Over a scalar field

Say we have some scalar field f:R3Rf : \mathbb R^3 \to \mathbb R and some curve CC parametrized by r(t):[a,b]R3\mathbf r(t) : [a,b] \to \mathbb R^3. We want to integrate ff along CC:

Cfds\int_C f d \mathbf s

Since the curve is parametrized by r\mathbf r, we can write an equivalent integral:

abf(r(t))dr\int_a^b f(\mathbf r(t)) d\mathbf r

Where drd\mathbf r is the length of a differential slice of the curve. We can calculate this length as dr=r(t)dtd\mathbf r = \lVert \mathbf r'(t) \rVert dt. This gives us the general equation for a line integral over a scalar field:

Cfds=abf(r(t))r(t)dt\int_C f ds = \int_a^b f(\mathbf r(t)) \lVert \mathbf r'(t) \rVert dt
Recall

If r(t)=(x(t)y(t)z(t))\mathbf r(t) = \begin{pmatrix}x(t)\\y(t)\\z(t)\end{pmatrix}, r(t)=(x)2+(y)2+(z)2\lVert \mathbf r'(t) \rVert = \sqrt {(x')^2 + (y')^2 + (z')^2}

Over a vector field

Say we have some vector field F=(P,Q,R)\mathbf F = (P, Q, R) and a curve CC parametrized by r:[a,b]R3\mathbf r : [a,b] \to \mathbb R^3. We want to integrate the dot product of F\mathbf F along CC (both of these forms mean the same thing):

CFdr=CPdx+Qdy+Rdz\int_C \mathbf F \cdot d\mathbf r = \int_C Pdx + Qdy + Rdz

drd\mathbf r is the differential change in position along the curve. Note that in this case it is a vector, simply r(t)dt\mathbf r'(t) dt. This gives us the final equation:

CFdr=abF(r(t))(x(t)y(t)z(t))dt\int_C \mathbf F \cdot d\mathbf r = \int_a^b \mathbf F(\mathbf r(t)) \cdot \begin{pmatrix} x'(t)\\y'(t)\\z'(t) \end{pmatrix} dt

In general, you can follow these steps to compute a line integral over a vector field:

  1. Choose a parametrization r(t)=(x,y,z),t[a,b]\mathbf r(t) = (x,y,z), t \in [a,b].

  2. Substitute x,y,zx, y, z in the integrand (F)(\mathbf F).

  3. Also substitute dx=xdtdx = x' dt, dy=ydtdy = y' dt, dz=zdtdz = z' dt and ds=rdtds = \lVert r' \rVert dt, dr=rdtd\mathbf r = \mathbf r' dt.

  4. The result will be a single variable integral that you can compute directly.

Fundamental theorem of calculus

Let’s say we have a curve CC that goes from points A\mathbf A to B\mathbf B, and a scalar function f:R3Rf : \mathbb R^3 \to \mathbb R. Then the fundamental theorem of calculus says:

Cfdr=f(B)f(A) \int_C \nabla f \cdot d\mathbf r = f(\mathbf B) - f(\mathbf A)
Proof

Let r:[a,b]R3\mathbf r : [a,b] \to \mathbb R^3 parametrize CC.

Cfdr=abf(r(t))r(t)dt \int_C \nabla f \cdot d\mathbf r = \int_a^b \nabla f(\mathbf r(t)) \cdot \mathbf r'(t) dt

Let G(t)=f(r(t))G(t) = f(\mathbf r(t)). By the chain rule, G(t)=Dfr(t)Dr(t)G'(t) = Df_{\mathbf r(t)} \cdot D\mathbf r(t). (where DgD\mathbf g is the total derivative or Jacobian matrix of gg)