<s>[INST] Classifying Critical Point in 3D Question: $f(x, y, z) = px^2 +q(y^2 + z^2) +rxy + syz$ where $p,q,r,s \in \mathbb{R}$ has a critical point at $(0, 0, 0)$. Classify this critical point. You can assume the product of $p$ and $q$ is positive. Also, $r$ and $s$ cannot be both equal to zero (either one is zero and the other is not, or neither are zero).
Attempt: I've found the Hessian matrix evaluated at the critical point $H=\begin{bmatrix} 2p & r & 0 \\ r & 2q & s \\ 0 & s & 2q \\\end{bmatrix}$.
I've tried to find the eigenvalues ($\lambda$) of $H$ to assess whether the point is a local minimum, maximum or saddle point, but ended up with a long messy equation that cannot be factorised easily to solve for $\lambda$:
$$(2p - \lambda)((2q-\lambda)^2-s^2)-r^2(2q-\lambda)=0$$ which expands to $$-2r^2q+\lambda r^2 -2ps^2 +8q^2p-8\lambda qp +2\lambda ^2p+\lambda s^2 -4\lambda q^2 +4\lambda ^2 q-\lambda^3=0$$
Using Wolfram Alpha to solve this and find the eigenvalues gives these three solutions, which pushes me to consider another strategy.
So my next attempt was to see if I could classify the point via this method (see page 3) because I figured it would break it down into smaller more easier to manage equations with less unknowns, however it got pretty messy having to consider the two cases ($p,q>0$ and $p,q<0$) and then the three subcases (both nonzero $r$ and $s$, $r=0$ and nonzero $s$, nonzero $r$ and $s=0$):

*

*$f_{xx}(0, 0, 0) = 2p$

*$\det \begin{bmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy} \end{bmatrix}=\det \begin{bmatrix} 2p & r \\ r & 2q \end{bmatrix} = 4pq-r^2$

*$\det H = \det \begin{bmatrix} 2p & r & 0 \\ r & 2q & s \\ 0 & s & 2q \\\end{bmatrix} = 2p(4q^2 - s^2)-2r^2q = 8pq^2 - 2ps^2 - 2r^2 q$
Dealing with the signs of the constants is really what's throwing me, as I am comfortable with the classification process. Any help would be greatly appreciated.
Edit: I'm pretty sure the type of critical point will be different depending on the different cases of what $p, q, r, s$ are (i.e. $p,q \gt 0$ or $p, q \lt 0$, and then subcases concerning $r$ and $s$ and whether they're zero or non-zero, remembering that they cannot be both zero).
 [/INST] We have $f(x, y, z) = \frac{1}{2} u^\mathsf{T} H u$ where $u = [x, y, z]^\mathsf{T}$.
Results:
If $p, q > 0$,
then $(0, 0, 0)$ is a local minimizer iff $2q - \frac{r^2}{2p} - \frac{1}{2q}s^2 \ge 0$.
If $p, q > 0$ and $2q - \frac{r^2}{2p} - \frac{1}{2q}s^2 < 0$, then $(0, 0, 0)$ is a saddle point.
If $p, q < 0$, then $(0, 0, 0)$ is a local maximizer iff $-2q + \frac{r^2}{2p} + \frac{1}{2q}s^2 \ge 0$.
If $p, q < 0$ and $-2q + \frac{r^2}{2p} + \frac{1}{2q}s^2 < 0$, then
$(0, 0, 0)$ is a saddle point.
Details:
We apply the Schur complement. See https://www.cis.upenn.edu/~jean/schur-comp.pdf or https://en.wikipedia.org/wiki/Schur_complement

*

*$p, q > 0$:

We have
\begin{align}
H \succeq 0 \quad &\Longleftrightarrow \quad
\left(
  \begin{array}{cc}
    2q & s \\
    s & 2q \\
  \end{array}
\right) - \frac{1}{2p}\left(
                        \begin{array}{c}
                          r \\
                          0 \\
                        \end{array}
                      \right)\left(
                               \begin{array}{c}
                                 r \\
                                 0 \\
                               \end{array}
                             \right)^\mathsf{T} \succeq 0\\
\quad &\Longleftrightarrow \quad \left(
  \begin{array}{cc}
    2q - \frac{r^2}{2p} & s \\
    s & 2q \\
  \end{array}
\right) \succeq 0 \\
\quad &\Longleftrightarrow \quad
2q - \frac{r^2}{2p} - \frac{1}{2q}s^2 \ge 0.
\end{align}
Also, $\det H = 4pq (2q - \frac{r^2}{2p} - \frac{1}{2q}s^2)$.
If $2q - \frac{r^2}{2p} - \frac{1}{2q}s^2 < 0$, then $\det H < 0$.
Clearly, $H$ is not negative semidefinite since the diagonal entries are all positive.
Thus, if $2q - \frac{r^2}{2p} - \frac{1}{2q}s^2 < 0$, then
$H$ has both positive and negative eigenvalues.
Thus, if $2q - \frac{r^2}{2p} - \frac{1}{2q}s^2 < 0$, then $(0, 0, 0)$ is a saddle point.


*$p, q < 0$:

We have
\begin{align}
-H \succeq 0 \quad &\Longleftrightarrow \quad
\left(
  \begin{array}{cc}
    -2q & -s \\
    -s & -2q \\
  \end{array}
\right) - \frac{1}{-2p}\left(
                        \begin{array}{c}
                          -r \\
                          0 \\
                        \end{array}
                      \right)\left(
                               \begin{array}{c}
                                 -r \\
                                 0 \\
                               \end{array}
                             \right)^\mathsf{T} \succeq 0\\
\quad &\Longleftrightarrow \quad \left(
  \begin{array}{cc}
    -2q + \frac{r^2}{2p} & -s \\
    -s & -2q \\
  \end{array}
\right) \succeq 0 \\
\quad &\Longleftrightarrow \quad
-2q + \frac{r^2}{2p} + \frac{1}{2q}s^2 \ge 0.
\end{align}
Also, $\det H = 4pq (2q - \frac{r^2}{2p} - \frac{1}{2q}s^2)$.
If $-2q + \frac{r^2}{2p} + \frac{1}{2q}s^2 < 0$, then $\det H > 0$.
Clearly, $H$ is not positive semidefinite since the diagonal entries are all negative.
Thus, if $-2q + \frac{r^2}{2p} + \frac{1}{2q}s^2 < 0$, then
$H$ has both positive and negative eigenvalues.
Thus, if $-2q + \frac{r^2}{2p} + \frac{1}{2q}s^2 < 0$, then $(0, 0, 0)$ is a saddle point.
</s>