Differentiation of quadric function Could someone please show the steps of differentiating the quadratic function of following form
$x'Ωx$ where $Ω$ = variance covariance matrix and $x'$= vector of shares and $x$ = total portfolio of shares.
I know that the answer is $2Ωx$ but I am not quite sure why that is? On a side note does inversing the function $γΩx^*$ lead to an isolation of $x^*$? and why?
 A: The covariance matrix is symmetric so that $\Omega_{ij}=\Omega_{ji}$.
Now, write $x'\Omega x=\sum_{i,j}x_i \Omega_{ij}x_j$ and differentiate with respect to $x_k$.  Then, we have 
$$\begin{align}
\frac{\partial (\sum_{i,j}x_i\Omega_{ij}x_j) }{\partial_k}&=\sum_{i,j}\frac{\partial (x_i\Omega_{ij}x_j) }{\partial_k} \tag 1\\
&=\sum_{i,j}\left(\delta_{ik}\Omega_{ij}x_j+x_i\Omega_{ij}\delta_{jk}\right)\tag 2\\
&=\sum_{j}\Omega_{kj}x_j+\sum_{i}\Omega_{ik}x_i \tag 3\\
&=\sum_{j}\Omega_{kj}x_j+\sum_{i}\Omega_{ki}x_i \tag 4\\
&=2\sum_{i}\Omega_{ki}x_i \tag 5
\end{align}$$
$(1)$ Interchange the summation and partial derivative
$(2)$ Use the fact that $\partial_m (x_n) = \delta_{mn}$ where $\delta_{mn}$ is the Knonecker Delta.
$(3)$  Exploit the "sifting" property of the Knonecker Delta.
$(4)$ Use the symmetry property of the covariance matrix.
$(5)$ Change dummy index from $j$ to $i$ on the first sum and combine with the second sum.
A: Just use the inner product: $x'\Omega x=\langle x,\Omega x\rangle$.  Now use the product rule to obtain $\langle x,\Omega x\rangle'(p)=\langle p,\Omega x\rangle+\langle x,\Omega p\rangle$ and recall that $\Omega$ is symmetric.
