For Undergraduates

Ordinary Differential Equations

Interactive undergraduate guide covering existence theory, exact and first-order equations, linear higher-order equations, simultaneous systems, Pfaffian forms, and qualitative phase-plane analysis. Includes worked examples, interactive solvers, phase portraits, and short puzzles.

How to Use This Guide

  • Read definitions and theorem statements carefully.
  • Use the interactive calculators — change coefficients and observe solutions.
  • Explore the phase-plane visualizer by choosing different linear systems.
  • Attempt every purple-bordered puzzle; solutions appear after you click.

Equations are rendered with MathJax. Wait a moment if they appear broken on first load.

Picard’s Existence Theorem

Theorem (Statement only)

Consider the initial-value problem \[ \frac{dy}{dx} = f(x,y),\qquad y(x_0)=y_0. \] If \( f \) is continuous in a rectangle containing \( (x_0,y_0) \) and satisfies a Lipschitz condition in \( y \) (uniformly in \( x \)), then there exists a unique solution defined in some interval around \( x_0 \).

The Lipschitz condition is often verified by showing that \( \partial f/\partial y \) is continuous (hence bounded) on a closed rectangle. Picard’s theorem guarantees local existence and uniqueness; global behaviour requires further analysis.

Quick Check

For \( y' = y^{1/3} \), \( y(0)=0 \): \( f \) is continuous but \( \partial f/\partial y \) blows up at \( y=0 \), so uniqueness may fail. Indeed both \( y\equiv 0 \) and \( y = (\tfrac{2}{3}x)^{3/2} \) (for \( x\ge 0 \)) are solutions.

Exact Differential Equations

A first-order equation written in differential form \[ M(x,y)\,dx + N(x,y)\,dy = 0 \] is exact if there exists a function \( F(x,y) \) such that \( dF = M\,dx + N\,dy \), i.e. \[ \frac{\partial F}{\partial x} = M,\qquad \frac{\partial F}{\partial y} = N. \]

Condition of Integrability

If \( M \) and \( N \) have continuous first partial derivatives, then the equation is exact if and only if \[ \frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}. \]

When exact, the solution is given (implicitly) by \( F(x,y) = C \), where \[ F = \int M\,dx + \int\Bigl(N - \frac{\partial}{\partial y}\int M\,dx\Bigr)dy. \]

Equations Reducible to Exact Form

If the equation is not exact, an integrating factor \( \mu(x,y) \) may convert it into an exact equation. Special cases:

Exactness Checker & Solution Sketch

Enter polynomials or simple expressions for M and N (use * for multiplication, e.g. 2*x*y).

Worked Example

\( (2xy + y)\,dx + (x^2 + x)\,dy = 0 \)

\( M = 2xy+y \), \( N = x^2+x \).
\( M_y = 2x+1 \), \( N_x = 2x+1 \) → exact.
\( F = \int M\,dx = x^2 y + xy + h(y) \).
\( F_y = x^2 + x + h'(y) = N \) ⇒ \( h'=0 \).
Solution: \( x^2 y + xy = C \) or \( xy(x+1)=C \).

Equations of First Order and Higher Degree

Equations of the form \( F(x,y,p)=0 \) where \( p = dy/dx \) and the degree in \( p \) is greater than 1.

Solvable for \( p \)

If the equation can be factored as \( (p-f_1(x,y))(p-f_2(x,y))\cdots=0 \), each factor \( p = f_i(x,y) \) is a first-order first-degree equation that can be solved separately. The general solution is the collection of all such solutions.

Solvable for \( y \)

When \( y = f(x,p) \), differentiate both sides with respect to \( x \): \[ p = \frac{\partial f}{\partial x} + \frac{\partial f}{\partial p}\frac{dp}{dx}. \] This yields a first-order equation in \( p \) and \( x \). Solve for \( p \), then substitute back.

Solvable for \( x \)

When \( x = f(y,p) \), differentiate with respect to \( y \): \[ \frac{1}{p} = \frac{\partial f}{\partial y} + \frac{\partial f}{\partial p}\frac{dp}{dy}. \] Proceed analogously.

Interactive Slope Field Lab

