# How to get the derivative of this convex quadratic

1. Oct 17, 2011

### justin_huang

$\frac{d}{dx}f(x)=\frac{d}{dx}[ \frac{1}{2}x_{}^{T}Qx-b_{}^{T}x]$

how to get this derivative, what is the answer? is there textbook describe it?

2. Oct 17, 2011

### Bacle2

3. Oct 23, 2011

### DuncanM

This equation is analogous to a second degree polynomial, so I think the derivative is simply Qx - b.

4. Oct 24, 2011

### HallsofIvy

Staff Emeritus
Not quite. Because multiplication of matrices is not commutative, taking the derivative you have to "symmetrize" Q- the derivative is $[(Q+Q^T)/2]x- b$.

Look at the simple two dimensional situation:
$$\frac{1}{2}\begin{bmatrix}x & y \end{bmatrix}\begin{bmatrix}a & b \\ c & d \end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix}- \begin{bmatrix}e & f\end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix}$$
$$= \frac{1}{2}ax^2+ \frac{b+ c}{2}xy+ \frac{1}{2}dy^2- ex- ey$$

The "derivative with respect to x", since x is a vector, is the gradient:
$$\begin{bmatrix}ax+ \frac{b+c}{2}y- e & dy+ \frac{b+c}{2}x- f\end{bmatrix}$$
$$= \begin{bmatrix}a & \frac{b+c}{2} \\ \frac{b+c}{2} & d\end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix}- \begin{bmatrix}e & f\end{bmatrix}$$