% =============================================================================
% ch14_nonlinear_systems.tex
% Chapter 14: Nonlinear Systems
% =============================================================================

\section{Nonlinear Systems}
\label{ch:nonlinear_systems}

Linear systems admit a powerful theory built on superposition and eigenvalue analysis
(\cref{ch:systems}). When the equations become nonlinear, the principle of superposition
breaks down: the sum of two solutions is generally \emph{not} a solution. No universal
closed-form solution formula exists for nonlinear systems. Instead, we rely on
\textbf{qualitative methods} --- studying the structure of solutions without finding
explicit formulas.

\subsection{Nonlinear Autonomous Systems}
\label{sec:ch14_autonomous}

A \textbf{nonlinear autonomous system} in two variables takes the form
\begin{equation}
  \label{eq:nonlinear_autonomous}
  \frac{\mathrm{d}x}{\mathrm{d}t} = f(x,y), \qquad
  \frac{\mathrm{d}y}{\mathrm{d}t} = g(x,y),
\end{equation}
where $f$ and $g$ are nonlinear functions. The system is \emph{autonomous} because
$f$ and $g$ do not depend explicitly on $t$.

\paragraph{Why analytical methods fail.}
For linear systems $\mathbf{x}' = A\mathbf{x}$, we can construct the general solution
from eigenvalues and eigenvectors. For nonlinear systems:
\begin{itemize}
  \item \textbf{No superposition:} If $\mathbf{x}_1(t)$ and $\mathbf{x}_2(t)$ are solutions,
        $c_1\mathbf{x}_1(t) + c_2\mathbf{x}_2(t)$ is \emph{not} generally a solution.
  \item \textbf{No general formula:} There is no algorithm that produces a closed-form
        solution for an arbitrary nonlinear system.
  \item \textbf{Rich behavior:} Nonlinear systems exhibit phenomena absent in linear
        systems, including multiple equilibria, limit cycles, bifurcations, and chaos.
\end{itemize}

The strategy is to understand the system's \textbf{phase portrait} --- a qualitative
map of all possible solution trajectories in the $(x,y)$-plane --- by combining
local linear analysis near equilibria with global theorems.

\paragraph{Equilibrium points.}
As in \cref{sec:ch03_autonomous} and \cref{sec:ch08_phase_plane}, equilibrium
(singular) points are constant solutions where the system comes to rest.

\begin{definition}[Equilibrium point]
  An \textbf{equilibrium point} (or \textbf{fixed point}, or \textbf{critical point})
  of \cref{eq:nonlinear_autonomous} is a point $(x^*,y^*)$ satisfying
  \[
    f(x^*,y^*) = 0 \quad\text{and}\quad g(x^*,y^*) = 0.
  \]
  At an equilibrium, both derivatives vanish and the solution is stationary:
  $x(t) \equiv x^*$, $y(t) \equiv y^*$.
\end{definition}

Finding equilibria is an algebraic problem: solve the system of two nonlinear
equations $f = 0$, $g = 0$. Unlike the one-dimensional case (\cref{ch:qualitative}),
there may be zero, one, or many equilibrium points.

\begin{workedexample}
  \textbf{Find all equilibrium points of the system}
  \[
    \frac{\mathrm{d}x}{\mathrm{d}t} = x - x^2 - xy, \qquad
    \frac{\mathrm{d}y}{\mathrm{d}t} = y - y^2 - xy.
  \]

  \textbf{Solution.} Set both equations to zero simultaneously:
  \begin{align}
    x(1 - x - y) &= 0, \label{eq:ex_eq1} \\
    y(1 - x - y) &= 0. \label{eq:ex_eq2}
  \end{align}
  From \cref{eq:ex_eq1}, either $x = 0$ or $1 - x - y = 0$.

  \textit{Case 1:} $x = 0$. Substituting into \cref{eq:ex_eq2}: $y(1 - 0 - y) = 0$,
  so $y = 0$ or $y = 1$. This gives equilibria $(0,0)$ and $(0,1)$.

  \textit{Case 2:} $1 - x - y = 0$, i.e.\ $y = 1 - x$. Substituting into
  \cref{eq:ex_eq2}: $y(0) = 0$, which is satisfied for any $y$. But we must
  also have $x = 1 - y$ from the same relation. Setting $x = 0$ gives $y = 1$
  (already found), and setting $y = 0$ gives $x = 1$, yielding the equilibrium $(1,0)$.

  \textit{Verification:} Check $(1,0)$: $f(1,0) = 1 - 1 - 0 = 0$, $g(1,0) = 0 - 0 - 0 = 0$. $\checkmark$

  The system has three equilibrium points: $(0,0)$, $(0,1)$, and $(1,0)$.
\end{workedexample}

\subsection{Jacobian Linearization}
\label{sec:ch14_jacobian}

The central technique for analyzing nonlinear systems near an equilibrium is
\textbf{linearization}. Just as in \cref{sec:ch03_stability}, we approximate the
nonlinear functions by their first-order Taylor expansions near the equilibrium.
This reduces the nonlinear system to a linear one, whose behavior we understand
completely from \cref{ch:systems}.

\paragraph{Derivation via Taylor expansion.}
Let $(x^*,y^*)$ be an equilibrium. Introduce deviation variables
$u = x - x^*$ and $v = y - y^*$. Expanding $f$ and $g$ in a
two-variable Taylor series about $(x^*,y^*)$:
\begin{align*}
  f(x,y) &= f(x^*,y^*) + \pd{f}{x}\Big|_{(x^*,y^*)} (x-x^*)
           + \pd{f}{y}\Big|_{(x^*,y^*)} (y-y^*) + O\!\bigl(|u|^2 + |v|^2\bigr), \\
  g(x,y) &= g(x^*,y^*) + \pd{g}{x}\Big|_{(x^*,y^*)} (x-x^*)
           + \pd{g}{y}\Big|_{(x^*,y^*)} (y-y^*) + O\!\bigl(|u|^2 + |v|^2\bigr).
