I need to minimise the function $$J (x) := x^T A x - 2 x^T b$$ with respect to the vector $x \in \mathbb R^n$, where $A \in \mathbb R^{n \times n}$, $b \in \mathbb R^n$ and $x^T$ is the transpose of $x$.
The solution is $x = A^{-1} b$. I tried expanding out the matrix products and setting the gradient equal to zero, but got to a point where I didn't know how to proceed.