Consider a quadratic function given by $$ f(x) = \frac{1}{2}x^{\text{T}}Ax + c^{\text{T}}x + d, $$ where $A$ is an $n \times n$ symmetric matrix, $c \in \mathbb{R}^n$ and $d \in \mathbb{R}$.
Now I want to characterize the level sets or contours of $f$ in dependence whether $A$ is positive definite ($A \succ 0$), positive semidefinite ($A \succeq 0$), negative indefinite ($A \prec 0$), negative semidefinite ($A \preceq 0$) or indefinite. The level sets are given by
\begin{equation} \mathcal{L}(a) = \{ x \in \mathbb{R}^{n} \mid f(x) = a \}, \end{equation}
where $a \in \mathbb{R}$. Here is my approach. Let us first compute the gradient of $f$, which is given by $$ \nabla f(x) = Ax + c. $$ Now suppose $A$ is invertible we get
$$ \nabla f(x) = 0 \iff x = - A^{-1}c $$
Now we can rewrite $f$ as follows $$ f(x) = \left(x - \hat{x} \right)^{\text{T}} A \left(x - \hat{x} \right) - \frac{1}{2}c^{\text{T}}A^{-1}c + d, $$ where $\hat{x} := - A^{-1}c$. Now I think $\left(x - \hat{x} \right)^{\text{T}} A \left(x - \hat{x} \right)$ defines me an ellipsoid if $A$ is positive semidefinite. But what about the other terms? If I write down the level sets I get
$$ \mathcal{L}(a) = \{ x \in \mathbb{R}^{n} \mid f(x) = a \} = \{ x \in \mathbb{R}^{n} \mid \left(x - \hat{x} \right)^{\text{T}} A \left(x - \hat{x} \right) = a + \frac{1}{2}c^{\text{T}}A^{-1}c - d\}. $$
Does for example $$ \left(x - \hat{x} \right)^{\text{T}} A \left(x - \hat{x} \right) = a + \frac{1}{2}c^{\text{T}}A^{-1}c - d $$ defines me an ellipse if $A$ is positive definite? What is the interpretation of the righthand side term $a + \frac{1}{2}c^{\text{T}}A^{-1}c - d$?
I am thankful for every help!
The level sets of $f$ are bounded if and only if $A$ is positive definite or negative definite.
If $A$ is positive definite or negative definite then level sets of $f$ are ellipsoids (or empty): Let $A=QDQ^T$ with $Q$ orthogonal. Set $y:=Q^T(x-\hat x)$. Then using this in the equation in the OP $$ y^TDy = (x-\hat x)A(x-\hat x) = const. $$ This is nothing else than an equation of the type $$ \sum_i d_i y_i^2 = const, $$ hence the set of all such $y$ is an ellipsoid. Then also the corresponding level set is an ellipsoid.
Assume one level set of $f$ is unbounded. Then there is a sequence $(x_n)$ with $\|x_n\|\to \infty$ such that $$ \frac12 x_n^TAx_n + c^Tx_n + d = a. $$ The normalized sequence $\frac1{\|x_n\|}x_n$ has a subsequence that converges to some unit vector $x$.
Dividing the equation above by $\|x_n\|^2$ and passing to the limit along the subsequence yields $$ \frac12 x^TAx=0. $$ Hence, $A$ is neither positive nor negative definite.