Show that the line integral \[\begin{equation*} \int_{C}\mathbf{F}\,{\cdot}\, d\mathbf{r}=\int_{C}[(y\cos x+2xe^{y})\,dx+(\sin x+x^{2}e^{y}+4)\,dy] \end{equation*}\]
is independent of the path.
Find a potential function \(f\) for which \[\begin{equation*} \nabla\! \ f=(y\cos x+2xe^{y})\mathbf{i}+(\sin x+x^{2}e^{y}+4)\mathbf{j} \end{equation*}\]
Since \(P,\) \(\ Q,\) \(\ \dfrac{\partial P}{\partial y}\), and \(\dfrac{\partial Q }{\partial x}\) are continuous everywhere in the \(xy\)-plane, and since \(\dfrac{\partial P}{\partial y}=\dfrac{\partial Q}{\partial x}\), the vector field \(\mathbf{F}=\mathbf{F}(x,y)=(y\cos x+2xe^{y})\mathbf{i}+(\sin x+x^{2}e^{y}+4)\mathbf{j}\) is conservative and \(\int_{C}\mathbf{F}\,{\cdot}\, d\mathbf{r}\) is independent of the path.
(b) Since \(\mathbf{F}\) is a conservative vector field, there is a potential function \(f\) for \(\mathbf{F}\) for which \[\begin{equation*} \nabla\! \ f=\mathbf{F}=(y\cos x+2xe^{y})\mathbf{i}+(\sin x+x^{2}e^{y}+4)\mathbf{j} \end{equation*}\]
Since \(\nabla \! \ f=\dfrac{\partial f}{\partial x}\mathbf{i}+\dfrac{\partial f}{\partial y}\mathbf{j}\), \[\begin{equation*} \dfrac{\partial f}{\partial x}=y\cos x+2xe^{y}\qquad \hbox{and}\qquad \dfrac{\partial f}{\partial y}=\sin x+x^{2}e^{y}+4 \end{equation*}\]
We integrate the function on the right partially with respect to \(y.\) Then \[\begin{equation*} f(x,y)=\int ( \sin x+x^{2}e^{y}+4)\, dy=y\sin x+x^{2}e^{y}+4y+k(x) \end{equation*}\]
in which the “constant of integration,” \(k(x)\), is a function of \(x\). Now we differentiate \(f\) with respect to \(x\) to get \[\begin{equation*} \dfrac{\partial f}{\partial x}=y\cos x+2xe^{y}+k' (x) \end{equation*}\]
But \(\dfrac{\partial f}{\partial x}=y\cos x+2xe^{y}.\) So, \[\begin{eqnarray*} y\cos x+2xe^{y}&=& y\cos x+2xe^{y}+k' (x) \\[4pt] k' (x)& =&0 \end{eqnarray*}\]
1000
Then \[ k(x)=K\qquad \hbox{where \(K\) is a constant} \]
Therefore, \[ f(x,y)=y\sin x+x^{2}e^{y}+4y+K \]
is a potential function for \(\mathbf{F}\).