# Minimisation of a scalar function with respect to a vector

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.

We require $A$ to be symmetric and nonsingular.
Differentiating $J$ with respect to $x$ using matrix calculus gives us $2Ax-2b$, equating it to zero, we have
$$2Ax-2b=0$$
$$Ax=b$$
$$x=A^{-1}b$$