\end{align*}
Since $(x^*,y^*)$ is an equilibrium, $f(x^*,y^*) = g(x^*,y^*) = 0$.
Discarding the higher-order terms gives the \textbf{linearized system}
\begin{equation}
  \label{eq:linearized_system}
  \begin{pmatrix} u' \\ v' \end{pmatrix}
  =
  \underbrace{
    \begin{pmatrix}
      \pd{f}{x}\big|_{(x^*,y^*)} & \pd{f}{y}\big|_{(x^*,y^*)} \\[6pt]
      \pd{g}{x}\big|_{(x^*,y^*)} & \pd{g}{y}\big|_{(x^*,y^*)}
    \end{pmatrix}
  }_{\displaystyle = \; J}
  \begin{pmatrix} u \\ v \end{pmatrix}.
\end{equation}

\begin{keyresult}
  \textbf{Jacobian matrix and linearization.}
  The \textbf{Jacobian matrix} of the system $x' = f(x,y)$, $y' = g(x,y)$ is
  \[
    J(x,y) =
    \begin{pmatrix}
      \pd{f}{x} & \pd{f}{y} \\[6pt]
      \pd{g}{x} & \pd{g}{y}
    \end{pmatrix}.
  \]
  Evaluated at an equilibrium $(x^*,y^*)$, the linearized system is
  $\begin{pmatrix} u' \\ v' \end{pmatrix} = J(x^*,y^*) \begin{pmatrix} u \\ v \end{pmatrix}$,
  where $u = x-x^*$, $v = y-y^*$. Classify $(x^*,y^*)$ by the eigenvalues
  of $J(x^*,y^*)$ using the phase plane classification from \cref{ch:systems}.
\end{keyresult}

\begin{keyresult}
  \textbf{Eigenvalue classification at an equilibrium of a nonlinear system.}

  Let $\lambda_1, \lambda_2$ be the eigenvalues of $J(x^*,y^*)$.

  \begin{center}
  \begin{tabular}{l l p{5cm}}
    \toprule
    \textbf{Eigenvalues} & \textbf{Type} & \textbf{Stability} \\
    \midrule
    Real, both $> 0$ & Unstable node (source) & Unstable \\[4pt]
    Real, both $< 0$ & Stable node (sink) & Asymptotically stable \\[4pt]
    Real, opposite signs & Saddle point & Unstable \\[4pt]
    Complex $\alpha \pm i\beta$, $\alpha > 0$ & Unstable spiral & Unstable \\[4pt]
    Complex $\alpha \pm i\beta$, $\alpha < 0$ & Stable spiral & Asymptotically stable \\[4pt]
    Purely imaginary $\pm i\beta$ & Center (inconclusive) & \textit{Linearization inconclusive} \\
    \bottomrule
  \end{tabular}
  \end{center}

  The center case is the only one where the linearization does \emph{not}
  determine the true nonlinear behavior. See \cref{sec:ch14_hartman_grobman} for details.
\end{keyresult}

\begin{workedexample}
  \textbf{Linearize and classify the equilibria of}
  \[
    \frac{\mathrm{d}x}{\mathrm{d}t} = y, \qquad
    \frac{\mathrm{d}y}{\mathrm{d}t} = x - x^2.
  \]
  \textit{(This is the undamped nonlinear pendulum in phase-plane form.)}

  \textbf{Step 1: Find equilibria.}
  Set $y = 0$ and $x - x^2 = 0 \implies x(1-x) = 0$.
  \[
    \text{Equilibria: } (0,0) \text{ and } (1,0).
  \]

  \textbf{Step 2: Jacobian.}
  With $f(x,y) = y$ and $g(x,y) = x - x^2$:
  \[
    \pd{f}{x} = 0, \quad \pd{f}{y} = 1, \quad
    \pd{g}{x} = 1 - 2x, \quad \pd{g}{y} = 0.
  \]
  \[
    J(x,y) =
    \begin{pmatrix}
      0 & 1 \\
      1 - 2x & 0
    \end{pmatrix}.
  \]

  \textbf{Step 3: Classify $(0,0)$.}
  \[
    J(0,0) = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.
  \]
  Characteristic equation: $\lambda^2 - 1 = 0 \implies \lambda = \pm 1$.
  Opposite signs $\implies$ \textbf{saddle point} (unstable).

  \textbf{Step 4: Classify $(1,0)$.}
  \[
    J(1,0) = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}.
  \]
  Characteristic equation: $\lambda^2 + 1 = 0 \implies \lambda = \pm i$.
  Purely imaginary eigenvalues $\implies$ \textbf{center by linearization}.
  The linearization predicts closed orbits, but the nonlinear behavior
  requires further analysis (confirmed below to be a true center).
\end{workedexample}

