Partial derivatives using Einstein / Index notation

239 Views Asked by At

I've been trying to compute a partial derivative of an arbitrary function for a while using index notation but I think I am missing something.

Let $\zeta$ be some well behaved scalar function which we apply element-wise to some vector $W^{i}_{k} x^{k}$. I wish to compute the following derivative.

$$\begin{aligned} \frac{\partial \zeta(W^{i}_{k} x^{k}) }{\partial x^{j}} &= \frac{\partial \zeta(W^{i}_{k} x^{k}) }{\partial (W^{r}_{p} x^{p})} \frac{\partial (W^{r}_{q} x^{q}) }{\partial x^{j}} \\ &= \frac{\partial \zeta(W^{i}_{k} x^{k}) }{\partial (W^{r}_{p} x^{p})} W^{r}_{q} \delta^{q}_{j} \\ &= \frac{\partial \zeta(W^{i}_{k} x^{k}) }{\partial (W^{r}_{p} x^{p})} W^{r}_{j} \end{aligned}$$

Where $W^{i}_{k}$ is a constant matrix with respect to $x^{j}$. The problem comes when I try to simplify the remaning derivative which I think I should be able to express as following,

$$\begin{aligned} \frac{\partial \zeta(W^{i}_{k} x^{k}) }{\partial x^{j}} &= \frac{\partial \zeta(W^{i}_{k} x^{k}) }{\partial (W^{r}_{p} x^{p})} W^{r}_{j} \\ &= \zeta^{\prime}(W^{i}_{k} x^{k}) \color{red}{\Delta} W^{r}_{j} \end{aligned}$$

Where $\color{red}{\Delta}$ should be a term that transform $\zeta^{\prime}$ to a diagonal matrix and allows me to multiply this $diag(\zeta^{\prime})$ with $W$. Thus, with this insight I can fill what is "missing",

$$\begin{aligned} \frac{\partial \zeta(W^{i}_{k} x^{k}) }{\partial x^{j}} &= \zeta^{\prime}(W^{l}_{k} x^{k}) \Delta^{i}_{lr} W^{r}_{j} \end{aligned}$$

$$\begin{aligned} \Delta^{i}_{lr} = \begin{cases} 1 & \text{if} \quad i = l = r \\ 0 & otherwise \end{cases} \end{aligned}$$

But this seems quite artificial to me since I am adding the "missing element". So I was wondering if I commited a mistake somewhere along the way.