How do I find the minimum of this function? This might seem trivial to some of you, but I can't for the life of me figure out how to solve this.
$$\underset{x}\arg \min  (x - b)^T Ax$$
$$x \in \mathbb{R^n}$$
We may assume A to be invertable, but it is not symmetric.
My idea was to calculate the first and second derivative.
I know that $\frac{dx^T}{dx} = (\frac{dx}{dx})^T$, but when I try to apply the chain rule, I get 
$$\frac{d}{dx} = Ax + (x-b)^Tx$$
which doesn't make sense, as it's a vector plus a scalar.
Even if there is another way to find the x for which the function is minimal, I am now more interested in how to derive this kind of formula.

To differentiate this sort of functions, it is easier to develop them as sums:
Let
$$
f(x) = Ax + (x - b)^T x = \sum_{i=1}^{n} \sum_{j=1}^{n} a_{ij} \, (x_i - b_i) \, x_j,
$$
where $a_{ij}, 1 \leq i, j \leq n$ are the elements of $A$ 
and $b_i$, $1 \leq i \leq n$ are the elements of $b$.
Differentiating w.r.t. $x_k$,
\begin{align}
    \frac{\partial f}{\partial x_k} &= \sum_{i=1}^{n} \sum_{j=1}^{n} a_{ij} \, \left( \delta_{ik} \, x_j  + (x_i - b_i) \, \delta_{jk} \right), \\
                                    &= \sum_{j=1}^{n} \left( a_{kj}\, x_j \right) + \sum_{i=1}^{n} \left( a_{ik} \, (x_i - b_i) \right),
\end{align}
so if you gather the derivatives in a vector $(\nabla f)_k = \partial_{x_k} f$, 
\begin{align}
    \nabla f = Ax + A^T(x - b)
\end{align}
The gradient is 0 when
$$
(A + A^T) \, x = A^T \, b
$$