\begin{workedexample}
  \textbf{Linearize and classify the equilibria of the competing species model}
  \[
    \frac{\mathrm{d}x}{\mathrm{d}t} = 2x - x^2 - xy, \qquad
    \frac{\mathrm{d}y}{\mathrm{d}t} = y - y^2 - xy.
  \]

  \textbf{Step 1: Find equilibria.}
  \begin{align}
    x(2 - x - y) &= 0, \label{eq:comp1} \\
    y(1 - x - y) &= 0. \label{eq:comp2}
  \end{align}
  From \cref{eq:comp1}, either $x = 0$ or $x + y = 2$.

  \textit{Case 1:} $x = 0$. From \cref{eq:comp2}: $y(1-y) = 0$, giving $y = 0$ or $y = 1$.
  Equilibria: $(0,0)$ and $(0,1)$.

  \textit{Case 2:} $x + y = 2$, so $y = 2 - x$. From \cref{eq:comp2}: $y(1 - x - y) = y(1 - 2) = -y = 0$,
  so $y = 0$, which gives $x = 2$. Equilibrium: $(2,0)$.

  The three equilibria are $(0,0)$, $(0,1)$, and $(2,0)$.

  \textbf{Step 2: Jacobian.}
  With $f(x,y) = 2x - x^2 - xy$ and $g(x,y) = y - y^2 - xy$:
  \[
    J(x,y) =
    \begin{pmatrix}
      2 - 2x - y & -x \\[4pt]
      -y & 1 - 2y - x
    \end{pmatrix}.
  \]

  \textbf{Step 3: Classify $(0,0)$.}
  \[
    J(0,0) = \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix},
    \quad \lambda_1 = 2,\; \lambda_2 = 1.
  \]
  Both positive $\implies$ \textbf{unstable node (source)}. Both species die out is unstable:
  a small introduction of either population grows.

  \textbf{Step 4: Classify $(0,1)$.}
  \[
    J(0,1) = \begin{pmatrix} 2-1 & 0 \\ -1 & 1-2 \end{pmatrix}
    = \begin{pmatrix} 1 & 0 \\ -1 & -1 \end{pmatrix}.
  \]
  Since $J$ is lower triangular, eigenvalues are the diagonal entries:
  $\lambda_1 = 1$, $\lambda_2 = -1$.
  Opposite signs $\implies$ \textbf{saddle point} (unstable).
  Species~$y$ alone at carrying capacity is unstable to invasion by species~$x$.

  \textbf{Step 5: Classify $(2,0)$.}
  \[
    J(2,0) = \begin{pmatrix} 2-4 & -2 \\ 0 & 1-2 \end{pmatrix}
    = \begin{pmatrix} -2 & -2 \\ 0 & -1 \end{pmatrix}.
  \]
  Upper triangular: $\lambda_1 = -2$, $\lambda_2 = -1$.
  Both negative $\implies$ \textbf{stable node (sink)}.
  Species~$x$ alone at carrying capacity is stable; species~$y$ cannot invade.
\end{workedexample}

\subsection{Trace-Determinant Classification}
\label{sec:ch14_trace_determinant}

Just as for linear systems (\cref{sec:ch08_trace_det}), the trace and determinant
of the Jacobian at an equilibrium provide a quick classification without computing
eigenvalues explicitly.

For $J = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$ at an equilibrium:
\[
  \tau = \tr(J) = a + d, \qquad
  \Delta = \det(J) = ad - bc.
\]
The eigenvalues satisfy $\lambda^2 - \tau\lambda + \Delta = 0$ with
discriminant $D = \tau^2 - 4\Delta$.

\begin{keyresult}
  \textbf{Trace-determinant classification for nonlinear equilibria.}
  Evaluate $\tau = \tr(J)$ and $\Delta = \det(J)$ at the equilibrium point.

  \begin{center}
  \begin{tabular}{l l l}
    \toprule
    \textbf{Region} & \textbf{Conditions} & \textbf{Classification} \\
    \midrule
    $\Delta < 0$ & Below $\tau$-axis & Saddle (unstable) \\[4pt]
    $\Delta > 0$, $\tau > 0$, $D > 0$ & Right, above parabola & Unstable node \\[4pt]
    $\Delta > 0$, $\tau < 0$, $D > 0$ & Left, above parabola & Stable node \\[4pt]
    $\Delta > 0$, $\tau > 0$, $D < 0$ & Right, below parabola & Unstable spiral \\[4pt]
    $\Delta > 0$, $\tau < 0$, $D < 0$ & Left, below parabola & Stable spiral \\[4pt]
    $\Delta > 0$, $\tau = 0$ & On positive $\Delta$-axis & Center (inconclusive) \\
    \bottomrule
  \end{tabular}
  \end{center}
\end{keyresult}

\paragraph{The trace-determinant plane.}

\begin{center}
\begin{tikzpicture}[scale=0.85]
  % Axes
  \draw[->, thick] (-5,0) -- (5,0) node[right] {$\tau$ (trace)};
  \draw[->, thick] (0,-1) -- (0,5) node[above] {$\Delta$ (det)};

  % Parabola \Delta = \tau^2 / 4
  \draw[thick, dashed, red!80] plot[domain=-4.5:4.5, samples=100, smooth, variable=\t]
    ({\t}, {\t*\t/4});
  \node[red!80, font=\footnotesize, anchor=west] at (3.8, 4.3) {$\Delta = \tau^2/4$};

  % Fill saddle region (below \tau-axis)
  \fill[pattern=north west lines, pattern color=red!25] (-5,0) rectangle (5,-0.45);

  % Stability boundary (\tau = 0 line)
  \draw[dashed, thick, blue!60] (0,0) -- (0,5);

  % Labels for regions
  \node[font=\footnotesize, align=center] at (0,-0.25) {\textbf{Saddle}\\$(\Delta < 0)$};

  \node[font=\footnotesize, align=center] at (-3,3.5) {\textbf{Stable node}\\$(\tau < 0,\; D > 0)$};
  \node[font=\footnotesize, align=center] at (3,3.5) {\textbf{Unstable node}\\$(\tau > 0,\; D > 0)$};

  \node[font=\footnotesize, align=center] at (-2,1.1) {\textbf{Stable spiral}\\$(\tau < 0,\; D < 0)$};
  \node[font=\footnotesize, align=center] at (2,1.1) {\textbf{Unstable spiral}\\$(\tau > 0,\; D < 0)$};

  \node[font=\footnotesize, align=center] at (0,4.5) {\textbf{Center}\\$(\tau = 0,\; \Delta > 0)$};

  % Origin
  \filldraw[black] (0,0) circle (1.5pt);
  \node[font=\scriptsize, below left] at (0,0) {$(0,0)$};

  % Parabola tip label
  \node[font=\scriptsize, red!80, align=center] at (0,0.15) {parabola};
