Solving for equation with vector terms? Is it possible to solve for $v$ in terms of $a$, $b$, $M$, and $e$?
Variables:

*

*$a$ and $b$ are constants

*$M$ is an invertible $n × n$ matrix in $R^{nxn}$

*$v$ is a $n × 1$ vector in $R^n$

*$e$ is a $n × 1$ vector of ones, $(1,1,...,1)^T$

*$n$ > 5

Equations:
$a = v^TMe$
$b = v^TMv$
I'm not too sure where to begin to isolate $v$, because I know $v$ and $e$ are vectors and therefore are not invertible.
 A: Let $j=\min\{i\in [n]:e_i^TMe \neq 0\}$. We know such a $j$ exists since $M$ is invertible. You can check by direct substitution that the vector $v$ defined by $v=\frac{ae_j}{e_j^TM^Te}$ is a solution to the equation $v^TMe=a$.
Consider the equation $v^TMv=b$ when $b>0$. Assume we can identify $v_{(+)}\in \mathbb{R}^{n\times 1}$ such that $v_{(+)}^TMv_{(+)}>0$. Put $v=v_{(+)}\sqrt{\frac{b}{v_{(+)}^TMv_{(+)}}}$. Then we have $$v^TMv=\Bigg(\sqrt{\frac{b}{v_{(+)}^TMv_{(+)}}}\Bigg)^2v_{(+)}^TMv_{(+)}=b$$ which means $v$ is in fact a solution to $v^TMv=b$. Now assume $b<0$. Assume there exists a vector $v_{(-)}\in \mathbb{R}^n$ such that $v_{(-)}^TMv_{(-)}<0$. Set $v=v_{(-)}\sqrt{\frac{b}{v_{(-)}^TMv_{(-)}}}$ Then $$v^TMv=\Bigg(\sqrt{\frac{b}{v_{(-)}^TMv_{(+-}}}\Bigg)^2v_{(-)}^TMv_{(-)}=b$$ Hence $v$ is a solution to $v^TMv=b$. Taking $v=0$ provides us with a solution for the case when $b=0$.
Remark: The vectors $v_{(-)},v_{(+)}$ need not exist. To see this, consider when $$M=A\oplus A \oplus A\in \mathbb{R}^{6 \times 6}$$ where $A$ is the matrix of the linear transformation which rotates vectors in the $xy-$plane by $\pi/2$ radians.
