Compute the line integral of
\[\mathbf{v}=(r\cos ^2 \theta )\hat{\mathbf{r}}-(r\cos \left( \theta \right) \sin \left( \theta \right) )\hat{\theta } +3r\hat{\phi } \]Around the path shown in Fig. 1.50 (the points are labeled by their Cartesian coordinates).
Do it either in cylindrical or in spherical coordinates.
Check your answer using Stokes' theorem.
Answer $3 \pi /2$
Here's a 3D render of Figure 1.50:
Let's first calculate the line integral
The line integral can be split into 4 separate parts:
From $D$ to $A$, from $A$ to $B$, from $B$ to $C$, and from $C$ to $D$. (As seen in the 3D render above).
The first 2 (from $D$ to $A$ and from $A$ to $B$) can be computed trivially in spherical coordiantes.
The last 2 (from $B$ to $C$ and from $C$ to $D$), although possible in spherical, are trivial if we consider the vector field $\mathbf{v} $ in cylindrical coordinates.
First line integral:
We have a path in the $\hat{r} $-direction, meaning that move at constant $\theta $ and $\phi $, that is:
\[d\theta =d\phi =0 \]Further, along this path this constant variables have the values
\[\theta =\frac{\pi }{2} \;\;\;\;\;\;\;\;\Big|\;\;\;\;\;\;\;\; \phi =0 \]The line integral is:
\begin{align*} \int \mathbf{v}\cdot d\mathbf{l} &= \int \mathbf{v}\cdot (dr,rd\theta ,r\sin \left( \theta \right) d\phi ) \\ &= \int_{r_1}^{r_2 } v_rdr\\ &= \int_{0}^{1} r\cos ^2 (\theta )dr\\ &= \cos ^2 (\theta )\int_{0}^{1} rdr \\ &= \cancel{\cos ^2 (\pi /2 )}\int_{0}^{1} rdr\\ &= 0\tag{Since $\cos \left( \pi /2 \right) =0 $} \end{align*}Second line integral:
We have a path in the $\hat{\phi } $-direction, meaning that move at constant $r $ and $\theta $, that is:
\[dr =d\theta =0 \]Further, along this path this constant variables have the values
\[r=1 \;\;\;\;\;\;\;\;\Big|\;\;\;\;\;\;\;\; \theta =\frac{\pi }{2} \]The line integral is:
\begin{align*} \int \mathbf{v}\cdot d\mathbf{l} &= \int \mathbf{v}\cdot (dr,rd\theta ,r\sin \left( \theta \right) d\phi ) \\ &= \int_{\phi _1 }^{\phi _2 } v_{\phi }(r\sin \left( \theta \right) )d\phi \\ &= \int_{0}^{\pi /2} 3r^2 \sin \theta d\phi \\ &= 3(1)^2 \sin (\pi /2)\int_{0}^{\pi /2} d\phi \\ &= 3 \left( \frac{\pi }{2}-0 \right) \\ &= \frac{3}{2}\pi \end{align*}The $\mathbf{v} $ field in cylindrical coordinates:
Read Prologue to 1.57: A brief discussion on conversions between spherical and cylidrical coordinates if you want to learn more details about this derivation.
\begin{align*} \mathbf{v} &= (r\cos ^2 \theta )\hat{\mathbf{r}}-(r\cos \left( \theta \right) \sin \left( \theta \right) )\hat{\theta } +3r\hat{\phi } \\ &= \sqrt{s^2 +z^2 }\frac{z^2 }{s^2 +z^2 }\hat{\mathbf{r}}-\sqrt{s^2 +z^2 }\frac{z}{\sqrt{s^2 +z^2 }}\sqrt{1-\frac{z^2 }{s^2 +z^2 }}\hat{\theta } +3\sqrt{s^2 +z^2 }\hat{\phi } \\ &= \frac{z^2 }{\sqrt{s^2 +z^2 }}\hat{\mathbf{r}}-z\sqrt{1-\frac{z^2 }{s^2 +z^2 }}\hat{\theta } +3\sqrt{s^2 +z^2 }\hat{\phi } \\ &= z\hat{z} + 3\sqrt{s^2 +z^2 }\hat{\phi } \end{align*}This is extremely enlightening! This tells us that the $\mathbf{v} $ will never point radially out of the $z $-field. (This is an example of how changing coordinate systems might reveal geometric details about our vector field).
Third line integral:
We are not moving on the $\hat{\phi } $-direction, only on the $z $-direction, so the integral is quite simple!
\[\int_{0}^{2} zdz=2 \]Fourth line integral:
Once again, the integral is simple since we are not moving on the $\hat{\phi } $-direction, but only on the $z $-direction.
\[\int_{2}^{0} zdz=-2 \]Line integral conclusions:
\begin{align*} \int \mathbf{v}\cdot d\mathbf{l} &= 0+\frac{3\pi }{2}+2-2 \\ &= \frac{3\pi }{2} \end{align*}Now that we computed all 4 segments of the path, we see that
Confirm result using Stokes' theorem:
Recall Stokes' theorem:
\[\int _{\mathcal{S}}(\nabla \times \mathbf{v})\cdot d\mathbf{a}=\oint _{\mathcal{P}}\mathbf{v}\cdot d\mathbf{l}\tag{Eq. 1.57, page 33}\]The curl of the field is (in spherical)
\[\nabla \times \mathbf{v}=3\cot \theta \hat{r} - 6 \hat{\theta } + 0 \hat{\phi } \]We can immediately tell that the surface integral over the triangular surface (on the $yz $-plane) is 0, since we don't have curl in the $\phi $-direction. For the surface integral on the $xy $-plane (the 1/4th of a circle) is given by:
\begin{align*} \int \begin{pmatrix} 3\cot \theta & -6 & 0 \\\end{pmatrix} \cdot d\mathbf{a} &= \int_{r=0}^{1} \int_{\theta =0}^{\pi /2} 6r\sin \left( \theta \right) d\theta dr \\ &= 6 \left( \frac{1}{2}-0 \right) \left( \frac{\pi }{2}-0 \right) \\ &= \frac{3\pi }{2} \end{align*}Agreeing with the line integral result.