Finding $f$ from $\text{grad}f$

43 Views Asked by At

Find all functions $f: \mathbb{R}^n \mapsto \mathbb{R}$ such that $\text{grad}f = x$ for all $x \in \mathbb{R}^n$

My solution:

Integrating $\dfrac{\partial f}{\partial e_i} = x_i$ for $i=1,..n$ gives us $f(x_1,..,x_n) = \dfrac{x_1^2}{2}+...+\dfrac{x_n^2}{2} + C$ with $C \in \mathbb{R}$ constant.

And that's it. Did I miss something else?

1

There are 1 best solutions below

0
On BEST ANSWER

We want to find all $f : \mathbb{R}^n \to \mathbb{R}$ such that $\frac{\partial f}{\partial x_i} = x_i$ for $i = 1, \ldots, n.$

From $\frac{\partial f}{\partial x_1} = x_1$ we conclude that $f(x_1, \ldots, x_n) = \frac12 x_1^2 + C_1(x_2, \ldots, x_n)$ for some function $C_1 : \mathbb{R}^{n-1} \to \mathbb{R}.$ Since $f(x_1, \ldots, x_n)$ and $\frac12 x_1^2$ are both differentiable w.r.t. $x_2, \ldots, x_n$ we conclude that so is $C_1.$

Taking the derivative w.r.t. $x_2$ then gives $\frac{\partial f}{\partial x_2} = \frac{\partial C_1}{\partial x_2}.$ In the same way as for $x_1$ we can now conclude that $C_1(x_2, \ldots, x_n) = \frac12 x_2^2 + C_2(x_3, \ldots, x_n)$ for some differentiable function $C_3 : \mathbb{R}^{n-2} \to \mathbb{R}.$

Repeating the same argument we finally end up with $C_{n-1}(x_n) = \frac12 x_n^2 + C_n,$ where $C_n \in \mathbb{R}.$

Thus, $$f(x_1, \ldots, x_n) = \frac12 x_1^2 + C_1(x_2, \ldots, x_n) = \frac12 x_1^2 + \frac12 x_2^2 + C_2(x_3, \ldots, x_n) = \frac12 x_1^2 + \cdots + \frac12 x_n^2 + C_n, $$ where $C_n \in \mathbb{R}$ is a constant.