The problem I am trying to tackle is:
$$\underset{\vec{x}}{\mathrm{argmin}}(\frac{1}{2}||\vec{x}-\vec{\mu}||^2)$$ Subject to: $$\vec{x}\cdot({\textbf{C}\vec{x}}) = K$$
Where $\vec{x}$ is an $n$ dimensional real vector, $\vec{\mu}$ is an $n$ dimensional vector, $\textbf{C}$ is an $n\times{n}$ real matrix and $K$ is a scalar. The first operation in the constraint is matrix multiplication, which yields a vector of dimension $n$. Then the dot product of the resultant vector is taken with $x$ to product a scalar.
As far as I got is fully writing out the Lagrange multiplier as so:
$$L(\vec x, \lambda) = \frac{1}{2}||\vec{x}-\vec{\mu}||^2 - \lambda(\vec{x}\cdot({\textbf{C}\vec{x}})-K)$$
Differentiating with respect to $x$ and setting the Lagrange to zero:
$$||\vec{x}-\vec{\mu}|| = \lambda\dfrac{d}{d\vec{x}}(\vec{x}\cdot({\textbf{C}\vec{x}}))$$
This yields us $n$ equations with $n+1$ unknowns. In this part even though it's fairly easy for me to see how I would differentiate any given element in the RHS, I am not totally sure how to fully represent it as a matrix and I think this is where I am getting stuck.
To solve for $n+1$ we need an extra equation, which is a differential of the Lagrange with respect to $\mu$:
$$\vec{x}\cdot({\textbf{C}\vec{x}})=K$$
The only real assumption I am making here is that there only one real distinct solution for $x$, but I think that is right. Can someone point me in the right direction and/ or let me know what I am doing wrong?