\end{tikzpicture}
\end{center}

The parabola $\Delta = \tau^2/4$ separates real from complex eigenvalues.
The $\Delta$-axis ($\tau = 0$) separates stable from unstable systems.
The $\tau$-axis ($\Delta = 0$) separates saddles from nodes/spirals/centers.

\begin{workedexample}
  \textbf{Classify the equilibria of the competing species model from
  the previous section using the trace-determinant plane.}

  Recall the Jacobian:
  \[
    J(x,y) =
    \begin{pmatrix}
      2 - 2x - y & -x \\[4pt]
      -y & 1 - 2y - x
    \end{pmatrix}.
  \]

  \textbf{At $(0,0)$:}
  \[
    \tau = 2 + 1 = 3 > 0, \qquad \Delta = (2)(1) - (0) = 2 > 0.
  \]
  Discriminant: $D = 9 - 8 = 1 > 0$.
  Region: $\tau > 0$, $\Delta > 0$, $D > 0$ $\implies$ \textbf{unstable node}. Consistent with $\lambda = 2, 1$.

  \textbf{At $(0,1)$:}
  \[
    \tau = 1 + (-1) = 0, \qquad \Delta = (1)(-1) - (0) = -1 < 0.
  \]
  Region: $\Delta < 0$ $\implies$ \textbf{saddle point}. Consistent with $\lambda = \pm 1$.

  \textbf{At $(2,0)$:}
  \[
    \tau = (-2) + (-1) = -3 < 0, \qquad \Delta = (-2)(-1) - (0) = 2 > 0.
  \]
  Discriminant: $D = 9 - 8 = 1 > 0$.
  Region: $\tau < 0$, $\Delta > 0$, $D > 0$ $\implies$ \textbf{stable node}. Consistent with $\lambda = -2, -1$.
\end{workedexample}

\subsection{Hartman--Grobman Theorem}
\label{sec:ch14_hartman_grobman}

The linearization tells us about the behavior of the nonlinear system in a
\emph{small neighborhood} of the equilibrium. The Hartman--Grobman theorem
provides the rigorous justification for this connection.

\begin{theorem}[Hartman--Grobman]
  \label{thm:hartman_grobman}
  Let $(x^*,y^*)$ be an equilibrium point of the autonomous system
  $x' = f(x,y)$, $y' = g(x,y)$, where $f$ and $g$ are $C^1$ (continuously differentiable).
  Let $J$ be the Jacobian matrix evaluated at $(x^*,y^*)$.

  If $J$ has \textbf{no eigenvalues with zero real part} (i.e., the equilibrium is
  \textbf{hyperbolic}), then there exists a neighborhood of $(x^*,y^*)$ in which
  the nonlinear system is \textbf{topologically conjugate} to its linearization
  $u' = a u + b v$, $v' = c u + d v$.

  In particular, the local phase portrait of the nonlinear system near $(x^*,y^*)$
  has the same topological structure as that of the linearized system.
\end{theorem}

\paragraph{What topological conjugacy means.}
Two systems are topologically conjugate if there exists a continuous, invertible
change of coordinates (a homeomorphism) that maps the trajectories of one system
onto the trajectories of the other, preserving the direction of time. Practically,
this means:
\begin{itemize}
  \item A stable node of the linearization corresponds to a stable node of the nonlinear system.
  \item A saddle of the linearization corresponds to a saddle of the nonlinear system.
  \item The qualitative flow pattern (arrows, attraction, repulsion) is preserved.
\end{itemize}

The actual shapes of trajectories may differ --- a nonlinear trajectory near
a stable spiral may not be a perfect logarithmic spiral --- but the
essential features (spiraling inward, counterclockwise direction, etc.) are identical.

\paragraph{Limitations: non-hyperbolic equilibria.}
The theorem \textbf{does not apply} when the Jacobian has eigenvalues with zero real part:
\begin{itemize}
  \item \textbf{Centers} ($\lambda = \pm i\beta$): The nonlinear system near a center
        can be a center, a stable spiral, or an unstable spiral. The linearization
        alone cannot distinguish between these cases. Higher-order terms in the
        Taylor expansion must be examined.
  \item \textbf{Non-hyperbolic points} with real zero eigenvalues ($\lambda = 0$):
        The dynamics can be extremely sensitive to nonlinear terms.
        Examples include semi-stable equilibria and bifurcation points.
\end{itemize}

\begin{workedexample}
  \textbf{Hartman--Grobman applies: stable spiral.}

  Consider $x' = -x + y + x(x^2+y^2)$, $y' = -x - y + y(x^2+y^2)$.

  \textit{Equilibrium:} $(0,0)$ (the only one easily found).

  \textit{Jacobian at $(0,0)$:}
  \[
    J(0,0) = \begin{pmatrix} -1 & 1 \\ -1 & -1 \end{pmatrix},
    \quad \tau = -2,\; \Delta = 2,\; D = 4-8 = -4 < 0.
  \]
  Eigenvalues: $\lambda = -1 \pm i$. Both have nonzero real part
  ($\Re(\lambda) = -1 \neq 0$).

  \textbf{Conclusion:} The equilibrium is hyperbolic. By the Hartman--Grobman
  theorem, the nonlinear system near $(0,0)$ is a \textbf{stable spiral},
  topologically equivalent to its linearization.

  (In fact, the nonlinear terms $x(x^2+y^2)$ and $y(x^2+y^2)$ cause
  outward spiraling for large radii, creating a stable limit cycle ---
  but near the origin, the local portrait is exactly a stable spiral.)
