Skip to content
Math Analysis 2

Ordinary differential equations: first order and second-order linear

Direction fields and existence and uniqueness, separable equations, first-order linear equations and the RC circuit, second order with constant coefficients, RLC and resonance.

A differential equation links an unknown function to its derivatives. It is the natural way of writing the laws of physics, which say how things change: Newton’s second law, the charging of a capacitor, the cooling of a component, the growth of a population. In this lesson we cover the most important first-order equations, the existence and uniqueness theorem, and second-order linear equations with constant coefficients, which describe oscillators and RLC circuits.

Definitions

An ordinary differential equation of order n links y(t) to its derivatives up to y^{(n)}. An initial value problem (Cauchy problem) adds initial conditions: for first order the value y(t_0) = y_0, for second order also the derivative y'(t_0).

The geometric meaning

A first-order equation y' = f(t, y) assigns a slope to every point of the plane. Drawing a short dash with that slope at many points gives the direction field, and the solutions are the curves that follow the dashes.

Direction field of the logistic equation with some solutions tending to 1
The direction field of y' = y(1 - y) and four solutions with different initial conditions. All those starting with y \gt 0 tend to the equilibrium y = 1: those below rise with the typical S shape, the one above comes down.

Existence and uniqueness theorem (Picard-Lindelöf). If f is continuous and has a continuous derivative \partial f/\partial y near (t_0, y_0), the initial value problem has exactly one solution near t_0. Geometrically: exactly one solution curve passes through each point, and two different solutions never cross. In the figure the solutions never cross the line y = 1, which is itself a solution.

Separable equations

They have the form y' = a(t)\,b(y). If b(y_0) = 0, the constant y = y_0 is a solution. Otherwise separate the variables and integrate:

    \[ \int\frac{dy}{b(y)} = \int a(t)\,dt \]

Example: Newton’s law of cooling. A heat sink at temperature T in surroundings at T_a cools as T' = -k(T - T_a). Separating: \ln|T - T_a| = -kt + c, so

    \[ T(t) = T_a + (T_0 - T_a)\,e^{-kt} \]

The temperature difference halves every \ln 2/k seconds, the same exponential law as a capacitor discharging.

Example: the logistic equation in the figure, y' = y(1 - y). Separating with partial fractions, \frac{1}{y(1 - y)} = \frac1y + \frac{1}{1 - y}, gives \ln\left|\frac{y}{1 - y}\right| = t + c and

    \[ y(t) = \frac{1}{1 + \left(\frac{1}{y_0} - 1\right)e^{-t}} \]

It is the model of growth that slows as resources run out: populations, the spread of a product on the market, epidemics.

First-order linear equations

    \[ y' + a(t)\,y = b(t) \]

Proof of the solution formula

Let A(t) be an antiderivative of a(t). Multiplying by the integrating factor e^{A(t)}, the left side becomes the derivative of a product:

    \[ \big(e^{A(t)}y\big)' = e^{A(t)}y' + a(t)e^{A(t)}y = e^{A(t)}b(t) \]

Integrating:

    \[ y(t) = e^{-A(t)}\left(\int e^{A(t)}b(t)\,dt + C\right) \]

Example: charging a capacitor. In an RC circuit driven by a voltage step E, the capacitor voltage satisfies RC\,v' + v = E. With \tau = RC, a = 1/\tau, b = E/\tau:

    \[ v(t) = E + (v_0 - E)\,e^{-t/\tau} \]

Starting from empty, after a time \tau the capacitor is at 63% of E, after 5\tau at more than 99%.

Second-order linear equations with constant coefficients

    \[ a\,y'' + b\,y' + c\,y = f(t) \]

As for linear systems (the Geometry and Algebra lesson on Rouché-Capelli), the general solution is one particular solution plus the general solution of the homogeneous equation. The solutions of the homogeneous equation form a vector space of dimension 2.

The homogeneous equation: the characteristic equation

Looking for solutions of the form e^{\lambda t} gives a\lambda^2 + b\lambda + c = 0. Three cases:

RootsGeneral solution of the homogeneous equation
distinct real \lambda_1, \lambda_2C_1 e^{\lambda_1 t} + C_2 e^{\lambda_2 t}
repeated real \lambda(C_1 + C_2 t)\,e^{\lambda t}
complex \alpha \pm i\betae^{\alpha t}\big(C_1\cos\beta t + C_2\sin\beta t\big)

The complex case follows from Euler’s formula: e^{(\alpha + i\beta)t} = e^{\alpha t}(\cos\beta t + i\sin\beta t), and the real and imaginary parts are two independent real solutions.

Example: the series RLC circuit with no source, L\,q'' + R\,q' + q/C = 0. The characteristic equation has discriminant R^2 - 4L/C:

  • R \gt 2\sqrt{L/C}: negative real roots, the charge decays without oscillating (overdamped);
  • R = 2\sqrt{L/C}: a repeated root, the fastest return without oscillation (critically damped);
  • R \lt 2\sqrt{L/C}: complex roots, a damped oscillation with angular frequency \beta = \sqrt{1/(LC) - R^2/(4L^2)} (underdamped).

They are the same three regimes as the pendulum with friction in the Physics 1 lesson on oscillations: the same equation, with the same solutions.

The particular solution

For forcing terms f(t) that are polynomials, exponentials, sines or cosines, use the method of undetermined coefficients: try a solution of the same form with coefficients to be found. If that form matches a solution of the homogeneous equation (resonance), multiply it by t.

Example. y'' + y = \cos 2t. The homogeneous equation has solutions C_1\cos t + C_2\sin t. Try y_p = A\cos 2t: -4A + A = 1, A = -\tfrac13. General solution: y = C_1\cos t + C_2\sin t - \tfrac13\cos 2t. If instead the forcing were \cos t, at the system’s own natural frequency, you would have to try t(A\cos t + B\sin t): the amplitude grows linearly in time, which is undamped resonance.

Beyond: systems and numerical methods

An equation of order n is equivalent to a system of n first-order equations, \mathbf x' = A\mathbf x, which in the constant-coefficient case is solved with the eigenvalues of A, as seen in Geometry and Algebra. When there is no closed-form solution, numerical methods are used: Euler’s method (y_{k+1} = y_k + h\,f(t_k, y_k)) follows the direction field in small steps, and Runge-Kutta methods do the same with far more accuracy. It is what SPICE does when it simulates a circuit in time.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x