Part 17 - Gradient theorem

Introduction

In this part we’ll cover the fundamental theorem of line integrals (also called Gradient theorem).

Definition

Recall the fundamental theorem of calculus:

abf(x) dx=f(b)f(a)\int_a^b f^\prime(x)\ dx = f(b) - f(a)

For line integrals: Let f:DR2Rf: D \subset \mathbb{R}^2 \rarr \mathbb{R}

Let C=DC = D be parameterized as r(t)\vec{r}(t), for atba \leq t \leq b.

Cfdr=f(r(b))f(r(a))\boxed{\int_C \nabla f \cdot dr = f(\vec{r}(b)) - f(\vec{r}(a))}

Notice how this doesn’t depend on the actual curve, but only of the start and endpoint.

Additionally, if we assume that CC is closed, meaning the curve starts and ends at the same point:

Cdr=0\int_C \nabla \cdot dr = 0

Theorem

Let DR2D \subset \mathbb{R}^2 be open (every point in DD has a small disc around it, which contains DD), connected (consists of one single “piece”).

Let F:DR2F: D \rarr \mathbb{R}^2 be a vector field. Then FF is conservative (there exists a ff such that f=F\nabla f = F), if and only if:

CFdr=0  for every closed curve CD\int_C F \cdot dr = 0 \ | \ \text{for every closed curve } C \subset D

Proposition

NB: This only applies for R2\mathbb{R}^2.

Suppose F(x,y)=P(x,y)i+Q(x,y)jF(x, y) = P(x, y) \vec{i} + Q(x, y) \vec{j} is a conservative field. Then:

Py=Qx\dfrac{\partial P}{\partial y} = \dfrac{\partial Q}{\partial x}

Proof

If FF is conservative, then there is a function, f:DR2R2f: D \subset \mathbb{R}^2 \rarr \mathbb{R}^2 such that f=F\nabla f = F. In other words, fx=Pf_x = P and fy=Qf_y = Q.

Py=Py=y(fx)=2fyx=2fxy=x(fy)=Py=Qx\begin{align*} P_y & = \dfrac{\partial P}{\partial y} \newline & = \dfrac{\partial}{\partial y} \left(\dfrac{\partial f}{\partial x} \right) \newline & = \dfrac{\partial^2 f}{\partial y \partial x} \newline & = \dfrac{\partial^2 f}{\partial x \partial y} \newline & = \dfrac{\partial}{\partial x} \left(\dfrac{\partial f}{\partial y} \right) \newline & = \dfrac{\partial P}{\partial y} \newline & = \boxed{Q_x} \end{align*}

Remark

If given a field, F=Pi+QjF = P \vec{i} + Q\vec{j} and if it is conservative, you can check Py=QxP_y = Q_x, if this is not the case, this means that FF is not conservative.

Definition

DR2D \subset \mathbb{R}^2 is called simply connected if no “holes” exists.

Theorem

Suppose DR2D \subset \mathbb{R}^2 is open, connected and simply connected. If F:DR2F: D \rarr \mathbb{R}^2 is a vector field, F=Pi+QjF = P\vec{i} + Q\vec{j} and Py=QxP_y = Q_x, then FF is conservative.

Let’s now do a bunch of examples to understand all of this theory.

Example

Determine if the following vector fields are conservative:

F(x,y)=(xy)i+(x2)jF(x,y)=(3+2xy)i+(x23y2)jF(x, y) = (x - y)\vec{i} + (x - 2)\vec{j} \newline F(x, y) = (3 + 2xy)\vec{i} + (x^2 - 3y^2)\vec{j} \newline

As we can see, both of these have the domain D=R2D = \mathbb{R}^2. Which means:

In the first case:

Py=1Qx=1P_y = -1 Q_x = 1

Which means this is not a conservative vector field.

In the second case:

Py=2xQx=2xP_y = 2x Q_x = 2x

Which means this is a conservative vector field.

Example

F(x,y)=(3+2xy)i+(x23y2)jF(x, y) = (3 + 2xy)\vec{i} + (x^2 - 3y^2)\vec{j} is conservative. Find a potential for it. (Find ff, such that f=F\nabla f = F).

Let, f:R2Rf: \mathbb{R}^2 \rarr \mathbb{R} be a function with f=F\nabla f = F.

Therefore:

fx=3+2xyfy=x23y2f_x = 3 + 2xy \newline f_y = x^2 - 3y^2 \newline

We generally will use this approach (this doesn’t always work but, it’s a good strategy):

Integrate one of these with respect to “their” variable:

f(x,y)=fx(x,y) dx=3+2xy=3x+x2y+g(y)f(x, y) = \int f_x(x, y)\ dx = \int 3 + 2xy = 3x + x^2y + g(y)

Notice the g(y)g(y), since we can a function depending on y if we differentiate with respect to xx.

Let’s now differentiate this with respect to the other variable:

fy(x,y)=0+x2+g(y)f_y(x, y) = 0 + x^2 + g^\prime(y)