Visualise the direction field of a first-order equation \( y' = f(x,y) \) and overlay numerical solution curves (Euler / improved Euler) starting from points you click or specify.

to to

Blue segments = slope field. Green curve = numerical solution through (x₀,y₀). Click the canvas to set a new initial condition.

Clairaut’s Form & Singular Solutions

Clairaut’s Equation

\[ y = px + f(p). \] Differentiating with respect to \( x \) gives \[ p = p + \bigl(x + f'(p)\bigr)\frac{dp}{dx} \implies \bigl(x + f'(p)\bigr)p' = 0. \] Hence either \( p' = 0 \) (so \( p = c \)) or \( x + f'(p) = 0 \).

  • General solution: \( y = cx + f(c) \) (family of straight lines).
  • Singular solution: eliminate \( p \) between \( y = px + f(p) \) and \( x + f'(p) = 0 \). It is the envelope of the family of general solutions.

Clairaut Solver (for \( y = px + f(p) \))

Enter f(p) as a simple expression in p (e.g. p*p, 1/p, p*p*p).

Worked Example

\( y = px + p^2 \)

General solution: \( y = cx + c^2 \).
Singular: \( x + 2p = 0 \) ⇒ \( p = -x/2 \). Substitute: \( y = (-x/2)x + (x/2)^2 = -x^2/2 + x^2/4 = -x^2/4 \).
Envelope of the family of lines \( y = cx + c^2 \) is the parabola \( y = -x^2/4 \).

🧩 Puzzle: Envelope

The singular solution of a Clairaut equation is geometrically the … of the family of general solutions.

asymptote
envelope
caustic
orthogonal trajectory

Linear Differential Equations of Second Order

The general second-order linear equation is \[ y'' + P(x)y' + Q(x)y = R(x). \] The associated homogeneous equation is \( y'' + P y' + Q y = 0 \).

Wronskian

If \( y_1 \) and \( y_2 \) are solutions of the homogeneous equation, their Wronskian is \[ W(y_1,y_2) = y_1 y_2' - y_2 y_1'. \] They are linearly independent on an interval if and only if \( W\not\equiv 0 \) there. Abel’s identity: \( W(x) = W(x_0)\exp\bigl(-\int_{x_0}^x P(t)\,dt\bigr) \).

If \( \{y_1,y_2\} \) is a fundamental set of solutions of the homogeneous equation, the general solution of the non-homogeneous equation is \[ y = c_1 y_1 + c_2 y_2 + y_p, \] where \( y_p \) is any particular solution.

Wronskian Calculator (for two functions)

Constant Coefficient Equations & Particular Integrals

For \( y'' + a y' + b y = 0 \) the characteristic equation is \( r^2 + a r + b = 0 \).

RootsGeneral solution
Distinct real \( r_1,r_2 \)\( y = c_1 e^{r_1 x} + c_2 e^{r_2 x} \)
Repeated real \( r \)\( y = (c_1 + c_2 x)e^{rx} \)
Complex \( \alpha\pm i\beta \)\( y = e^{\alpha x}(c_1\cos\beta x + c_2\sin\beta x) \)

Particular Integral (Undetermined Coefficients)

Standard trial forms for \( R(x) \):

Constant-Coefficient Homogeneous Solver

Solved Problem

\( y'' - 3y' + 2y = e^{3x} \)

Characteristic: \( r^2 - 3r + 2 = 0 \) ⇒ \( (r-1)(r-2)=0 \) ⇒ \( y_h = c_1 e^x + c_2 e^{2x} \).
Trial \( y_p = A e^{3x} \). Then \( 9A - 9A + 2A = 1 \) ⇒ \( A = 1/2 \).
General solution: \( y = c_1 e^x + c_2 e^{2x} + \tfrac12 e^{3x} \).

Solution Curve Laboratory (Chart.js)

Plot the analytic solution of the constant-coefficient IVP \( y'' + a y' + b y = 0 \) with initial data \( y(0)=y_0 \), \( y'(0)=y_0' \). Compare different root types side-by-side.

Method of Variation of Parameters

Second-Order Case

Given a fundamental set \( \{y_1,y_2\} \) of the homogeneous equation, seek \( y_p = u_1(x) y_1 + u_2(x) y_2 \) where \[ u_1' y_1 + u_2' y_2 = 0, \qquad u_1' y_1' + u_2' y_2' = R(x). \] Solving the linear system yields \[ u_1' = -\frac{y_2 R}{W},\qquad u_2' = \frac{y_1 R}{W}. \] Integrate to obtain \( u_1,u_2 \).

Worked Example

\( y'' + y = \sec x \)

Homogeneous solutions: \( y_1=\cos x \), \( y_2=\sin x \), \( W=1 \).
\( u_1' = -\sin x\cdot\sec x = -\tan x \), \( u_2' = \cos x\cdot\sec x = 1 \).
\( u_1 = \ln|\cos x| \), \( u_2 = x \) (up to constants absorbed into homogeneous part).
\( y_p = \cos x\ln|\cos x| + x\sin x \).

Reduction of Order

If one solution \( y_1 \) of the homogeneous second-order linear equation is known, a second independent solution is given by \[ y_2 = y_1\int\frac{e^{-\int P\,dx}}{y_1^2}\,dx. \] (This follows from the Abel formula for the Wronskian.)

Example

For \( x^2 y'' - 3x y' + 3y = 0 \) (Euler), one solution is \( y_1 = x \). Then \( y_2 = x\int x^{-2}\,dx = -1 \) (after simplification), giving the independent solution \( y_2 = x^3 \) after adjusting constants / recognizing the Euler form.

Homogeneous Linear Equation of n-th Order (Constant Coefficients)

For \( y^{(n)} + a_{n-1} y^{(n-1)} + \cdots + a_0 y = 0 \) the characteristic polynomial is \[ r^n + a_{n-1} r^{n-1} + \cdots + a_0 = 0. \] Each real root \( r \) of multiplicity \( m \) contributes \( (c_0 + c_1 x + \cdots + c_{m-1} x^{m-1}) e^{rx} \).
Each complex conjugate pair \( \alpha\pm i\beta \) of multiplicity \( m \) contributes \( e^{\alpha x}\bigl[(A_0+\cdots+A_{m-1}x^{m-1})\cos\beta x + (B_0+\cdots+B_{m-1}x^{m-1})\sin\beta x\bigr] \).

Simultaneous Linear Ordinary Differential Equations

Systems of the form \[ \frac{dx}{dt} = a_{11}x + a_{12}y + f(t),\qquad \frac{dy}{dt} = a_{21}x + a_{22}y + g(t) \] can be solved by elimination (reducing to a second-order equation in one variable) or by matrix methods (eigenvalues of the coefficient matrix).

Form \( \dfrac{dx}{P} = \dfrac{dy}{Q} = \dfrac{dz}{R} \)

This is equivalent to the autonomous system \( \frac{dx}{dt}=P \), \( \frac{dy}{dt}=Q \), \( \frac{dz}{dt}=R \). Two independent integrals \( u(x,y,z)=c_1 \), \( v(x,y,z)=c_2 \) give the general solution.

Pfaffian Equations

A Pfaffian equation in three variables is \[ P\,dx + Q\,dy + R\,dz = 0. \]

Integrability Condition

A necessary and sufficient condition for the existence of an integrating factor that turns the Pfaffian into an exact differential \( dF = 0 \) (so that \( F=\text{const} \) is the integral) is \[ P\bigl(\tfrac{\partial Q}{\partial z}-\tfrac{\partial R}{\partial y}\bigr) + Q\bigl(\tfrac{\partial R}{\partial x}-\tfrac{\partial P}{\partial z}\bigr) + R\bigl(\tfrac{\partial P}{\partial y}-\tfrac{\partial Q}{\partial x}\bigr) = 0. \] Equivalently \( \mathbf{V}\cdot(\nabla\times\mathbf{V})=0 \) where \( \mathbf{V}=(P,Q,R) \).

Qualitative Studies: Equilibrium Points & Phase Plane

For an autonomous system \[ \mathbf{x}' = \mathbf{F}(\mathbf{x}), \] equilibrium (critical) points satisfy \( \mathbf{F}(\mathbf{x}^*)=0 \). Linearization about an equilibrium yields a linear system \( \mathbf{u}' = A\mathbf{u} \) whose eigenvalues determine the local phase portrait.

Classification of Linear Equilibria (2-D)

EigenvaluesTypeStability
Real, opposite signsSaddleUnstable
Real, same sign, distinctNodeAsymptotically stable if both negative
Real, repeatedImproper node / degenerateDepends on sign
Pure imaginaryCentreStable (not asymptotic)
Complex with nonzero real partSpiral (focus)Stable if Re < 0

Interactive Phase-Plane Plotter (Linear System)

System: \( x' = a x + b y \), \( y' = c x + d y \). Choose coefficients and click Plot.

Interpretation Tips
  • Arrows show the direction of the vector field \( (ax+by,\; cx+dy) \).
  • Trajectories are integral curves; closed curves around a centre correspond to periodic orbits.
  • Saddles have stable and unstable manifolds (separatrices).

3D Phase Portrait (Three.js)

Visualise trajectories of a 3-dimensional linear system \( \mathbf{x}' = A\mathbf{x} \) in \(\mathbb{R}^3\). Rotate the view with the mouse (drag). The coloured curves are numerical trajectories from different initial conditions; the grey axes show the coordinate frame.

Drag to rotate · Scroll to zoom

Puzzle & Minigame Hub

1. Exact or Not?

Is \( (3x^2 + 2xy)\,dx + (x^2 + 2y)\,dy = 0 \) exact?

Yes — \( M_y = 2x = N_x \)
No — needs integrating factor
Only after multiplying by \( x \)

2. Characteristic Roots

For \( y'' + 4y = 0 \) the general solution is

\( c_1 e^{2x} + c_2 e^{-2x} \)
\( c_1\cos 2x + c_2\sin 2x \)
\( (c_1 + c_2 x)e^{2x} \)
\( c_1 e^{4x} + c_2 \)

3. Equilibrium Type

The linear system with matrix \( \begin{pmatrix} 0 & 1 \\ -2 & -3 \end{pmatrix} \) has eigenvalues −1 and −2. The origin is a

Stable node
Saddle
Centre
Unstable spiral

4. Clairaut Singular Solution

For \( y = px + \sqrt{p} \) the singular solution is obtained by eliminating p between the equation and

\( p = c \)
\( x + \tfrac12 p^{-1/2} = 0 \)
\( y = 0 \)

5. Wronskian Vanishes?

If two solutions of a second-order linear homogeneous ODE have Wronskian identically zero, they are

Linearly dependent
Linearly independent
Neither — need more information