\end{workedexample}

\begin{workedexample}
  \textbf{Hartman--Grobman does not apply: center vs.\ spiral.}

  Consider the two systems:
  \begin{align}
    \text{(A)} \quad x' &= y, \quad y' = -x, \\
    \text{(B)} \quad x' &= y + x(x^2+y^2), \quad y' = -x + y(x^2+y^2).
  \end{align}

  \textit{Jacobian at $(0,0)$ for both systems:}
  \[
    J(0,0) = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix},
    \quad \lambda = \pm i.
  \]
  Purely imaginary eigenvalues $\implies$ the equilibrium is \textbf{not hyperbolic}.
  Hartman--Grobman \textbf{does not apply}.

  \textit{System (A):} The linear system. Trajectories are circles $x^2 + y^2 = C$.
  This is a true \textbf{center}.

  \textit{System (B):} Convert to polar coordinates ($x = r\cos\theta$, $y = r\sin\theta$):
  \[
    r' = r^3, \quad \theta' = -1.
  \]
  Since $r' = r^3 > 0$ for $r > 0$, the radius strictly increases.
  The origin is actually an \textbf{unstable spiral}, \emph{not} a center,
  despite the linearization suggesting a center.

  \textbf{Lesson:} When $\lambda = \pm i\beta$, the nonlinear terms determine
  the true behavior. Always use additional tools (Lyapunov functions,
  polar coordinates, first integrals) to resolve non-hyperbolic equilibria.
\end{workedexample}

\subsection{Limit Cycles}
\label{sec:ch14_limit_cycles}

\begin{definition}[Limit cycle]
  A \textbf{limit cycle} is a \textbf{closed, isolated periodic orbit}
  of an autonomous system in the phase plane.
\end{definition}

The key word is \emph{isolated}: a limit cycle is a single closed trajectory
that is not part of a continuous family of closed orbits. Nearby trajectories
either spiral toward the limit cycle (stable limit cycle) or spiral away from
it (unstable limit cycle).

This contrasts with the center in linear systems, where every trajectory near
the equilibrium is a closed orbit forming a continuous family.

