Divergence of a Function in $\mathbb{R}^n$

100 Views Asked by At

I need to find the divergence of $f^2(x)x$, where I assume that $x \in \mathbb{R}^n$. I have been given the solution, I just cannot remember how to complete this calculation: enter image description here I know that one takes the divergence of a vector field. Does this mean that $f^2(x)x$ is a vector field for which every component is of the form $f^2(x_i)x_i$. For exmaple, if $n=2$, would we have the vector field $F(x,y) = (f^2(x)x,f^2(y)y)$?

Also, how does one calculate this - I tried to calculate the derivative with respect to each component $x_i$ and then sum over $n$:

$$ \partial_{x_i} = 2f(x)\frac{\partial x}{\partial_{x_i}} x + f^2(x)\frac{\partial x}{\partial_{x_i}} $$

Then summing over all derivatives gives:

$$ \sum_{i=1}^n 2f(x)\frac{\partial x}{\partial_{x_i}} x + \sum_{i=1}^nf^2(x)\frac{\partial x}{\partial_{x_i}} = 2f(x) x \nabla x + f^2(x) \nabla x $$

However, this is clearly wrong.

1

There are 1 best solutions below

0
On

Denote the vector $\mathbf{u}=f^2 \mathbf{x}$ where I omit the dependence of $f$ on $\mathbf{x}$.

The differential writes $d\mathbf{u} = 2f (df) \mathbf{x} + f^2 d\mathbf{x}$ where $df =(\nabla_\mathbf{x}f)^T d\mathbf{x}$

The Jacobian writes $\frac{\partial \mathbf{u}}{\partial \mathbf{x}}= 2f\ \mathbf{x}(\nabla_\mathbf{x}f)^T + f^2 \ \mathbf{I}$ and the divergence of $\mathbf{u}$ is the trace of this matrix $$ \mathrm{div}(\mathbf{u}) = 2f \ \mathbf{x}^T(\nabla_\mathbf{x}f)+ n\ f^2 $$