# Linear flows and the trace–determinant plane
For a linear system $\vec{x}'=A\vec{x}$ with a $2\times 2$ matrix $A$, the eigenvalues come from $\det(A-\lambda I)=0$. Writing it out,
$
\det(A-\lambda I) = \lambda^2-\operatorname{tr}(A)\,\lambda+\det(A) = 0,
\qquad
\lambda = \tfrac12\Big(\operatorname{tr}(A)\pm\sqrt{\operatorname{tr}(A)^2-4\det(A)}\,\Big).
$
So the eigenvalues depend on $A$ only through two numbers, its trace and its determinant. Two facts follow from the quadratic:
$
\lambda_1+\lambda_2=\operatorname{tr}(A), \qquad \lambda_1\lambda_2=\det(A).
$
Every $2\times 2$ matrix is a point in the plane with coordinates $(\operatorname{tr}(A),\det(A))$. The square root changes from real to imaginary across the parabola $\det(A)=\tfrac14\operatorname{tr}(A)^2$, and the sign of the product $\lambda_1\lambda_2$ changes across the $\operatorname{tr}(A)$ axis. Those two curves cut the plane into the regions in the video.
![[LinearFlows.mp4]]
The video shows nine flows, then moves each one to its point in the plane. The dot at the end of each thin line is the exact $(\operatorname{tr}(A),\det(A))$ of the matrix in that box. The star, the degenerate node and the line of fixed points then appear a second time on the other side of the $\det(A)$ axis. Those copies are $-A$: replacing $A$ by $-A$ runs time backward, which negates both eigenvalues, flips the sign of $\operatorname{tr}(A)$ and leaves $\det(A)$ alone.
## The regions
| Where the point is | Eigenvalues | Name |
|---|---|---|
| $\det(A)<0$ | real, opposite signs | saddle |
| $0<\det(A)<\tfrac14\operatorname{tr}(A)^2$, $\operatorname{tr}(A)<0$ | real, both negative | stable node |
| $0<\det(A)<\tfrac14\operatorname{tr}(A)^2$, $\operatorname{tr}(A)>0$ | real, both positive | unstable node |
| $\det(A)>\tfrac14\operatorname{tr}(A)^2$, $\operatorname{tr}(A)<0$ | $\alpha\pm i\beta$, $\alpha<0$ | stable spiral |
| $\det(A)>\tfrac14\operatorname{tr}(A)^2$, $\operatorname{tr}(A)>0$ | $\alpha\pm i\beta$, $\alpha>0$ | unstable spiral |
| $\operatorname{tr}(A)=0$, $\det(A)>0$ | $\pm i\beta$ | center |
| $\det(A)=\tfrac14\operatorname{tr}(A)^2\neq 0$ | $\lambda_1=\lambda_2=\tfrac12\operatorname{tr}(A)$ | star if $A=\lambda I$, degenerate node otherwise |
| $\det(A)=0$, $\operatorname{tr}(A)\neq 0$ | $0$ and $\operatorname{tr}(A)$ | line of fixed points |
The last two rows are curves, not regions. A small change to the entries of $A$ moves the point off them, which is why these cases are called non-generic.
## Worked examples
**A saddle.** Take
$
A=\begin{bmatrix} 1 & 1\\ 4 & 1\end{bmatrix}, \qquad \operatorname{tr}(A)=2,\quad \det(A)=1-4=-3 .
$
Since $\det(A)<0$ this is a saddle, whatever the trace. The characteristic equation is $\lambda^2-2\lambda-3=(\lambda-3)(\lambda+1)=0$, so $\lambda=3$ and $\lambda=-1$. For $\lambda=3$, $(A-3I)\vec{v}=\vec{0}$ gives $\vec{v}=(1,2)$. For $\lambda=-1$ it gives $\vec{v}=(1,-2)$. The angle between these two directions is $\arccos(3/5)\approx 53^\circ$. Eigenvector lines do not have to be perpendicular.
**One point, two portraits.** Both
$
B=\begin{bmatrix} -2 & 1\\ 0 & -2\end{bmatrix} \qquad\text{and}\qquad C=\begin{bmatrix} -2 & 0\\ 0 & -2\end{bmatrix}
$
have $\operatorname{tr}=-4$ and $\det=4$, so both sit at the same point on the parabola with $\lambda_1=\lambda_2=-2$. $C$ is a star: every vector is an eigenvector and every path is a straight ray into the origin. $B$ has only one eigenvector direction, $(1,0)$, and is a degenerate node. The trace–determinant plane gives the eigenvalues. On the parabola it cannot tell you which of the two portraits you get.
## The applet
<div class="applet" data-applet="tracedet-flow"></div>
Drag the point in the upper panel. The flow below follows the matrix at that point, and the readout gives its type, its eigenvalues, the trace, the determinant, $\operatorname{tr}(A)^2-4\det(A)$ and the entries of $A$. The point snaps onto the parabola and the axes when you get close, so the special cases can be reached by hand. Click a coloured dot, or use the menu, to load one of the twelve matrices from the video. Click inside the flow to release a tracer from that spot.
The two **matrix** buttons choose how a point $(\operatorname{tr}(A),\det(A))$ is turned into a matrix.
- **fixed eigenvectors** keeps the eigenvector directions at $20^\circ$ and $75^\circ$ and changes only the eigenvalues. On the parabola this family gives a star.
- **spring form** uses $A=\begin{bmatrix}0&1\\-k&-b\end{bmatrix}$, the matrix of $y''+by'+ky=0$ with $\vec{x}=(y,y')$, so $b=-\operatorname{tr}(A)$ and $k=\det(A)$. On the parabola this family gives a degenerate node.
The button **A → −A** reverses time.
Things to try:
- Drag the point straight down across the $\operatorname{tr}(A)$ axis anywhere. The flow turns into a saddle the moment $\det(A)$ goes negative, whatever the trace.
- Drag along a horizontal line above the parabola, from left to right. The spiral loosens, closes up into ellipses at $\operatorname{tr}(A)=0$, and then unwinds.
- Put the point on the parabola and switch between the two matrix buttons. Same eigenvalues, different portraits.
- Load any case and press **A → −A** a few times. Watch the dot jump across the $\det(A)$ axis.
- In spring form, start at $b=-\operatorname{tr}(A)=0$ (a center) and drag left. Where does the spring become critically damped?
## Questions
1. Why does a saddle need only $\det(A)<0$? Why is the trace irrelevant there?
> [!question]- Answer
> $\lambda_1\lambda_2=\det(A)<0$. A negative product of two real numbers means one is positive and one is negative, and complex eigenvalues come in conjugate pairs whose product $\alpha^2+\beta^2$ is positive, so they are ruled out. The trace only decides which of the two has the larger size.
2. On the positive $\det(A)$ axis you get centers. What do you get on the negative $\det(A)$ axis, where $\operatorname{tr}(A)=0$ and $\det(A)<0$?
> [!question]- Answer
> A saddle, with $\lambda=\pm\sqrt{-\det(A)}$. The eigenvalues are real, opposite, and equal in size, so the incoming and outgoing rates match.
3. Why is the whole line of fixed points made of equilibria, rather than a single point?
> [!question]- Answer
> $\det(A)=0$ means $A$ is singular, so $A\vec{v}=\vec{0}$ has nonzero solutions. Every multiple of such a $\vec{v}$ also satisfies $A\vec{x}=\vec{0}$, so $\vec{x}'=\vec{0}$ at every point of that line. Points off the line move parallel to the other eigenvector, toward the line if $\operatorname{tr}(A)<0$ and away from it if $\operatorname{tr}(A)>0$.
4. Can a symmetric matrix ($A=A^{\mathsf T}$) produce a spiral? What does symmetry do to the eigenvector lines?
> [!question]- Answer
> No. With $A=\begin{bmatrix}a&b\\b&d\end{bmatrix}$, $\operatorname{tr}(A)^2-4\det(A)=(a-d)^2+4b^2\ge 0$, so the eigenvalues are always real. The eigenvectors of a symmetric matrix are also perpendicular. A picture built only from symmetric matrices will always show perpendicular eigenvector lines, which is why the matrices in the video were chosen to be non-symmetric.
5. In spring form, the three damping cases of $y''+by'+ky=0$ (underdamped, critically damped, overdamped, with $b>0$, $k>0$) correspond to which regions of the plane? Can a spring ever be a star?
> [!question]- Answer
> With $b=-\operatorname{tr}(A)$ and $k=\det(A)$, the discriminant $\operatorname{tr}(A)^2-4\det(A)$ is $b^2-4k$. Underdamped ($b^2<4k$) is a stable spiral, critically damped ($b^2=4k$) is on the parabola, and overdamped ($b^2>4k$) is a stable node. A spring is never a star: the spring-form matrix has a $1$ in its upper right corner, so it is never a multiple of $I$. Critical damping is always a degenerate node.
6. The video's unstable star, unstable degenerate node and unstable line of fixed points are the stable ones with $A$ replaced by $-A$. Is the unstable node in the video also the stable node with $A$ replaced by $-A$?
> [!question]- Answer
> No. Replacing $A$ by $-A$ keeps the eigenvectors and negates the eigenvalues. The stable node in the video has eigenvalues $-2$ and $-0.5$ with eigenvectors at $20^\circ$ and $78^\circ$. The unstable node has eigenvalues $0.5$ and $2$ with eigenvectors at $-15^\circ$ and $50^\circ$, so it is a different matrix that happens to sit at the mirror point $(2.5,\,1)$. Every matrix at a given point has the same eigenvalues. The eigenvectors are free.
## The matrices in the video
Each matrix was built as $A=PNP^{-1}$ from a chosen basis $P$ and a simple $N$, then checked numerically.
| Case | $A$ (rounded) | $\operatorname{tr}(A)$ | $\det(A)$ | Eigenvalues |
|---|---|---|---|---|
| stable node | $\begin{bmatrix}-2.126&0.346\\-0.592&-0.374\end{bmatrix}$ | $-2.5$ | $1$ | $-2,\ -0.5$ |
| unstable node | $\begin{bmatrix}0.775&1.028\\0.328&1.725\end{bmatrix}$ | $2.5$ | $1$ | $0.5,\ 2$ |
| saddle | $\begin{bmatrix}-1.293&-0.201\\-1.219&0.893\end{bmatrix}$ | $-0.4$ | $-1.4$ | $-1.4,\ 1$ |
| stable spiral | $\begin{bmatrix}-1.070&2.153\\-1.196&0.070\end{bmatrix}$ | $-1$ | $2.5$ | $-0.5\pm1.5i$ |
| unstable spiral | $\begin{bmatrix}1.017&2.210\\-1.139&-0.017\end{bmatrix}$ | $1$ | $2.5$ | $0.5\pm1.5i$ |
| center | $\begin{bmatrix}-0.752&1.974\\-1.426&0.752\end{bmatrix}$ | $0$ | $2.25$ | $\pm1.5i$ |
| star (stable) | $\begin{bmatrix}-0.9&0\\0&-0.9\end{bmatrix}$ | $-1.8$ | $0.81$ | $-0.9,\ -0.9$ |
| degenerate node (stable) | $\begin{bmatrix}-2.014&1.521\\-0.248&-0.786\end{bmatrix}$ | $-2.8$ | $1.96$ | $-1.4,\ -1.4$ |
| line of fixed points (stable) | $\begin{bmatrix}-1.179&-0.383\\-0.989&-0.321\end{bmatrix}$ | $-1.5$ | $0$ | $0,\ -1.5$ |
The three unstable copies are the negatives of the last three rows.
> [!quote] Credit
> The video is a remake of a short animation by matharium, found on Facebook. The look (a grid of particle flows that rearranges itself into the trace–determinant plane) is theirs. This version adds the signs to every label, uses non-symmetric matrices so the eigenvector lines are not perpendicular, places the star, degenerate node and line of fixed points on both sides of the plane, marks each matrix's exact point, and labels the parabola and the eigenvalue formula.