What is the range of $\vec{z}^{ \mathrm{ T } }A\vec{z} $? Let A be a 3 by 3 matrix
$$\begin{pmatrix}
1 & -2  & -1\\
-2 & 1 & 1 \\
-1 & 1 & 4
\end{pmatrix}$$
Then we have a real-number vector $\vec{ z }= \left(
  \begin{array}{c}
    z_1 \\
    z_2 \\
    z_3
  \end{array}
\right)$ such that
$$\vec{z}^{ \mathrm{ T } }\vec{z} = 1$$
$$z_1+z_2+z_3=1$$
What is the range of $\vec{z}^{ \mathrm{ T } }A\vec{z} $?

I have found that $A$'s eigenvalues are -1,2, and 5 and eigenvectors are
$\left(
  \begin{array}{c}
    1 \\
    1 \\
    0
  \end{array}
\right)$$\left(
  \begin{array}{c}
    1 \\
    -1 \\
    1
  \end{array}
\right)$$\left(
  \begin{array}{c}
    -1 \\
    1 \\
    2
  \end{array}
\right)$ for each.
Can anyone help me?
 A: The $\vec z$ that satisfy the two constraints are the points on the circle formed by the intersection of the unit sphere $\vec z^\mathrm T\vec z = 1$ and the plane $z_1 + z_2 + z_3 = 1$. Describe that circle using the parametric form explained at https://math.stackexchange.com/a/1184089/389981 : The circle passes through points $(1,0,0),(0,1,0),(0,0,1)$ which are evenly spaced on the circle, so its center is their average $(1,1,1)/3$ from which it follows that the radius is $\sqrt{2/3}$. By symmetry, the vector $(1,1,1)$ is normal to the plane in which the circle lies, so two orthogonal vectors in that plane are $(1,-1,0),(1,1,-2)$; normalized, they are $(1,-1,0)/\sqrt 2,(1,1,-2)/\sqrt 6$. Hence, a parametric description of points on the circle is\begin{align}(1,1,1)/3 & + \sqrt{2/3}\cos\theta\,(1,-1,0)/\sqrt 2\\
& + \sqrt{2/3}\sin\theta\,(1,1,-2)/\sqrt 6\end{align}
which simplifies to
$$(1,1,1)/3 +\cos\theta\,(1,-1,0)/\sqrt 3 +\sin\theta\,(1,1,-2)/3.$$
Now apply $\vec z^\mathrm T A\vec z$ and simplify to get
$$2(9 +\cos2\theta - 10\sin\theta + 2\sqrt3(\sin2\theta - \cos\theta))/9.$$
I used my graphing calculator to minimize and maximize that expression and found that the range of $\vec z^\mathrm T A\vec z$ is approximately
$[-0.529741,4.9184228]$ where the minimum and maximum values occur at approximate values of $\theta$ of $1.78286$ and $4.04074$.
A: If we eliminate $z_3$ by replacing it with $1-z_1-z_2$, you want to find the minimum and maximum of
$$\{z^TAz + b^Tz + c : zQz+q^Tz = 0\}$$
with
$$A=\begin{pmatrix}7 & 2 \\ 2 & 3\end{pmatrix}, \; b=\begin{pmatrix}-10\\-6\end{pmatrix}, \; c=4, \; Q=\begin{pmatrix}2 & 1 \\ 1 & 2\end{pmatrix}, \; q=\begin{pmatrix}-2\\ -2\end{pmatrix}.$$
Via the Lagrangian we find that an extremum must satisfy $2Az+b+\lambda(2 Qz + q)=0$ and $z^TQz+q^Tz = 0$, but I do not see an easy solution. The problem is now in a format that allows for this numerical procedure.
Instead I will go on and eliminate $z_2$ to get an unconstrained problem in $z_1$. The constraint is $2z_2^2+(2z_1-2)z_2+(2z_1^2-2z_1)=0$, so $z_2=\frac{1}{2}(1-z_1) \pm \sqrt{\frac{1}{4}-\frac{3}{4}z_1^2+\frac{1}{2}z_1}$. Plugging this into the objective function no longer gives a nice expression. Numerical analysis shows that the positive branch has a maximum of $41/9$ at $z_1=-1/3$ and a minimum of $\approx-0.53$ at $z_1\approx 0.538$ while the negative branch has a maximum of $\approx 4.92$ at $z_1 \approx -0.29$ and a minimum of $1$ at $z_1=1$.
So the range is approximately $-0.53$ to $4.92$.
