Methods for Ordinary Differential Equations

Part 14, Chapter 14: Differential Equations

Learning objectives

  • Solve first-order separable ODEs by separating variables and integrating
  • Solve first-order linear ODEs using the integrating factor
  • Solve second-order linear constant-coefficient ODEs via the characteristic equation
  • Read the qualitative behavior (decay, growth, oscillation) from the characteristic roots

You will not solve every ODE by hand, but the three or four techniques in this section cover everything that turns up in mechanics, circuits, population dynamics, and elementary chemistry. Separable equations let you integrate when the variables decouple. The integrating factor turns first-order linear into a pure derivative you can integrate back. And for second-order linear constant-coefficient equations, the characteristic polynomial reduces the entire problem to root-finding: real distinct roots give exponentials, complex roots give oscillations, repeated roots produce a polynomial factor. Once you know which technique to deploy, the algebra is mechanical.

First-order separable

An ODE is separable if it has the form dy/dx=g(x)h(y)dy/dx = g(x) h(y). Solve by separating dy/h(y)=g(x),dxdy/h(y) = g(x) \, dx and integrating both sides:

displaystyleintdfracdyh(y)=displaystyleintg(x),dx+C\displaystyle\int \dfrac{dy}{h(y)} = \displaystyle\int g(x) \, dx + C

Solve algebraically for yy if possible. Example: dy/dx=xydy/dx = xy separates to dy/y=x,dxdy/y = x \, dx, integrates to lny=x2/2+C\ln|y| = x^2/2 + C, exponentiates to y=Aex2/2y = A e^{x^2/2}.

First-order linear: the integrating factor

A first-order linear ODE has the form y+p(x)y=q(x)y' + p(x) y = q(x). The integrating factor mu(x)=eintp(x),dx\mu(x) = e^{\int p(x) \, dx} is chosen so that multiplying through gives

\dfrac{d}{dx}\bigl[\mu(x) y\bigr] = \mu(x) q(x)

The left side is a pure derivative; integrate and solve for yy. Example: y+2y=4y' + 2y = 4. Here p=2p = 2, so mu=e2x\mu = e^{2x}. Multiplying gives (e2xy)=4e2x(e^{2x} y)' = 4 e^{2x}, integrate to e2xy=2e2x+Ce^{2x} y = 2 e^{2x} + C, so y=2+Ce2xy = 2 + C e^{-2x}.

Second-order linear constant-coefficient: characteristic equation

For ay+by+cy=0a y'' + b y' + c y = 0 with a,b,ca, b, c constant, substitute y=erxy = e^{rx}. The factor erxe^{rx} never vanishes, so the equation reduces to the characteristic equation:

ar2+br+c=0a r^2 + b r + c = 0

The three cases of the quadratic:

  • Two distinct real roots r1,r2r_1, r_2: general solution y=C1er1x+C2er2xy = C_1 e^{r_1 x} + C_2 e^{r_2 x}. Each root contributes an exponential; sign of the root determines decay or growth.
  • Repeated real root rr: general solution y=(C1+C2x)erxy = (C_1 + C_2 x) e^{r x}. The factor of xx is forced because two independent solutions are needed.
  • Complex conjugate roots alphapmibeta\alpha \pm i\beta: general solution y=ealphax(C1cos(betax)+C2sin(betax))y = e^{\alpha x}(C_1 \cos(\beta x) + C_2 \sin(\beta x)). The real part alpha\alpha controls the envelope (decay if negative, growth if positive); the imaginary part beta\beta is the angular frequency of oscillation.

Plot solutions of y+y6y=0y'' + y' - 6y = 0 for different initial conditions. The characteristic roots are r=2,3r = 2, -3, so solutions are y=C1e2x+C2e3xy = C_1 e^{2x} + C_2 e^{-3x}. As xtoinftyx \to \infty, the e2xe^{2x} piece dominates unless C1=0C_1 = 0 exactly, visible on the grapher as one curve that grows and another that decays.

Nonhomogeneous equations: superposition

