# The del operator

Given: $E(\mathbf{x})=\mathbf {x^tWx}$
Where x is vector and W is matrix, can anybody explain me how can I easily derive the following equation (If it is correct. If not, what should it be?)?
$\nabla E(\mathbf{x}) = \mathbf{Wx} + \mathbf{W^tx}$

-

Explicitly, using indices, the expression is (where $i$ ranges as appropriate)
$$\nabla(x^TAx)=\frac{\partial}{\partial x_i}\sum_{\ell, m}x_\ell A_{\ell m}x_m.$$
Compute $\displaystyle\frac{\partial x_\ell x_m}{\partial x_i}=\delta_{i\ell}x_m+x_\ell\delta_{im}$ with the product rule (see Kronecker delta). Plugging in,
$$\sum_{\ell,m}A_{\ell m}(\delta_{i\ell}x_m+x_\ell\delta_{im})=\left(\sum_{m}A_{im}x_m\right)+\left(\sum_{\ell}x_\ell A_{\ell i}\right)=Ax+A^Tx.$$