17. Divergence, Curl and Potentials
f. Scalar Potentials
Given a vector field \(\vec F\), a scalar potential for \(\vec F\) is any scalar field \(f\) whose gradient is \(\vec F\): \[ \vec\nabla f=\vec F \]
1. Finding Scalar Potentials
If you can find a scalar potential by inspection, that's great. If not then you will need to do some work.
Find a scalar potential for \(\vec F=\left\langle yz,xz,xy\right\rangle\).
We need to find a function \(f\) satisfying \(\vec\nabla f=\vec F\). In more detail, \(f\) must satisfy \[ \partial_x f=yz \qquad \partial_y f=xz \qquad \partial_z f=xy \] , we see that a function that works is \(f=xyz\).
"By inspection" is a nebulous term. It actually means we took
the \(x\)antiderivative of \(\partial_x f=yz\),
the \(y\)antiderivative of \(\partial_y f=xz\) and
the \(z\)antiderivative of \(\partial_z f=xy\)
and got \(f=xyz\) in all three cases.
Find a scalar potential for \(\vec F=\left\langle 2x,2y,2z\right\rangle\).
\(f=x^2+y^2+z^2\)
We need to find a function \(f\) satisfying \(\vec\nabla f=\vec F\), or \[ \partial_x f=2x \qquad \partial_y f=2y \qquad \partial_z f=2z \] By , we see that a function that works is \(f=x^2+y^2+z^2\).
Actually, we take
the \(x\)antiderivative of \(\partial_x f=2x\) to get
\(f(x,y,z)=x^2+g(y,z)\) where \(g\) is an arbitrary function
which is independent of \(x\),
the \(y\)antiderivative of \(\partial_y f=2y\) to get
\(f(x,y,z)=y^2+h(x,z)\) where \(h\) is an arbitrary function
which is independent of \(y\), and
the \(z\)antiderivative of \(\partial_z f=2z\) to get
\(f(x,y,z)=z^2+k(x,y)\) where \(k\) is an arbitrary function
which is independent of \(z\).
Then \(f=x^2+y^2+z^2\) works in all three cases.
Caution: The scalar potential is NOT always just the sum of the \(x\)antiderivative of \(F_1\), the \(y\)antiderivative of \(F_2\) and the \(z\)antiderivative of \(F_3\). A counter example happens in the next example and exercise which also show the process of finding all scalar potentials when inspection does not work.
Find all scalar potentials for: \[ \vec F =\left\langle \sin(y)\sin(x)+\cos(z),x\cos(y)+e^z+e^y, y\,e^zx\sin(z)+1\right\rangle \]
We need to find a function \(f\) satisfying \(\vec\nabla f=\vec F\) or: \[\begin{aligned} \partial_x f&=\sin(y)\sin(x)+\cos(z)\quad&&\text{(1)} \\ \partial_y f&=x\cos(y)+e^z+e^y\quad&&\text{(2)} \\ \partial_z f&=y\,e^zx\sin(z)+1\quad&&\text{(3)} \end{aligned}\] Since the scalar potential is not obvious by inspection, we solve these successively and build up a solution.

We first take the \(x\)antiderivative of (1) to get:
\[
f=x\sin(y)+\cos(x)+x\cos(z)+g(y,z)
\]
where \(g\) is an arbitrary function which is independent of \(x\).
(Note: When we take an antiderivative, we normally add a constant \(C\). However, since this is an \(x\)antiderivative, the "constant", \(g\), only needs to be constant in \(x\), i.e. a function of \(y\) and \(z\).) 
Now this function \(f\) must also satisfy (2) and (3). We first take its
\(y\)derivative:
\[
\partial_y f=x\cos(y)+\partial_y g
\]
Comparing this to (2) we find:
\[
\partial_y g=e^z+e^y
\]
We take the \(y\)antiderivative of this to get:
\[
g=y\,e^z+e^y+h(z)
\]
where \(h\) is an arbitrary function of \(z\).
(Note: Even though we are taking a \(y\)antiderivative, we don't allow \(h\) to be a function of \(x\) as well as \(z\), because we already know \(g\) must be independent of \(x\).)
Then we substitute this \(g\) into \(f\) to get: \[ f=x\sin(y)+\cos(x)+x\cos(z)+y\,e^z+e^y+h(z) \]  Finally, this function \(f\) must also satisfy (3). We take its \(z\)derivative: \[ \partial_z f=x\sin(z)+y\,e^z+\dfrac{dh}{dz} \] Comparing this to (3) we find: \[ \dfrac{dh}{dz}=1 \] So: \[ h=z+C \] where \(C\) is really constant. Substituting this back into \(f\), we find the most general scalar potential is: \[ f=x\sin(y)+\cos(x)+x\cos(z)+y\,e^z+e^y+z+C \]
Find all scalar potentials for: \[ \vec F=\left\langle 2xy^3+z^3,3x^2y^23y^2z,3xz^2+4z^3y^3\right\rangle \]
\(f=x^2y^3+xz^3y^3z+z^4+C\)
We need to find a function \(f\) satisfying \(\vec\nabla f=\vec F\), or: \[\begin{aligned} \partial_x f&=2xy^3+z^3\quad&&\text{(1)} \\ \partial_y f&=3x^2y^23y^2z\quad&&\text{(2)} \\ \partial_z f&=3xz^2+4z^3y^3\quad&&\text{(3)} \end{aligned}\] We solve these successively.
 We first take the \(x\)antiderivative of (1) to get: \[ f=x^2y^3+xz^3+g(y,z) \]
 Next, we take the \(y\)derivative of this: \[ \partial_y f=3x^2y^2+\partial_y g \] and compare it to (2) to get: \[ \partial_y g=3y^2z \] We take the \(y\)antiderivative of this to get: \[ g=y^3z+h(z) \] and substitute this \(g\) into \(f\) to get: \[ f=x^2y^3+xz^3y^3z+h(z) \]
 Finally, we take the \(z\)derivative: \[ \partial_z f=3xz^2y^3+\dfrac{dh}{dz} \] and compare it to (3) to get: \[ \dfrac{dh}{dz}=4z^3 \] So: \[ h=z^4+C \] Substituting this back into \(f\), we find the most general scalar potential is: \[ f=x^2y^3+xz^3y^3z+z^4+C \]
We check by computing the gradient of the scalar potential: \[\begin{aligned} \text{grad}f &=\vec\nabla(x^2y^3+xz^3y^3z+z^4) \\ &=\left\langle 2xy^3+z^3,3x^2y^23y^2z,3xz^2y^3+4z^3\right\rangle \end{aligned}\] which is the vector field we started with.
NonUniqueness of the Scalar Potential
The previous example and exercise demonstrate the following:
If \(f\) and \(g\) are both scalar potentials for a vector field \(\vec F\),
then \(f=g+C\) for some constant \(C\).
Since \(\vec F=\vec\nabla f=\vec\nabla g\), we have \(\vec\nabla(fg)=0\). So the \(x\), \(y\) and \(z\) partial derivatives of \(fg\) are all \(0\). This says \(fg\) must be a constant \(C\).
Heading
Placeholder text: Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum