where $\mathbf{x} \in \mathbb{R}^n$, $\mathbf{p}: \mathbb{R}^n \to \mathbb{R}^n$ and $u:\mathbb{R}^n \to \mathbb{R}$. Assume $\mathbf{p}$ and $u$ are convex and defined and differentiable for all $\mathbb{R}^n > \mathbf{0}$.

I would like to show that $\mathbf{p}(\mathbf{x})$ is the gradient of some function $B: \mathbb{R}^n \to \mathbb{R}$, although I don't necessarily need to know the form of the function. What I really need to do is calculate $B(\mathbf{x_1})-B(\mathbf{x_0})$ for arbitrary values of $\mathbf{x_1}$ and $\mathbf{x_0}$.

I can already calculate $\mathbf{p}(\mathbf{x})$ as needed, and if I can show that it is a valid gradient, I think the gradient theorem says that $B(\mathbf{x_1})-B(\mathbf{x_0})$ = $\int^\mathbf{x_1}_\mathbf{x_0}{\mathbf{p}(\mathbf{x}) \cdot d\mathbf{x}}$, which I can calculate numerically. However, if $\mathbf{p}(\mathbf{x})$ is not a valid gradient of any function, then the line integral is path-dependent and $B$ is ill-defined.

So my question is, is it possible to show that $\mathbf{p}(\mathbf{x})$ as defined here is a valid gradient? Or are there conditions that I could apply to guarantee that it is? I've spent a couple of days trying out variations on the chain rule, substituting terms, etc., but haven't made much headway.

  • $\begingroup$ Is $u$, perhaps, homogeneous? Then by Euler's theorem $\nabla u \cdot \mathbf{x} = k u$ ($k$ is the degree of $u$), and then $\mathbf{p} = \nabla\left(\frac{1}{ku}\right)$. $\endgroup$ – Matthew Leingang Mar 14 '17 at 11:45

$\newcommand{\dd}{\partial}\newcommand{\Del}{\nabla}\newcommand{\Vec}[1]{\mathbf{#1}}$Denoting the component functions of $\Vec{p}$ by $(p_{1}, \dots, p_{n})$, and assuming the function $u$ is of class $C^{2}$, the necessary integrability condition $$ \frac{\dd p_{j}}{\dd x_{i}} = \frac{\dd p_{i}}{\dd x_{j}}\quad\text{for all $i$, $j$,} \tag{*} $$ encodes equality of mixed partial derivatives for the (prospective) potential function $B$ of $\Vec{p}$. If the domain of $u$ is simply-connected, this integrability condition is also sufficient. (In three variables, this is the "vanishing curl" condition $\Del \times \Vec{p} = 0$.)

In your situation (omitting dependence of the gradient on $\Vec{x}$ out of laziness), $$ p_{i} = \frac{1}{(\Del u \cdot \Vec{x})}\, \frac{\dd u}{\dd x_{i}}. $$ Consequently, \begin{align*} \frac{\dd p_{i}}{\dd x_{j}} &= \frac{1}{(\Del u \cdot \Vec{x})}\, \frac{\dd^{2} u}{\dd x_{j}\, \dd x_{i}} - \frac{1}{(\Del u \cdot \Vec{x})^{2}}\, \frac{\dd u}{\dd x_{i}} \, \frac{\dd}{\dd x_{j}}(\Del u \cdot \Vec{x}) \\ % &= \frac{1}{(\Del u \cdot \Vec{x})}\, \frac{\dd^{2} u}{\dd x_{j}\, \dd x_{i}} - \frac{1}{(\Del u \cdot \Vec{x})^{2}}\, \frac{\dd u}{\dd x_{i}} \left[\frac{\dd u}{\dd x_{j}} + \Del\left(\frac{\dd u}{\dd x_{j}}\right) \cdot \Vec{x}\right] \\ % &= \frac{1}{(\Del u \cdot \Vec{x})}\, \frac{\dd^{2} u}{\dd x_{j}\, \dd x_{i}} - \frac{1}{(\Del u \cdot \Vec{x})^{2}}\, \frac{\dd u}{\dd x_{i}} \left[\frac{\dd u}{\dd x_{j}} + \sum_{k} x_{k} \frac{\dd^{2} u}{\dd x_{k}\, \dd x_{j}}\right]. \end{align*} That is, $\Vec{p}$ is a gradient field if and only if $$ \frac{\dd u}{\dd x_{i}} \sum_{k} x_{k}\, \frac{\dd^{2} u}{\dd x_{k}\, \dd x_{j}} = \frac{\dd u}{\dd x_{j}} \sum_{k} x_{k}\, \frac{\dd^{2} u}{\dd x_{k}\, \dd x_{i}}\quad\text{for all $i$, $j$,} $$ if and only if $$ \sum_{k} x_{k} \left[\frac{\dd u}{\dd x_{i}}\, \frac{\dd^{2} u}{\dd x_{k}\, \dd x_{j}} - \frac{\dd u}{\dd x_{j}}\, \frac{\dd^{2} u}{\dd x_{k}\, \dd x_{i}}\right] = 0\quad\text{for all $i$, $j$.} \tag{**} $$

Equation (*) does not generally hold for your $\Vec{p}$. For instance, if $u(x, y) = x + y^{2}$, then $\Del u = (1, 2y)$ and $\Del u \cdot \Vec{x} = x + 2y^{2}$, so $$ \Vec{p} = \frac{(1, 2y)}{x + 2y^{2}};\qquad p_{1} = \frac{1}{x + 2y^{2}},\quad p_{2} = \frac{2y}{x + 2y^{2}}. $$ A short computation gives $$ \frac{\dd p_{1}}{\dd y} = -\frac{4y}{(x + 2y^{2})^{2}} \neq -\frac{2y}{(x + 2y^{2})^{2}} = \frac{\dd p_{2}}{\dd x}. $$

In any event, and (*) or (**) is easier to check than the integral condition you've been considering.

  • $\begingroup$ The algebra might be simplified if we use the identity $\nabla\times(f\vec{G}) = \nabla f \times \vec{G} + f\nabla\times\vec{G}$. Since $\vec{G}$ is a gradient, the second term vanishes. $\endgroup$ – Amey Joshi Mar 14 '17 at 16:12
  • $\begingroup$ Thanks, this is tremendously helpful! But I don't quite see how the equation before (**) follows from the one before that. Am I missing something obvious? $\endgroup$ – Matthias Fripp Mar 14 '17 at 18:57
  • $\begingroup$ @mfripp: The display above the equation you ask about gives an expression for $\frac{\dd p_{i}}{\dd x_{j}}$. Swap $i$ and $j$ to get $\frac{\dd p_{j}}{\dd x_{i}}$, equate using (*), and cancel the terms that are obviously invariant under exchanging $i$ and $j$: the second partial, and the product of the two first partials divided by $(\Del u \cdot \Vec{x})^{2}$. $\endgroup$ – Andrew D. Hwang Mar 14 '17 at 19:12
  • $\begingroup$ @AmeyJoshi: Formally yes, though strictly the curl is only defined when $n = 3$. $\endgroup$ – Andrew D. Hwang Mar 14 '17 at 19:14
  • $\begingroup$ @AndrewD.Hwang: I think I understand now. At first I assumed that (**) somehow led to (*), but now I see that you are starting with (*) and then deriving (**). So in general, with a simply connected domain, is equation (*) a necessary and sufficient condition for integrability (i.e., it's true for any gradient field)? Does that rule have a name? I didn't come across it anywhere previously. $\endgroup$ – Matthias Fripp Mar 15 '17 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.