For ay+by+cy=f(x)a y'' + b y' + c y = f(x), the general solution is y=yh+ypy = y_h + y_pp, where yhy_hh is the general solution of the homogeneous equation ay+by+cy=0a y'' + b y' + c y = 0 and ypy_pp is any particular solution. Find ypy_pp by the method of undetermined coefficients (when ff is a polynomial, exponential, or sinusoid, guess a similar form, substitute, match) or by variation of parameters (more general but more work).

Where this shows up
  • RLC circuits: The voltage across a capacitor in a series RLC circuit driven by a battery satisfies Lq+Rq+q/C=VL q'' + R q' + q/C = V, a second-order linear constant-coefficient ODE. Complex characteristic roots Leftrightarrow\Leftrightarrow underdamped (ringing) response; real distinct Leftrightarrow\Leftrightarrow overdamped (slow decay); repeated Leftrightarrow\Leftrightarrow critically damped (fastest decay without ringing).
  • Mechanical oscillators: A mass on a spring with damping satisfies mx+cx+kx=F(t)m x'' + c x' + k x = F(t). The same three cases (overdamped, critically damped, underdamped) appear, the math is identical to the RLC circuit; the engineering vocabulary just changes.
  • Newton's law of cooling: T=k(TTtextroom)T' = -k(T - T_{\text{room}})textroom) is first-order linear. Integrating factor ekte^{kt} recovers the exponential decay toward room temperature, the basis for forensic time-of-death estimates.
  • Population growth: The Malthusian model P=rPP' = rP is separable; the logistic model P=rP(1P/K)P' = rP(1 - P/K) is also separable (but nonlinear), giving the famous S-shaped growth curve.
  • Pause and think: If both characteristic roots are real and negative, what does the solution do as xtoinftyx \to \infty? What if one is negative and one is positive?

    Try it

    • Solve the separable ODE dy/dx=y2cosxdy/dx = y^2 \cos x with y(0)=1y(0) = 1.
    • Solve the first-order linear ODE y+y/x=xy' + y/x = x on x>0x > 0 using an integrating factor. (Hint: mu=x\mu = x.)
    • Find the general solution of y5y+6y=0y'' - 5y' + 6y = 0.
    • Find the general solution of y+4y=0y'' + 4y = 0. Identify the angular frequency and period of the resulting oscillation.
    • The characteristic equation of y6y+9y=0y'' - 6y' + 9y = 0 has a repeated root. Write the general solution and verify by substituting y=(1+x)e3xy = (1 + x) e^{3x}.

    A trap to watch for

    The method of undetermined coefficients fails when the guessed ypy_pp already happens to solve the homogeneous equation, the substitution gives 0=f(x)0 = f(x), which is a contradiction unless fequiv0f \equiv 0. The fix is to multiply the guess by xx (or x2x^2 if the root is repeated) before substituting. For example, when solving y4y=e2xy'' - 4y = e^{2x}, the guess yp=Ae2xy_p = A e^{2x}p=Ae2x fails because e2xe^{2x} is already a homogeneous solution; instead try yp=Axe2xy_p = A x e^{2x}p=Axe2x and match coefficients.

    What you now know

    You can solve any first-order separable ODE, any first-order linear ODE, and any second-order linear constant-coefficient ODE (homogeneous or with simple forcing). You can read off the qualitative behavior, decay, growth, oscillation, directly from the characteristic roots. The next sections leave ODEs for the three canonical PDEs and the differential operators that govern them, beginning with the Laplacian and its harmonic-function solutions.

    Mark section complete →

    References

    • Garrity, T. (2002). All the Mathematics You Missed: But Need to Know for Graduate School. Cambridge University Press, ch. 14.
    • Boyce, W. E., DiPrima, R. C. (2017). Elementary Differential Equations (11th ed.). Wiley, ch. 2-3.
    • Hartman, P. (2002). Ordinary Differential Equations (2nd ed.). SIAM, ch. 4 (linear systems).
    • Tenenbaum, M., Pollard, H. (1985). Ordinary Differential Equations. Dover, ch. 11 (constant coefficients).
    • Coddington, E. A. (1989). An Introduction to Ordinary Differential Equations. Dover, ch. 2.

    This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.