I am trying to work through some problems to find the minimizer and minimum value of a function. The book I am using doesn't have a clear cut example and I can't seem to find a good example online anywhere, so I have no idea where to begin. The function I am trying to do this for is $$ 3x^{2} + 3xy + 3y^{2} - 2x - 2y + 4 $$
The only thing I can find is that we have to rewrite the equation in the following compact matrix notation $$ p(\textbf{x}) = \textbf{x}^{T}K\textbf{x} - 2\textbf{x}^{T}\textbf{f} + c $$ where $K = (k_{ij})$ is a symmetric $n \times n$ matrix, $\textbf{f}$ is a constant vector, and $c$ is a constant scalar. However, it doesn't really explain how to come up with those values. I'm guessing that in the problem I am trying to work through that $c = 4$ and that $\textbf{x} = [x, y]^{T}$, but I have no idea how to determine $K$ and $\textbf{f}$.
If someone could show me how to find $K$ and $\textbf{f}$ I would greatly appreciate it.
By inspection
$K = \begin{pmatrix} a & b \\ b & c \end{pmatrix}$
$$ \textbf{x}^{T}K\textbf{x} = a x^2 + 2 b x y + c y^2 = 3 x^2 + 3 x y + 3 y^2 $$
So $K = \begin{pmatrix} 3 & 3/2 \\ 3/2 & 3 \end{pmatrix}$.
Similarly
$\textbf{f} = \begin{pmatrix} f_1 \\ f_2 \end{pmatrix}$
$$ -2\textbf{x}^{T}\textbf{f} = -2 f_1 x - 2 f_2 y = -2 x -2 y $$
Thus $\textbf{f} = \begin{pmatrix} 1 \\ 1 \end{pmatrix}$.