# Einstein summation convention differential

I'm just learning this convention, and at times I'm a little lost, like now.

I have to calculate the following, knowing that $a_{ij}$ are constants such that $a_{ij}=a_{ji}$:

$$\frac{\partial}{\partial x_{k}} \left[a_{ij}x_{i}\left(x_{j}\right)^{2}\right]$$

The answer I'm given I end up with:

$$a_{ik}\left[\left(x_{i}\right)^{2}+2x_{i}x_{k}\right]$$

And this I don't understand. Why do I change to index $k$, and substitute $j$ with $i$ ? In my opinion, if I just use the product rule, I end up with:

$$\frac{\partial}{\partial x_{k}} \left[a_{ij}x_{i}\left(x_{j}\right)^{2}\right] = a_{ij}\left[x_{i} \frac{\partial \left(x_{j}\right)^{2}}{\partial x_{k}}+ \frac{\partial x_{i}}{\partial x_{k}}\left(x_{j}\right)^{2}\right] = a_{ij}\left[\left(x_{j}\right)^{2}+2x_{i}x_{j}\right]$$

But maybe that is just as correct, or am I missing something?

• Note that $\frac{\partial (x_j)^2}{\partial x_k}$ and $\frac{\partial x_i}{\partial x_k}$ give you Kronecker deltas $\delta_{kj},\, \delta_{ki}$. Just write the sums explicitly to see what's going on. – Daniel Fischer Nov 7 '14 at 14:51
• When $j=k$, the $j$ will conform to the $k$, so $\frac{\partial (x_j)^2}{\partial x_k} = 2x_k$, not $2x_j$. – Arturo don Juan Nov 7 '14 at 14:51
• On the r.h.s of your last equation, there's missing an $a_{ij}$ or something similar. Please correct that. – jflipp Nov 7 '14 at 14:54
• Hmmm, so it's pretty much because I didn't write out the sums? So whenever $j \neq k$ I get zero from the differential. But why doesn't that apply to $i$ as well? The single differential on the right side, won't that also be zero unless $i = k$? So why don't that index change as well? – Denver Dang Nov 7 '14 at 15:11

I think this is because after differentiation your bracket gives $$a_{ij} \left( \delta_{ki}(x_{j})^{2}+2x_{i} \delta_{kj} x_{j}\right)$$ Allowing $k \rightarrow j$ $$a_{ik} \left( \delta_{ki}(x_{k})^{2}+2x_{i} x_{k}\right) = a_{ik} \left( (x_{i})^{2}+2x_{i} x_{k}\right)$$

• Hmmm, makes a bit of sense :) But, doesn't $\frac{\partial x_{j}}{\partial x_{k}} = \delta_{jk}$ instead of $\delta_{kj}$ ? And I can't seem to get the last term in your first equation to fit. Either you differentiate the squared $x_{j}$ and get $2x_{i}x_{j}$ or you take one outside the derivative, and get $x_{i}\delta_{jk}x_{j}$, or am I missing something once again ? – Denver Dang Nov 7 '14 at 16:01

When using this convention, the key is the switching of indices when the Kronecker Delta, $\delta$, gets involved. Use the following solution as a guide:

First, we can take out the constant $a_{ij}$, leaving us with $$a_{ij}\frac{\partial}{\partial x_k}\left[x_i(x_j)^2\right]$$

Now, applying the chain rule

$$a_{ij}\left[x_i\frac{\partial(x_j)^2}{\partial x_k} +(x_j)^2\frac{\partial x_i}{\partial x_k}\right]$$

yielding

$$a_{ij}\left[2x_ix_j\frac{\partial x_j}{\partial x_k} +(x_j)^2\frac{\partial x_i}{\partial x_k}\right]$$

Here's a crucial step. We introduce the Kronecker Delta function as follows, letting $\frac{\partial x_i}{\partial x_k}= \delta_{ik}$ and $\frac{\partial x_j}{\partial x_k}= \delta_{jk}$, by definition, the value of which is given by

$$\delta_{ij}= \begin{cases} 0 & i\neq j \\ 1 & i=j \end{cases}$$

Now, upon substitution, we have

$$a_{ij}\left[2x_ix_j\delta_{jk} + (x_j)^2\delta_{ik}\right]$$

Multiplying through by $a_{ij}$

$$2a_{ij}x_ix_j\delta_{jk} + a_{ij}(x_j)^2\delta_{ik}$$

Let's take a look at the first term

$$2a_{ij}x_ix_j\delta_{jk}$$

According to the definition of Kronecker Delta, in order for $\delta_{jk}$ to be nonzero (ie. 1), $\,$ $j$ must equal $k$. As a result, the subscript j in the first term must be replaced with k. We denote this by $\,$ $j \to k$. (Do not forget $\delta_{jk} = 1$ because of this). Doing so, we get

$$2a_{ik}x_ix_k$$

Similarly, for the second term, we let $i \to k$, yielding

$$a_{jk}(x_j)^2$$ (Note that $a_{jk} = a_{kj}$)

Altogether, we have

$$2a_{ik}x_ix_k + a_{jk}(x_j)^2$$

Now, a dummy index can be replaced by whatever you wish, as long as it not already present in the term. This means that I can replace the dummy index $j$ in the second term by an $i$, which then allows me to factor out the constant. Doing so, we finally get the desired answer

$$a_{ik}\left[2x_ix_k + (x_i)^2\right]$$