Maximize inner product with constraint I would like to solve the following maximization problem:
$$
max_x (x+y)^TM(x+y)  \\ s.t. \hspace{.25cm} x^Tx \leq 1
$$
Where M is symmetric and negative definite.
I can construct the lagrangian :
$$
max_x (x+y)^TM(x+y) + \lambda[r^Tr -1]
$$
I am able to derive the F.O.C.:
$$
M(x+y) = -2\lambda x
$$
When the constraint is not binding clearly x = - y, with unique max = 0. But I have no idea how to solve for the binding case.
If I assume invertibility of $[M + 2\lambda I]$ (which im not sure if I can do) I can arrive at:
$$
x = -[M+2\lambda I]^{-1}My
$$
Invoking the constraint (and symmetry):
$$
1 = y^T M [M+2\lambda I]^{-1}M^2[M+2\lambda I]^{-1}M y
$$
Which is 1 equation in 1 unknown and should have a unique solution for $\lambda$ which would solve the problem, but I see no way to do so.
Thank You for your help.
 A: $
\def\a{\alpha}\def\b{\beta}
\def\l{\lambda}\def\s{\sigma}
\def\o{{\tt1}}\def\p{\partial}
\def\LR#1{\left(#1\right)}
\def\trace#1{\operatorname{Tr}\LR{#1}}
\def\qiq{\quad\implies\quad}
\def\grad#1#2{\frac{\p #1}{\p #2}}
\def\c#1{\color{red}{#1}}
\def\CLR#1{\c{\LR{#1}}}
\def\fracLR#1#2{\LR{\frac{#1}{#2}}}
$In the binding case the problem becomes
$$\eqalign{
&\max_x\;&(x+y)^TM(x+y) \\
&{\rm s.t.}&x^Tx = \o \\
}$$
which can be solved by constructing the constrained variable $x$ from
an unconstrained variable $u$
$$\eqalign{
x &= \frac{u}{\|u\|} \qiq \grad xu
 = \fracLR{\|u\|^2I-uu^T}{\|u\|^3}
 = \fracLR{I-xx^T}{\|u\|}
\\
}$$
For typing convenience, introduce the vector
$$\eqalign{
z &= x+y \qiq dz = dx \\
}$$
Write the objective function and calculate its unconstrained gradient
$$\eqalign{
\phi &= z^TMz \\
d\phi &= 2Mz:dz = 2Mz:dx = 2\fracLR{I-xx^T}{\|u\|}Mz:du \\
\grad{\phi}{u} &= \fracLR{2}{\|u\|}\LR{I-xx^T}Mz \\
}$$
Setting the gradient to zero yields the eigenvalue equation of a rank-one matrix $\LR{xx^T}$
$$\eqalign{
\LR{xx^T}(Mz) &= (Mz) \\
\LR{xx^T}v &= \l v \\
}$$
whose only non-zero eigenpair is $(\l,v)=(\o,x).\;$
This leads to a soluble linear equation for the optimal $x$ vector
in the binding case
$$\eqalign{
&x = Mz = M(x+y) \\
&\LR{I-M}x = My \\
&x = \LR{I-M}^{-1}My \\
}$$
