If it is known that \[\begin{equation*} \mathbf{F}=\mathbf{F}(x,y)=(6xy+y^{3})\mathbf{i}+(3x^{2}+3xy^{2})\mathbf{j} \end{equation*}\]
is a conservative vector field, find a potential function \(f\) for \(\mathbf{F}\).
Let \[ P(x,y)=6xy+y^{3}\qquad \hbox{and}\qquad Q(x,y)=3x^{2}+3xy^{2} \]
Since \[ \nabla\! \ f=\dfrac{\partial f}{\partial x}\mathbf{i}+\dfrac{\partial f}{ \partial y}\mathbf{j}=P(x,y)\mathbf{i}+Q(x,y)\mathbf{j} \]
we have \[\begin{eqnarray*} \dfrac{\partial f}{\partial x}=6xy+y^{3}\qquad \hbox{and}\qquad \dfrac{\partial f}{\partial y}=3x^{2}+3xy^{2}\tag{1} \end{eqnarray*}\]
Now integrate the left equation partially with respect to \(x\). \[ f(x,y) =\int ( 6xy+y^{3})\, dx=3x^{2}y+xy^{3}+h(y) \]
where the “constant of integration,” \(h(y)\), is a function of \(y\).
Next differentiate \(f\) with respect to \(y\): \[\begin{equation*} \dfrac{\partial f}{\partial y}=3x^{2}+3xy^{2}+h' (y) \end{equation*}\]
From (1), we have \[\begin{equation*} \dfrac{\partial f}{\partial y}=3x^{2}+3xy^{2} \end{equation*}\]
So, \(h' (y)=0\) or \(h(y) =K,\) where \(K\) is a constant. A potential function \(f\) for \(\mathbf{F}\) is \[ f(x,y)=3x^{2}y+xy^{3}+K \]