\begin{theorem}[Poincar\'{e}--Bendixson]
  \label{thm:poincare_bendixson}
  Let $R$ be a closed, bounded (compact) region in the plane containing no
  equilibrium points, and let a trajectory enter $R$ and remain there for
  all future time $t > 0$. Then the trajectory either:
  \begin{enumerate}
    \item approaches a periodic orbit (a closed trajectory) as $t \to \infty$, or
    \item is itself a periodic orbit.
  \end{enumerate}
\end{theorem}

\paragraph{Implications.}
The Poincar\'{e}--Bendixson theorem is a powerful tool for proving the
existence of limit cycles in two-dimensional systems:
\begin{itemize}
  \item If you can construct a trapping region $R$ that contains no equilibria,
        any trajectory entering $R$ must approach a periodic orbit.
  \item In the plane, the only possible long-term behaviors of bounded
        trajectories are: equilibrium points, periodic orbits (limit cycles),
        or trajectories that approach limit cycles.
  \item \textbf{No chaos in 2D autonomous systems:} Strange attractors and
        chaotic behavior require at least three dimensions.
\end{itemize}

\paragraph{Physical examples.}
Limit cycles model sustained oscillations in physical systems:
\begin{itemize}
  \item \textbf{Electrical circuits:} The van der Pol oscillator models self-sustained
        oscillations in vacuum tube circuits.
  \item \textbf{Chemical reactions:} The Belousov--Zhabotinsky reaction exhibits
        periodic color changes due to a chemical limit cycle.
  \item \textbf{Biological rhythms:} Heartbeat, neural firing, and circadian
        rhythms can be modeled as limit cycles.
  \item \textbf{Mechanical oscillators:} A clock pendulum with a periodic
        driving force (the escapement mechanism) exhibits a limit cycle.
\end{itemize}

\subsection{Lotka--Volterra Predator--Prey Model}
\label{sec:ch14_lotka_volterra}

The Lotka--Volterra model is the classic example of a nonlinear system with
closed orbits, first introduced in the 1920s to model predator--prey
population dynamics.

\paragraph{Biological motivation and model derivation.}
Consider two interacting populations:
\begin{itemize}
  \item $x(t)$: number of \textbf{prey} (e.g., rabbits).
  \item $y(t)$: number of \textbf{predators} (e.g., foxes).
\end{itemize}

We make four biological assumptions:
\begin{enumerate}
  \item In the absence of predators, prey grow exponentially at rate $\alpha$:
        $x' = \alpha x$.
  \item Predators eat prey at a rate proportional to encounters $\alpha xy$.
        Combined with assumption~1: $x' = \alpha x - \beta xy$.
  \item In the absence of prey, predators die off at rate $\gamma$:
        $y' = -\gamma y$.
  \item Predators reproduce at a rate proportional to food consumption $\beta xy$.
        Combined with assumption~3: $y' = \delta xy - \gamma y$.
\end{enumerate}

This yields the \textbf{Lotka--Volterra predator--prey equations}:
\begin{equation}
  \label{eq:lotka_volterra}
  \boxed{
    \frac{\mathrm{d}x}{\mathrm{d}t} = \alpha x - \beta xy, \qquad
    \frac{\mathrm{d}y}{\mathrm{d}t} = \delta xy - \gamma y,
  }
\end{equation}
where $\alpha, \beta, \gamma, \delta > 0$ are parameters.

\begin{definition}[Lotka--Volterra model]
  The Lotka--Volterra predator--prey system is the autonomous nonlinear
  system \cref{eq:lotka_volterra} with $\alpha, \beta, \gamma, \delta > 0$.
  It has two equilibrium points:
  \[
    (0,0) \text{ (extinction)}, \qquad
    \left(\frac{\gamma}{\delta},\, \frac{\alpha}{\beta}\right) \text{ (coexistence)}.
  \]
\end{definition}

\paragraph{Equilibrium analysis.}
Setting the right-hand sides to zero:
\begin{align}
  x(\alpha - \beta y) &= 0, \label{eq:lv_eq1} \\
  y(\delta x - \gamma) &= 0. \label{eq:lv_eq2}
\end{align}
From \cref{eq:lv_eq1}, $x = 0$ or $y = \alpha/\beta$.

\textit{Case 1:} $x = 0$. From \cref{eq:lv_eq2}, $y(\,-\gamma) = 0 \implies y = 0$.
Equilibrium: $(0,0)$.

\textit{Case 2:} $y = \alpha/\beta$. From \cref{eq:lv_eq2},
$\delta x - \gamma = 0 \implies x = \gamma/\delta$.
Equilibrium: $(\gamma/\delta, \alpha/\beta)$.

\paragraph{Jacobian and classification.}
The Jacobian of the system is
\[
  J(x,y) =
  \begin{pmatrix}
    \alpha - \beta y & -\beta x \\[6pt]
    \delta y & \delta x - \gamma
  \end{pmatrix}.
\]

\textbf{At $(0,0)$:}
\[
  J(0,0) = \begin{pmatrix} \alpha & 0 \\ 0 & -\gamma \end{pmatrix},
  \quad \lambda_1 = \alpha > 0,\; \lambda_2 = -\gamma < 0.
\]
Opposite signs $\implies$ \textbf{saddle point} (unstable).
Both populations at zero is unstable: a small number of prey grows,
triggering predator response.

\textbf{At $(\gamma/\delta, \alpha/\beta)$:}
\[
  J\!\left(\frac{\gamma}{\delta}, \frac{\alpha}{\beta}\right)
  =
  \begin{pmatrix}
    0 & -\beta\gamma/\delta \\[6pt]
    \delta\alpha/\beta & 0
  \end{pmatrix}
  =
  \begin{pmatrix}
    0 & -\dfrac{\beta\gamma}{\delta} \\[8pt]
    \dfrac{\delta\alpha}{\beta} & 0
  \end{pmatrix}.
\]
Trace: $\tau = 0$. Determinant: $\Delta = (0) - (-\beta\gamma/\delta)(\delta\alpha/\beta) = \alpha\gamma > 0$.
Characteristic equation: $\lambda^2 + \alpha\gamma = 0$, so
\[
  \lambda = \pm i\sqrt{\alpha\gamma}.
\]
Purely imaginary eigenvalues $\implies$ \textbf{center} by linearization.
Hartman--Grobman does not apply. We must analyze the nonlinear system.

\paragraph{First integral (conservation law).}
The Lotka--Volterra system admits an exact first integral, proving that
the orbits are indeed closed. Divide the two equations:
\[
  \frac{\mathrm{d}y}{\mathrm{d}x}
  = \frac{\delta xy - \gamma y}{\alpha x - \beta xy}
  = \frac{y(\delta x - \gamma)}{x(\alpha - \beta y)}.
\]
Separate variables:
\[
  \frac{\alpha - \beta y}{y}\,\mathrm{d}y
  = \frac{\delta x - \gamma}{x}\,\mathrm{d}x.
\]
Rewrite and integrate:
\[
  \left(\frac{\alpha}{y} - \beta\right)\mathrm{d}y
  = \left(\delta - \frac{\gamma}{x}\right)\mathrm{d}x.
\]
\[
  \alpha \ln y - \beta y = \delta x - \gamma \ln x + C.
\]
Rearranging gives the \textbf{first integral}:
\begin{equation}
  \label{eq:lv_first_integral}
  V(x,y) = \delta x - \gamma \ln x + \beta y - \alpha \ln y = \text{constant}.
\end{equation}
Each value of $C$ defines a closed orbit in the phase plane.
The function $V(x,y)$ has a strict global minimum at the coexistence equilibrium
$(\gamma/\delta, \alpha/\beta)$, and level curves $V(x,y) = C$ for
$C > V_{\min}$ are closed curves surrounding this point.

\begin{keyresult}
  \textbf{Lotka--Volterra closed orbits.}
  The coexistence equilibrium $(\gamma/\delta, \alpha/\beta)$ is a true
  center for the nonlinear system. Every solution starting in the
  first quadrant $(x > 0, y > 0)$ traces a closed orbit around
  the coexistence point, determined by the initial conditions through
  the first integral \cref{eq:lv_first_integral}.
\end{keyresult}

\paragraph{Nullclines.}
The \textbf{nullclines} are curves in the phase plane where one of the
derivatives vanishes:
\begin{itemize}
  \item \textbf{$x$-nullcline} ($x' = 0$): $x = 0$ or $y = \alpha/\beta$.
        On $x = 0$, the prey population is zero.
        On $y = \alpha/\beta$ (horizontal line), the prey population
        is momentarily stationary.
  \item \textbf{$y$-nullcline} ($y' = 0$): $y = 0$ or $x = \gamma/\delta$.
        On $y = 0$, the predator population is zero.
        On $x = \gamma/\delta$ (vertical line), the predator population
        is momentarily stationary.
\end{itemize}
The two nontrivial nullclines intersect at the coexistence equilibrium
$(\gamma/\delta, \alpha/\beta)$. The nullclines divide the first quadrant
into four regions, each with a characteristic direction of motion:
\begin{itemize}
  \item Region I ($x > \gamma/\delta, y < \alpha/\beta$): $x' > 0$, $y' > 0$
        $\implies$ motion up and right.
  \item Region II ($x < \gamma/\delta, y < \alpha/\beta$): $x' > 0$, $y' < 0$
        $\implies$ motion down and right.
  \item Region III ($x < \gamma/\delta, y > \alpha/\beta$): $x' < 0$, $y' < 0$
        $\implies$ motion down and left.
  \item Region IV ($x > \gamma/\delta, y > \alpha/\beta$): $x' < 0$, $y' > 0$
        $\implies$ motion up and left.
\end{itemize}
The resulting flow is counterclockwise around the equilibrium.

\begin{workedexample}
  \textbf{Full analysis of the Lotka--Volterra system with parameters}
  $\alpha = 1.5$, $\beta = 1$, $\delta = 3$, $\gamma = 1$.

  \textbf{System:}
  \[
    \frac{\mathrm{d}x}{\mathrm{d}t} = 1.5\,x - x y, \qquad
    \frac{\mathrm{d}y}{\mathrm{d}t} = 3\,x y - y.
  \]

  \textbf{Equilibria:}
  \[
    (0,0) \text{ and } \left(\frac{\gamma}{\delta}, \frac{\alpha}{\beta}\right)
    = \left(\frac{1}{3}, \frac{1.5}{1}\right) = \left(\frac{1}{3}, 1.5\right).
  \]

  \textbf{Jacobian:}
  \[
    J(x,y) =
    \begin{pmatrix}
      1.5 - y & -x \\[6pt]
      3y & 3x - 1
    \end{pmatrix}.
  \]

  \textbf{At $(0,0)$:}
  \[
    J(0,0) = \begin{pmatrix} 1.5 & 0 \\ 0 & -1 \end{pmatrix},
    \quad \lambda_1 = 1.5 > 0,\; \lambda_2 = -1 < 0.
  \]
  \textbf{Saddle point} (unstable).

  \textbf{At $(1/3, 1.5)$:}
  \[
    J\!\left(\tfrac{1}{3}, 1.5\right)
    = \begin{pmatrix} 0 & -1/3 \\ 4.5 & 0 \end{pmatrix}.
  \]
  \[
    \tau = 0, \quad \Delta = (0) - (-1/3)(4.5) = 1.5.
  \]
  \[
    \lambda = \pm i\sqrt{1.5} \approx \pm 1.225\,i.
  \]
  Purely imaginary eigenvalues. The coexistence point is a \textbf{center}
  (confirmed by the first integral, not just linearization).

  \textbf{Nullclines:}
  \begin{itemize}
    \item $x$-nullcline: $x = 0$ or $y = 1.5$ (horizontal line).
    \item $y$-nullcline: $y = 0$ or $x = 1/3$ (vertical line).
  \end{itemize}

  \textbf{First integral:}
  \[
    V(x,y) = 3x - \ln x + y - 1.5\,\ln y = \text{constant}.
  \]

  \textbf{Period of oscillation:} Near the equilibrium, the period is
  approximately $T \approx 2\pi/\sqrt{\alpha\gamma} = 2\pi/\sqrt{1.5}
  \approx 5.13$ time units.
\end{workedexample}

\paragraph{Phase portrait.}

\begin{center}
\begin{tikzpicture}[scale=0.9]
  % Axes
  \draw[->, thick] (-0.3,0) -- (5,0) node[right] {$x$ (prey)};
  \draw[->, thick] (0,-0.3) -- (0,5) node[above] {$y$ (predator)};

  % Nullclines
  \draw[dashed, thick, blue!60] (0.333,0) -- (0.333,4.5) node[above, font=\scriptsize, blue!60] {$x=1/3$};
  \draw[dashed, thick, red!60] (0,1.5) -- (4.8,1.5) node[right, font=\scriptsize, red!60] {$y=1.5$};

  % Closed orbits (ellipses centered at (1/3, 1.5))
  % Inner orbit
  \draw[thick, purple!80] (0.333,1.5) ellipse (0.6 and 0.6);
  % Middle orbit
  \draw[thick, purple!80] (0.333,1.5) ellipse (1.2 and 1.2);
  % Outer orbit
  \draw[thick, purple!80] (0.333,1.5) ellipse (1.9 and 1.8);

  % Arrows on orbits (counterclockwise)
  % Inner orbit arrows
  \draw[thick, purple!80, ->] (0.933,1.5) -- (0.983,1.68);
  \draw[thick, purple!80, ->] (0.333,2.1) -- (0.163,2.08);
  \draw[thick, purple!80, ->] (-0.267,1.5) -- (-0.267,1.28);
  \draw[thick, purple!80, ->] (0.333,0.9) -- (0.503,0.92);

  % Middle orbit arrows
  \draw[thick, purple!80, ->] (1.533,1.5) -- (1.613,1.75);
  \draw[thick, purple!80, ->] (0.333,2.7) -- (0.093,2.68);
  \draw[thick, purple!80, ->] (-0.867,1.5) -- (-0.867,1.18);
  \draw[thick, purple!80, ->] (0.333,0.3) -- (0.573,0.32);

  % Equilibrium points
  \filldraw[black] (0,0) circle (2.5pt) node[below left=1pt] {$(0,0)$};
  \filldraw[black] (0.333,1.5) circle (2.5pt) node[below right=1pt] {$(\gamma/\delta,\,\alpha/\beta)$};

  % Region labels
  \node[font=\scriptsize, align=center, blue!60] at (2.5,2.5) {Region I\\($x' > 0,\; y' > 0$)};
  \node[font=\scriptsize, align=center, blue!60] at (2.5,0.5) {Region II\\($x' > 0,\; y' < 0$)};
  \node[font=\scriptsize, align=center, blue!60] at (-0.7,2.5) {Region III\\($x' < 0,\; y' < 0$)};
  \node[font=\scriptsize, align=center, blue!60] at (-0.7,0.5) {Region IV\\($x' < 0,\; y' > 0$)};

  % Legend
  \node[font=\footnotesize, align=left, anchor=west] at (1.2,4.2) {
    \textcolor{blue!60}{\rule{6pt}{1pt}} $x$-nullcline \\
    \textcolor{red!60}{\rule{6pt}{1pt}} $y$-nullcline \\
    \textcolor{purple!80}{\rule{6pt}{1pt}} Closed orbits
  };
\end{tikzpicture}
\end{center}

\paragraph{Interpretation of the oscillations.}
The closed orbits correspond to periodic predator--prey cycles:
\begin{enumerate}
  \item Prey population grows (few predators) $\to$ predators have abundant food.
  \item Predator population grows $\to$ predation pressure increases.
  \item Prey population declines $\to$ predators face food shortage.
  \item Predator population declines $\to$ prey can recover.
  \item Cycle repeats.
\end{enumerate}
The amplitude of the oscillation is determined by the initial conditions:
the further the initial point from the equilibrium, the larger the orbit.

\paragraph{Limitations of the model.}
The Lotka--Volterra model has several simplifications:
\begin{itemize}
  \item Unlimited prey growth in the absence of predators (no carrying capacity).
  \item Linear functional response (predation rate proportional to $xy$).
  \item No time delays in predator reproduction.
  \item Homogeneous mixing (well-mixed populations).
\end{itemize}
Realistic extensions include logistic prey growth, Holling-type functional
responses, and more complex age-structured models. These modifications can
create stable limit cycles (rather than neutral centers) and richer dynamics.

\subsection{Summary}
\label{sec:ch14_summary}

Nonlinear systems cannot be solved by superposition, but their qualitative
behavior near equilibria is accessible through linearization. The Jacobian
matrix, combined with the trace-determinant classification, provides a
systematic framework for understanding local dynamics. The Hartman--Grobman
theorem guarantees that this linear picture is topologically correct for
hyperbolic equilibria. Global phenomena like limit cycles require additional
tools: the Poincar\'{e}--Bendixson theorem, first integrals, and Lyapunov
functions.

\begin{table}[htbp]
\centering
\caption{Chapter 14 Summary: Nonlinear Systems}
\label{tab:ch14_summary}
\begin{tabular}{l p{8.5cm}}
\toprule
\textbf{Concept} & \textbf{Key Formula/Method} \\
\midrule
Nonlinear autonomous system & $\displaystyle x' = f(x,y), \;\; y' = g(x,y)$, no superposition \\
Equilibrium point & Solve $f(x^*,y^*) = 0$, $g(x^*,y^*) = 0$ \\
Jacobian matrix & $J = \begin{pmatrix} \pd{f}{x} & \pd{f}{y} \\[4pt] \pd{g}{x} & \pd{g}{y} \end{pmatrix}$ \\
Linearized system & $\begin{pmatrix} u' \\ v' \end{pmatrix} = J(x^*,y^*) \begin{pmatrix} u \\ v \end{pmatrix}$, $u=x-x^*$, $v=y-y^*$ \\
Trace-determinant & $\tau = \tr(J)$, $\Delta = \det(J)$, $D = \tau^2 - 4\Delta$ \\
Hartman--Grobman theorem & Hyperbolic equilibria ($\Re(\lambda) \neq 0$): nonlinear $\cong$ linearization \\
Non-hyperbolic case & $\Re(\lambda) = 0$: linearization inconclusive; use first integrals, Lyapunov functions \\
Limit cycle & Closed, isolated periodic orbit \\
Poincar\'{e}--Bendixson theorem & Bounded trajectory in 2D with no equilibria $\implies$ periodic orbit \\
Lotka--Volterra model & $x' = \alpha x - \beta xy$, $y' = \delta xy - \gamma y$ \\
LV equilibria & $(0,0)$ saddle; $(\gamma/\delta, \alpha/\beta)$ center (closed orbits) \\
LV first integral & $V(x,y) = \delta x - \gamma\ln x + \beta y - \alpha\ln y = C$ \\
LV nullclines & $x$-nullcline: $y = \alpha/\beta$; $y$-nullcline: $x = \gamma/\delta$ \\
\bottomrule
\end{tabular}
\end{table}

\begin{hintbox}
  \textbf{Problem-solving workflow for nonlinear autonomous systems.}
  \begin{enumerate}
    \item Find all equilibrium points by solving $f(x,y) = 0$, $g(x,y) = 0$.
    \item Compute the Jacobian matrix $J(x,y)$ and evaluate it at each equilibrium.
    \item Classify each equilibrium using eigenvalues or the trace-determinant plane.
    \item Apply the Hartman--Grobman theorem: if the equilibrium is hyperbolic,
          the local phase portrait matches the linear classification.
    \item For non-hyperbolic equilibria ($\Re(\lambda) = 0$), use additional tools:
          first integrals, Lyapunov functions, or polar coordinates.
    \item Draw nullclines to understand the flow direction in each region.
    \item Look for limit cycles using the Poincar\'{e}--Bendixson theorem
          (requires constructing a trapping region).
    \item Sketch the full phase portrait combining local and global information.
  \end{enumerate}
\end{hintbox}
