# Simplifying $\nabla[ \phi( \parallel \mathbf{x} - \mathbf{\xi}_i \parallel ) ]$

I'd appreciate help simplifying the relationship $$\nabla\left[ \; \phi(\parallel \mathbf{x} - \mathbf{\xi}_i \parallel) \; \right]$$

for $\mathbf{x}$ and $\mathbf{\xi}_i$ in $\mathcal{R}^n$. This is how far I've come (I'm not even sure if I'm on the right track)

Setting $\mathbf{u} = \parallel \mathbf{x} - \mathbf{\xi}_i \parallel$, so that $$\nabla[ \phi(\mathbf{u}) ] = \left( \frac{\partial \phi}{\partial u_1} , \cdots , \frac{\partial \phi}{\partial u_n} \right)$$

but

$$\frac{\partial \phi}{\partial u_j} = \frac{\partial \phi}{\partial u_j} \frac{\partial u_j}{\partial \mathbf{x}} + \frac{\partial \phi}{\partial u_j} \frac{\partial u_j}{\partial \mathbf{\xi}_i}$$

for $j = 1 , \cdots , n$

Note: this question is related to a previous one

Edit: Your answers are correct, and I will tag them as such, but they aren't the answers I was hoping for. In my previous question, I required help proving a relationship between involving $\mathbf{x}$ and $\mathbf{\xi}$, from page 14 of these lecture slides. What I am now trying to understand is why $\phi$ is differentiated with respect to $\xi$ in the first place i.e. $\frac{\partial \phi}{\partial \xi}$. The problem I'm working on is in the area of Hermite interpolation. For example, on page 4 (column 1) of the paper Hermite variational implicit surface reconstruction it is shown that

$$\frac{\partial}{\partial f} \mathbf{n}_i^T \nabla f(\mathbf{\xi}_i) = \mathbf{n}_i^T \nabla k(\mathbf{x} , \mathbf{\xi}_i)$$

In the past I assumed that the components of the gradient of $\nabla f(\mathbf{\xi}_i)$ and $\nabla k(\mathbf{x} , \mathbf{\xi}_i)$ were differentials of $f(\mathbf{\xi}_i)$ and $k(\mathbf{x} , \mathbf{\xi}_i)$ with respect to $x_i$. However the lecture slides and the paper suggest that the terms of the gradient are differentials with respect to $\xi_i$. What I really would like to know is why.

-
What is the variable here? Are we talking about a function $f({\bf x}):=\phi(\|{\bf x}-\xi\|)$ with $\xi$ fixed, about a function $g(\xi):=\phi(\|{\bf x}-\xi\|)$ with ${\bf x}$ fixed, or about a function defined in ${\mathbb R}^n \times {\mathbb R}^n$? – Christian Blatter Jun 9 '11 at 11:06
$\mathbf{\xi}$ is fixed, so that $\phi( \parallel \mathbf{x} - \mathbf{\xi} \parallel )$ is defined in $\mathcal{R}^n$ – Olumide Jun 9 '11 at 11:17

For the function $\rho({\bf x}):=\|{\bf x}\|$ one has ${\partial \rho\over\partial x_i}={x_i\over \|{\bf x}\|}$ $\ (1\leq i\leq n)$, or $$\nabla \rho({\bf x})={{\bf x}\over \|{\bf x}\|}\ .\qquad(1)$$ Consider now the function $$f({\bf x}):=\phi(\|{\bf x}-\xi\|)=\phi\bigl(\rho({\bf x}-\xi)\bigr)\qquad(2)$$ where $\xi$ is fixed and $\phi:\ {\mathbb R_{\geq0}}\to{\mathbb R}$ is some scalar function of a real variable $r$. Then by the one-variable chain rule and (1) one has $${\partial f\over\partial x_i}=\phi'\bigl(\rho({\bf x}-\xi)\bigr)\ {\partial \rho({\bf x}-\xi)\over\partial x_i} =\phi'(\|{\bf x}-\xi\|){x_i-\xi_i \over \|{\bf x}-\xi\|}\qquad(1\leq i\leq n)\ .$$ These $n$ scalar equations can be summarized to $$\nabla f({\bf x})=\phi'(\|{\bf x}-\xi\|){{\bf x}-\xi \over \|{\bf x}-\xi\|}\ .\qquad(3)$$ If one is sufficiently fluent with multidimensional calculus one can of course omit the use of coordinates altogether and pass directly from (2) to (3), using (1).

-
Thanks. Quick question, just to make things really clear, with respect to what variable is $\phi$ differentiated in $\phi^\prime$? – Olumide Jun 9 '11 at 13:48
Got it. The differentiation is wrt $\rho$. – Olumide Jun 9 '11 at 14:11

Since $||\mathbf{x} - \xi_i||$ is a scalar, you simply set $u=||\mathbf{x} - \xi_i||$ and then you have

$$\nabla \phi(u) = \phi'(u) \nabla u$$

and, noting that $u^2=||\mathbf{x}-\xi_i||^2$ you can deduce $\nabla u = (\mathbf{x}-\xi_i)/u$, and hence

$$\nabla \phi(||\mathbf{x}-\xi_i||) = \frac{\mathbf{x}-\xi_i}{||\mathbf{x}-\xi_i||} \phi'(||\mathbf{x}-\xi_i||)$$

or, in words, it is the vector pointing in the direction $\mathbf{x} - \xi_i$ with magnitude $\phi'(||\mathbf{x}-\xi_i||)$.

-
Thanks. Quick question, just to make things really clear, with respect to what variable is $\phi$ differentiated in $\phi^\prime$? – Olumide Jun 9 '11 at 13:48
$\phi$ is only a function of one variable, which is why it's legitimate to write $\phi'(\cdot)$ in the first place. In the notation of Christian Blatter's answer above, you have $\rho:\mathbb{R}^n\to\mathbb{R}$ and $\phi:\mathbb{R}\to\mathbb{R}$, and you compose them to get a new function $f = \phi\circ\rho$, where now $f:\mathbb{R}^n\to\mathbb{R}$. – Chris Taylor Jun 9 '11 at 13:58
Got it. The differentiation is wrt $u$. – Olumide Jun 9 '11 at 14:12
Yes, that's right. – Chris Taylor Jun 9 '11 at 14:19