Q:

Proving a rule about del operator as applied to matrices

How can I prove the following easily?(If it is true of course.)
\begin{align}
\nabla_{\mathbf{x}_k} \left( \sum_{i=1}^{n}\sum_{j=1}^{n} \mathbf{x}^{T}_i \mathbf{W}_{ij} \mathbf{x}_j   \right)=\sum_{j=1}^{n}(\mathbf{W}_{kj}\mathbf{x}_{j}+\mathbf{W}_{jk}^{T}\mathbf{x}_j)
\end{align}
Here each $\mathbf{x}_i \in \mathbb{R}^{N}$ is a different vector, and each $\mathbf{W}_{ij} \in \mathbb{R}^{N\times N}$ is a different matrix of real numbers for $i,j = 1,2,...,n$.

A:

I think I solved:
\begin{align}
\nabla_{x_k} \left( \sum_{i=1}^{n}\sum_{j=1}^{n} x^{T}_i W_{ij} x_j   \right)
&= \sum_{i=1,i\neq k}^{n}W_{kj}x_j + \sum_{j=1, j\neq k}^{n}(x^T_jW_{jk})^T + x^T_k W_{kk} x_k\\
\text{using the linked question:}\\
&= \sum_{i=1,i\neq k}^{n}\left( W_{ki}x_i + W^T_{ik}x_i \right)+ W_{kk} x_k + W^T_{kk}x_k\\
&= \sum_{i=1}^{n}\left( W_{ki}x_i + W^T_{ik}x_i \right)
\end{align}

