TITLE: Differentiation of a double summation
QUESTION [6 upvotes]: How does one reach from from 45 to 46?

REPLY [9 votes]: We split the double sum with respect to the occurrence of the variable $x_k$ and consider each sum separately. 
\begin{align*}
\frac{\partial \alpha}{\partial x_k}
&=\frac{\partial }{\partial x_k}\left(\sum_{j=1}^n\sum_{i=1}^n a_{ij} x_i x_j\right)\\
&=\frac{\partial }{\partial x_k}\left(\sum_{{j=1}\atop{j\ne k}}^n\sum_{{i=1}\atop{i \ne k}}^n a_{ij} x_i x_j+x_k\sum_{{i=1}\atop{i \ne k}}^n a_{ik} x_i+x_k\sum_{{j=1}\atop{j \ne k}}^n a_{kj} x_j+a_{kk}x_k^2\right)\tag{1}\\
&=0+\sum_{{i=1}\atop{i \ne k}}^n a_{ik} x_i+\sum_{{j=1}\atop{j \ne k}}^n a_{kj} x_j+2a_{kk}x_k\tag{2}\\
&=\sum_{i=1}^n a_{ik} x_i+\sum_{j=1}^n a_{kj} x_j\\
\end{align*}

Comment: In (1) we split the double sum according to the occurrence of $x_k$. We consider an index $k$ with $1\leq k\leq n$ arbitrarily, fixed. The general term
\begin{align*}
a_{i,j}x_ix_j\qquad\qquad 1\leq i,j\leq n
\end{align*}
contains

No $x_k$:  This is the case if neither $i$ nor $j$ is equal to $k$. We select all terms having no $x_k$ as
\begin{align*}
\sum_{{j=1}\atop{j\ne k}}^n\sum_{{i=1}\atop{i \ne k}}^n a_{ij} x_i x_j
\end{align*}
Precisely one $x_k$: This is the case if $j=k$ and $i\ne k$ or on the other hand if $i=k$ and $j\ne k$. We select terms having precisely one $x_k$ as
\begin{align*}
x_k\sum_{{i=1}\atop{i \ne k}}^n a_{ik} x_i+x_k\sum_{{j=1}\atop{j \ne k}}^n a_{kj} x_j
\end{align*}
Product $x_k^2$: This is the case if both indices $i=k$ and $j=k$. There is only one term in the double sum to select, namely
\begin{align*}
a_{kk}x^2
\end{align*}

In (2) we differentiate the terms according to the occurrence of the variable $x_k$.