# Partial Derivative of a scalar (absolute distance) with respect to its position vector

Imagine we want to take the partial derivative of a quantity, we will call it $\rho_i = f(F(r_{ij}))$ with respect to a particle's position vector, $\vec{r}_k$.

In mathematical terms, this would be expressed as:

$$\frac{\partial \rho_i}{\partial \vec{r}_k} = \frac{\partial F}{\partial r_{ij}}\frac{\partial r_{ij}}{\partial \vec{r}_k}$$

given the definition of $\rho_i$ and using the chain-rule. The $\frac{\partial F}{\partial r_{ij}}$ is a straight-forward calculation, but I run into trouble when trying to calculte $\frac{\partial r_{ij}}{\partial \vec{r}_k}$. Given that $r_{ij}$ is defined as $|\vec{r}_i-\vec{r}_j|$, how does one approach/conceptualize this?

The paper from which I am drawing this hypothetical scenario says that this derrivative is $(\delta_{ik}-\delta_{jk})\hat{r}_k$, where $\hat{r}_k$ is the unit vector, i.e. $\frac{\vec{r}_k}{|\vec{r}_k|}$.

I know and understand that the derrivative of a quantity with respect to a vector is the gradient of the quantity, as explained here, but I do not understand how and why the deltas appear given this notation setup. This probably has to do with my lack of intuition when it comes to Einstein Vector notation, and any help on the matter would be greatly appreciated.

By the way, here is the full image of the full derrivation which I am struggling to understand. The weird notation introduced above results from the need to introduce independent indicies from multiple summations. I have indicated the relevant parts of the derrivation in the image. • $\uparrow$ Which paper? Mar 9, 2018 at 12:24
• It's an internal unpublished paper unfortunately, so I cannot share it here. I could just ask the author personally, but we will be gone for a few weeks on vacation. Hence the question goes here. Mar 9, 2018 at 15:55
• OK, if in the future the paper becomes available, consider to then give a reference/link. Mar 9, 2018 at 16:00

The problem boils down to calculating

\begin{eqnarray} \frac{\partial}{\partial \vec{r}_{k}} |\vec{r}_i - \vec{r}_j| &=& \frac{\partial}{\partial \vec{r}_{k}} \sqrt{(\vec{r}_i - \vec{r}_j) \cdot (\vec{r}_i - \vec{r}_j)} \\ &=& \frac{1}{2} \frac{1}{\sqrt{(\vec{r}_i - \vec{r}_j) \cdot (\vec{r}_i - \vec{r}_j)}} \frac{\partial}{\partial \vec{r}_k} [(\vec{r}_i - \vec{r}_j) \cdot (\vec{r}_i - \vec{r}_j)] \\ &=& \frac{1}{2 r_{ij}} \frac{\partial}{\partial \vec{r}_k} [(\vec{r}_i - \vec{r}_j) \cdot (\vec{r}_i - \vec{r}_j)] \\ &=& \frac{1}{2r_{ij}} \frac{\partial}{\partial \vec{r}_k}(\vec{r}_i \cdot \vec{r}_i - 2 \vec{r}_i \cdot \vec{r}_j + \vec{r}_j\cdot \vec{r}_j) \tag{1} \end{eqnarray}

We need to calculate the gradients of each term, which is actually not that difficult. You can use identities for the gradient, but because you mentioned you're struggling with Einstein's notation, let's do it with Einstein's notation (actually I'm abusing a bit of the notation in what follows)

\begin{eqnarray} \frac{\partial }{\partial \vec{r}_k} (\vec{r}_i\cdot \vec{r}_j) &=& \hat{e}_a \frac{\partial }{\partial x_k^a} (x_i^b x_j^b) \\ &=& \hat{e}_a \frac{\partial x_i^b}{\partial x_k^a} x_j^b + \hat{e}_a x_i^b\frac{\partial x_j^b}{\partial x_k^a} \\ &=& \hat{e}_a\delta_{ab}\delta_{ik}x_j^b + \hat{e}_a x_i^b \delta_{jk}\delta_{ab} \\ &=&(\hat{e}_a x_j^a)\delta_{ik} + (\hat{e}_a x_i^a)\delta_{jk} \\ &=& \vec{r}_j \delta_{ik} + \vec{r}_i\delta_{jk} \tag{2} \end{eqnarray}

Now we can go back to (1):

\begin{eqnarray} \frac{\partial}{\partial \vec{r}_{k}} |\vec{r}_i - \vec{r}_j| &=& \frac{1}{2r_{ij}} \frac{\partial}{\partial \vec{r}_k}(\vec{r}_i \cdot \vec{r}_i - 2 \vec{r}_i \cdot \vec{r}_j + \vec{r}_j\cdot \vec{r}_j) \\ &=& \frac{1}{2r_{ij}} (2\vec{r}_i\delta_{ik} - 2\vec{r}_i\delta_{jk} - 2\vec{r}_j\delta_{ik} + 2\vec{r}_j\delta_{jk}) \\ &=& \frac{1}{r_{ij}}[ \vec{r}_i (\delta_{ik} - \delta_{jk}) - \vec{r}_j (\delta_{ik} - \delta_{jk})] \\ &=& \frac{\vec{r}_i - \vec{r}_j}{r_{ij}} (\delta_{ik} - \delta_{jk}) \\ &=& \hat{r}_{ij} (\delta_{ik} - \delta_{jk}) \tag{3} \end{eqnarray}

• How would your solution look like if you avoided using Einstein's notation (i.e. using the identities)? I think I might have misused that expression in my question. I meant just general index notation, not necessarily Einstein, as I do not really follow what you are doing during step 2. Mar 9, 2018 at 15:54
• @cwm5412 Just add $\sum_{a}\sum_{b}$ after the equals sign in the first, second and third line. For the fourth line just add one $\sum_{a}$. The fifth doesn't need any sum symbol Mar 9, 2018 at 15:57