Now we have two equations for fyf_y:

x23y2=x2+g(y)g(y)=3y2g(y)=y3+Cx^2 - 3y^2 = x^2 + g^\prime(y) \newline g^\prime(y) = -3y^2 \newline g(y) = -y^3 + C

Which means:

f(x,y)=3x+x2yy3+Cf(x, y) = 3x + x^2y -y^3 + C

Let’s do the other way around as well:

f(x,y)=fy(x,y) dy=x23y2=x2yy3+g(x)f(x, y) = \int f_y(x, y)\ dy = \int x^2 - 3y^2 = x^2y - y^3 + g(x) fx(x,y)=2xy+g(x)f_x(x, y) = 2xy + g^\prime(x) 3+2xy=2xy+g(x)g(x)=3g(x)=3x+C3 + 2xy = 2xy + g^\prime(x) \newline g^\prime(x) = 3 \newline g(x) = 3x + C f(x,y)=x2yy3+3x+C  same!f(x, y) = x^2y - y^3 + 3x + C \ | \ \text{same!}

Example

Evaluate CFdr\int_C F \cdot dr where, F(x,y)=(3+2xy)i+(x23y2)jF(x, y) = (3 + 2xy)\vec{i} + (x^2 - 3y^2)\vec{j} and C=r(t)=(etsin(t))i+(etcos(t))jC = \vec{r}(t) = (e^t sin(t))\vec{i} + (e^t cos(t))\vec{j}.

For 0tπ0 \leq t \leq \pi.

Since we already now that FF is conservative, which means there exists a f=F\nabla f = F, which we calculated in the last question, since the domain of the potential is R2\mathbb{R}^2 as well, we can use the fundamental theorem of line integrals!

CFdr=Cfdr=f(r(π))f(r(0))\int_C F \cdot dr = \int_C \nabla f \cdot dr = f(\vec{r}(\pi)) - f(\vec{r}(0))

Remember that:

f(x,y)=x2yy3+3x+Cf(x, y) = x^2y - y^3 + 3x + C

Let’s calculate the start and end point:

r(0)=0,1r(π)=0,eπ\vec{r}(0) = \langle 0, 1 \rangle \newline \vec{r}(\pi) = \langle 0, -e^{\pi} \rangle \newline f(0,1)=1+Cf(0,eπ)=(eπ)3+C=e3π+Cf(0, 1) = -1 + C f(0, -e^{\pi}) = -(-e^{\pi})^3 + C = e^{3\pi} + C

Which means:

CFdr=(e3π+C)(1+C)=e3π+1\int_C F \cdot dr = (e^{3\pi} + C) - (-1 + C) = \boxed{e^{3\pi} + 1}

Conservation of energy

(This is just a motivation of the name, nothing really important, but I found it cool so).

Suppose FF is a force field, suppose that it moves an object with mass, mm, along a curve CC, paramterized as r(t)\vec{r}(t) for atba \leq t \leq b. According to Newtons second law of motion:

F=maF = ma

We can write this as:

F(r(t))=mr(t)F(\vec{r}(t)) = m \vec{r^{\prime\prime}}(t)

The work done by the force field:

W=CFdr=abF(r(t))r(t) dtW = \int_C F \cdot dr = \int_a^b F(\vec{r^\prime}(t)) \cdot \vec{r^\prime}(t)\ dt

Using Newtons second law of motion:

abmr(t)r(t) dt=mabr(t)r(t) dt\int_a^b m \vec{r^{\prime\prime}}(t) \cdot \vec{r^\prime}(t)\ dt = m \int_a^b \vec{r^{\prime\prime}}(t) \cdot \vec{r^\prime}(t)\ dt m2abddtr(t)2 dt\dfrac{m}{2} \int_a^b \dfrac{d}{dt} \left| \vec{r^\prime}(t) \right|^2\ dt m2(r(b)2r(a)2) dt\dfrac{m}{2} \left( \left| \vec{r^\prime}(b) \right|^2 - \left| \vec{r^\prime}(a) \right|^2 \right)\ dt m2(v(b)2v(a)2) dt\dfrac{m}{2} \left( \left| \vec{v}(b) \right|^2 - \left| \vec{v}(a) \right|^2 \right)\ dt

Using that KE=mv22K_E = \dfrac{mv^2}{2}:

KE(b)KE(a)K_E(b) - K_E(a)

Suppose now that f=F\nabla f = F. The potential energy of the object is PE(t)=f(r(t))P_E(t) = -f(\vec{r}(t))

W=CFdr=CPdr=(PE(b)PE(a))W = \int_C F \cdot dr = \int_C - \nabla P \cdot dr = -(P_E(b) - P_E(a))

Which means:

KE(b)KE(a)=(PE(b)PE(a))K_E(b) - K_E(a) = -(P_E(b) - P_E(a)) KE(b)+PE(b)=KE(a)+PE(a)\boxed{K_E(b) + P_E(b) = K_E(a) + P_E(a)}

Which is the law of conservation of energy!