[Math] Solving for original function of gradient vector

calculusvector analysis

I have recently been puzzled by the following gradient vector and with calculating its parent function.

$$ \nabla f = <4y*sin(xy),4x*sin(xy)> $$

I don't see any clear way of producing the parent function $f(x,y)$ from this vector. Could anyone possibly provide insight into this problem?

Best Answer

The usual way to solve this type of problem, once you’ve verified that the vector field is in fact conservative, is to alternate integration and differentiation.

We want to find some scalar function $f$ such that $f_x=4y\sin(xy)$ and $f_y=4x\sin(xy)$, so start by integrating one of the components, say, the first one: $$f(x,y) = \int 4y\sin(xy)\,dx = -4\cos(xy)+g(y).\tag{1}$$ Notice that instead of being a simple constant as it would be for functions of one variable, the “constant” of integration is some unknown function that doesn’t depend on $x$. Now, differentiate the result with respect to $y$ and compare this to the corresponding component of the vector field: $${\partial\over\partial y}f(x,y)=4x\sin(xy)+g'(y)=4x\sin(xy).$$ This implies that $g'(y)=0$, so in this case the “constant” of integration in (1) really is just a constant and $f(x,y)=-4\cos(xy)+C$. Otherwise, we’d continue by integrating $g'(y)$ with respect to $y$ to get $f$. For functions of more than two variables, you would go back and forth like this, alternately integrating and differentiating with respect to each variable in turn.

It’s possible to find a scalar field $f$ all at once, too. Let $F(x,y)$ be the vector field and define $f(x,y)=\int_\Gamma F$, where $\Gamma$ is some smooth curve joining the origin to $(x,y)$. Since $F$ is conservative, the value of this integral depends only on the endpoints of $\Gamma$, so $f$ is well-defined. It’s easy to see that with this definition, $F=\nabla f$. To evaluate this integral, choose any convenient path, such as the line segment from the origin to $(x,y)$ parametrized by $\gamma:t\mapsto(tx,ty)$, $0\le t\le1$, which results in the ordinary integral $$f(x,y)=\int_0^1F(tx,ty)\cdot(x,y)\,dt.$$ For this problem, we have $$\begin{align} f(x,y)&=\int_0^14xyt\sin(xyt^2)+4xyt\sin(xyt^2)\,dt \\ &= 4\int_0^1 2xyt\sin(xyt^2)\,dt \\ &= -4\cos(xy)+4. \end{align}$$ This differs from the above result by a constant, which of course is arbitrary.