Chapter 8

Ordinary Differential Equations

8.1Introduction and General Form

Video Lecture 22, Part 1: Why the Middle Buildings Fell (0:00)

Video Lecture 22, Part 2: What a Differential Equation Is (3:32)

An ordinary differential equation (ODE) is an equation that relates a function y ( x ) to its derivatives with respect to a single independent variable x :

F ( x , y , d y d x , d 2 y d x 2 , … , d n y d x n ) = 0. (8.1)
ExampleSecond-order ordinary differential equation
x 2 d 2 y d x 2 + 3 x d y d x + y = 0. (8.2)
DefinitionBasic Terminology for ODEs
  • Order of an ODE: The order of a differential equation is the highest derivative that appears in the equation.

    d 3 y d x 3 + 2 d y d x = 0 ⇒ Order = 3 (8.3)
  • Degree of an ODE: The degree of a differential equation is the exponent of the highest-order derivative, provided the equation is polynomial in derivatives.

    ( d 2 y d x 2 ) 3 + d y d x = 0 ⇒ Degree = 3 (8.4)
  • Solution of an ODE: A function y ( x ) that satisfies the differential equation for all x in a given interval.

    d y d x = 2 x ⇒ y = x 2 + C (8.5)
ExampleOrder and degree

The equation

x 2 ( d 2 y d x 2 ) 3 + 3 x ( d y d x ) + y = 0 (8.6)

has order 2, because its highest derivative is y ″ , and degree 3, because y ″ appears cubed. The degree is not always defined: sin ⁡ ( y ″ ) + y = 0 has order 2 but no degree, because it is not a polynomial in y ″ .

The solution of d y / d x = 2 x is found by undoing the derivative: ∫ d y = ∫ 2 x d x , so y = 2 x 2 2 + C = x 2 + C . The constant C is not a detail. The equation fixes only the slope of the curve at every point, and every curve y = x 2 + C has that slope everywhere (Figure 8.1): one equation has a whole family of solutions. A first-order equation leaves one free constant, and one more fact, such as the value of y at one point, picks one curve of the family.

The equation y' = 2x fixes only the slope at each point (the short grey segments: flat on the y axis, steeper further out). Every parabola y = x^2 + C follows the segments everywhere: one equation, a family of solutions.
Figure 8.1. The equation y ′ = 2 x fixes only the slope at each point (the short grey segments: flat on the y axis, steeper further out). Every parabola y = x 2 + C follows the segments everywhere: one equation, a family of solutions.

8.2Classification of ODEs

Video Lecture 22, Part 3: Linear or Nonlinear (7:17)

Ordinary differential equations (ODEs) can be classified according to several characteristics. The most fundamental distinction is between linear and nonlinear equations.

Linear vs. Nonlinear ODEs

An ODE is called linear if the dependent variable y and all its derivatives appear only to the first power and are not multiplied or composed with each other. The general n th -order linear ODE can be written as

a n ( x ) y ( n ) + a n − 1 ( x ) y ( n − 1 ) + ⋯ + a 1 ( x ) y ′ + a 0 ( x ) y = f ( x ) , (8.7)

where a i ( x ) and f ( x ) are known functions of the independent variable x .

DefinitionLinear ODE, by its operator

Collect the left side into one operator, which takes in a function y and gives out a new function,

L [ y ] = a n ( x ) y ( n ) + ⋯ + a 1 ( x ) y ′ + a 0 ( x ) y , (8.8)

so that the equation reads L [ y ] = f ( x ) . The equation is linear when L is a linear operator in the sense of Chapter 3,

L [ a y 1 + b y 2 ] = a L [ y 1 ] + b L [ y 2 ] (8.9)

for all constants a , b and functions y 1 , y 2 . This L is linear: each derivative d k / d x k is a linear operator (Chapter 3), and multiplying by a fixed function a k ( x ) keeps the property. The rule “first power only, no products, no nonlinear functions of y ” below is the quick test for it.

If any term involves products or nonlinear functions of y or its derivatives (such as y 2 , y y ′ , or sin ⁡ ( y ) ), the equation is said to be nonlinear.

Example
Linear: y ″ + 3 y ′ + 2 y = sin ⁡ ( x ) , Nonlinear: y ″ + y y ′ = 0.

For the second, N [ y ] = y ″ + y y ′ , the product term of a combination gives ( a y 1 + b y 2 ) ( a y 1 ′ + b y 2 ′ ) = a 2 y 1 y 1 ′ + a b ( y 1 y 2 ′ + y 2 y 1 ′ ) + b 2 y 2 y 2 ′ , not a y 1 y 1 ′ + b y 2 y 2 ′ : N is not a linear operator. Concretely, y 1 = 2 / x and y 2 = 1 both solve y ″ + y y ′ = 0 , but their sum leaves N [ 2 / x + 1 ] = − 2 / x 2 ≠ 0 . For the first, cos ⁡ ( x ) and sin ⁡ ( x ) solve y ″ + y = 0 , and so does their sum.

RemarkA common mistake

Only y and its derivatives decide whether an equation is linear. Functions of x may multiply them freely: x 2 y ″ + sin ⁡ ( x ) y = e x is linear, while y ″ + y y ′ = 0 is not.

Remark

Linear ODEs are generally easier to solve because they obey the principle of superposition, if y 1 and y 2 are solutions of a homogeneous linear equation L [ y ] = 0 , then any linear combination C 1 y 1 + C 2 y 2 is also a solution, since L [ C 1 y 1 + C 2 y 2 ] = C 1 L [ y 1 ] + C 2 L [ y 2 ] = 0 . (For L [ y ] = f ≠ 0 the sum of two solutions gives 2 f ; there the rule is y = y h + y p below.) Nonlinear ODEs, on the other hand, can exhibit far richer behavior, such as limited analytic solvability, sensitivity to initial conditions, or even chaotic motion. However, certain first-order nonlinear equations, such as separable or Bernoulli equations, can still be solved analytically.

Classification of Linear ODEs

Once an equation is identified as linear, we can further classify it based on its right-hand side and coefficients.

8.3First-Order ODEs

A first-order ODE involves only the first derivative of the unknown function:

d y d x = f ( x , y ) . (8.14)

This general form can represent both linear and nonlinear cases, depending on how f ( x , y ) depends on y . Such equations appear widely in physics—for example, in modeling exponential decay, population growth, or motion with velocity-dependent forces.

8.3.1Separable Equations

Video Lecture 22, Part 4: Separable Equations (13:27)

A first-order ODE is called separable if it can be expressed as

d y d x = g ( x ) h ( y ) , (8.15)

where the function on the right-hand side is the product of a function of x and a function of y . Although separable equations are often nonlinear, they are still analytically solvable because the variables can be separated.

Rearranging terms gives

d y h ( y ) = g ( x ) d x , (8.16)

and integrating both sides yields

∫ d y h ( y ) = ∫ g ( x ) d x . (8.17)
ExampleSolve the differential equation
d y d x = x y . (8.18)

Solution.

Step 1. Recognize the type of equation. This is a first-order separable (and also linear) differential equation.

Step 2. Separate the variables.

d y y = x d x . (8.19)

Step 3. Integrate both sides.

∫ 1 y d y = ∫ x d x ⟹ ln ⁡ | y | = x 2 2 + C . (8.20)

Step 4. Simplify the result. Exponentiate both sides:

y = e C e x 2 / 2 . (8.21)

Let C 1 = e C (a new arbitrary constant). Then

y ( x ) = C 1 e x 2 / 2 . (8.22)

Step 5. Verification. Differentiate y = C 1 e x 2 / 2 :

d y d x = C 1 x e x 2 / 2 = x y , (8.23)

confirming that the solution satisfies the ODE.

ExampleSolve the differential equation
x d y d x = y + 1. (8.24)

Solution.

Step 1. Separate the variables. Divide both sides by x ( y + 1 ) :

1 y + 1 d y d x = 1 x ⟹ d y y + 1 = d x x . (8.25)

Step 2. Integrate both sides.

∫ d y y + 1 = ∫ d x x ⟹ ln ⁡ | y + 1 | = ln ⁡ | x | + C . (8.26)

Step 3. Simplify the constant. Let C = ln ⁡ ( a ) (for a > 0 ) to combine logarithms conveniently:

ln ⁡ | y + 1 | = ln ⁡ | a x | . (8.27)

Step 4. Remove the logarithms.

| y + 1 | = a | x | . (8.28)

Because a can absorb the sign, we write simply

y + 1 = a x , a  constant . (8.29)

Step 5. Interpretation. The general solution

y = a x − 1 (8.30)

represents a family of straight lines in the ( x , y ) -plane, one line for each value of the constant a . Selecting a particular value of a determines a single specific curve from this family. Every line of the family passes through the point ( 0 , − 1 ) , because y = a ⋅ 0 − 1 = − 1 whatever a is. They may all cross there because at x = 0 the equation reads 0 = y + 1 : it allows only that point and sets no slope. Everywhere else exactly one line passes through each point.

A solution lost in Step 1. Dividing by y + 1 assumed y ≠ − 1 , and a = ± e C is never zero. The flat line y = − 1 ( a = 0 ) also solves the equation, since both sides are zero: x ⋅ 0 = 0 . So a may be any constant, zero included. Whenever we divide by h ( y ) to separate, the constant solutions with h ( y ) = 0 must be checked separately.

Step 6. A condition picks one line. Suppose, in addition, that y = 1 at x = 1 . Then

1 = a ⋅ 1 − 1 ⟹ a = 2 ⟹ y = 2 x − 1 , (8.31)

the unique solution through ( 1 , 1 ) . Check: x y ′ = 2 x and y + 1 = 2 x .

The solutions y = ax - 1 of x\,y' = y + 1 (grey) all pass through (0,-1). The condition y(1) = 1 picks the one line through (1,1): y = 2x - 1.
Figure 8.2. The solutions y = a x − 1 of x y ′ = y + 1 (grey) all pass through ( 0 , − 1 ) . The condition y ( 1 ) = 1 picks the one line through ( 1 , 1 ) : y = 2 x − 1 .

A common mistake. From ln ⁡ | y + 1 | = ln ⁡ | x | + C it does not follow that y + 1 = x + C . Exponentiating both whole sides gives | y + 1 | = e C | x | : the constant multiplies x .

ExampleSolve the differential equation
d y d x = 1 − y 2 . (8.32)

Find the particular solutions satisfying (a) x = 0 , y = 0 and (b) x = 0 , y = 1 , and discuss any solutions not obtained by separation.

Solution.

Step 1. Separation of variables and integration. For | y | < 1 , the equation can be written in separable form:

d y 1 − y 2 = d x . (8.33)

Integrating both sides gives

arcsin ⁡ ( y ) = x + α , (8.34)

so the general solution (valid where | y | < 1 ) is

y ( x ) = sin ⁡ ( x + α ) . (8.35)

Step 2. Monotonicity and physical interpretation. Since y ′ = 1 − y 2 ≥ 0 , the slope of the curve is always nonnegative. Hence, only the increasing portions of the sine curve correspond to valid solution segments. That is, we must restrict to intervals where

cos ⁡ ( x + α ) ≥ 0. (8.36)

The figure below shows the slope field and the increasing sine segments that satisfy this condition.

The slope field with the increasing segments of the sine curve, which are the parts that satisfy (x+) 0.
Figure 8.3. The slope field with the increasing segments of the sine curve, which are the parts that satisfy cos ⁡ ( x + α ) ≥ 0 .

Step 3. Singular (boundary) solutions. In separating variables, we divided by 1 − y 2 , which is not defined when | y | = 1 . However, substituting directly into the differential equation shows that

y ≡ 1 , y ≡ − 1 (8.37)

are valid constant solutions since y ′ = 0 = 1 − y 2 . These are singular solutions that cannot be obtained from the separated form.

Step 4. Particular solutions.

(a) y ( 0 ) = 0 : From arcsin ⁡ y = x + α , substituting x = 0 , y = 0 gives α = 0 or π . Because y ′ ≥ 0 , we take the increasing branch:

y ( x ) = sin ⁡ ( x ) , − π 2 ≤ x ≤ π 2 . (8.38)

To extend this continuously for all x , attach the constant segments y = ± 1 :

y ( x ) = { − 1 , x ≤ − π 2 , sin ⁡ ( x ) , − π 2 ≤ x ≤ π 2 , 1 , x ≥ π 2 . (8.39)

This gives a single continuous nondecreasing solution over the entire real line.

(b) y ( 0 ) = 1 : The constant function y ( x ) ≡ 1 is an obvious solution. Alternatively, using sin ⁡ ( x + α ) = 1 at x = 0 gives α = π 2 + 2 k π . Choosing the increasing branch near x = 0 ,

y ( x ) = sin ( x + π 2 ) = cos ⁡ ( x ) , − π ≤ x ≤ 0. (8.40)

To extend for all x :

y ( x ) = { − 1 , x ≤ − π , cos ⁡ ( x ) , − π ≤ x ≤ 0 , 1 , x ≥ 0. (8.41)

There exist infinitely many such piecewise continuous solutions, obtained by shifting these arcs horizontally.

Step 5. Interpretation and summary.

  • The general solution y = sin ⁡ ( x + α ) applies where | y | < 1 and y ′ = 1 − y 2 ≥ 0 .

  • The singular solutions y = ± 1 correspond to the flat portions of the slope field where y ′ = 0 .

  • The complete solution set consists of rising sine arcs smoothly connected to horizontal segments at y = ± 1 .

All solutions.

y(x) = (x+) on intervals where (x+)0, together with y1.

8.3.2Linear First-Order Equations

A linear first-order equation has the form

d y d x + P ( x ) y = Q ( x ) . (8.42)

Integrating Factor Method:

  1. Compute the integrating factor:

    μ ( x ) = e ∫ P ( x ) d x . (8.43)
  2. Multiply through by μ ( x ) :

    d d x ( μ ( x ) y ) = μ ( x ) Q ( x ) . (8.44)
  3. Integrate:

    μ ( x ) y = ∫ μ ( x ) Q ( x ) d x . (8.45)
  4. Solve for y ( x ) :

    y = [ μ ( x ) ] − 1 ∫ μ ( x ) Q ( x ) d x . (8.46)
ExampleSolve the first-order linear ODE
y ′ + 2 y = e − x . (8.47)

Solution.

Step 1. Identify P ( x ) and Q ( x ) . The equation is in the standard linear form

y ′ + P ( x ) y = Q ( x ) , (8.48)

where

P ( x ) = 2 , Q ( x ) = e − x . (8.49)

Step 2. Compute the integrating factor. The integrating factor is

μ ( x ) = e ∫ P ( x ) d x = e ∫ 2 d x = e 2 x . (8.50)

Step 3. Apply the general solution formula.

y = [ μ ( x ) ] − 1 ∫ μ ( x ) Q ( x ) d x . (8.51)

Substitute μ ( x ) = e 2 x and Q ( x ) = e − x :

y = e − 2 x ∫ e 2 x e − x d x = e − 2 x ∫ e x d x . (8.52)

Step 4. Evaluate the integral.

y = e − 2 x ( e x + C ) = e − x + C e − 2 x . (8.53)

Final Answer:

y = e − x + C e − 2 x . (8.54)

Verification. Substitute y = e − x + C e − 2 x into the original equation:

y ′ = − e − x − 2 C e − 2 x , ⇒ y ′ + 2 y = ( − e − x − 2 C e − 2 x ) + 2 ( e − x + C e − 2 x ) = e − x , (8.55)

which satisfies the ODE.

Separable equations and linear equations are the two types of first-order equations most commonly encountered in basic applications. However, there exist several other important forms of first-order equations that can be transformed into solvable types. In this section, we briefly introduce two such forms: the Bernoulli equation and exact equations. More details and applications are found in advanced differential equations texts.

8.3.4The Bernoulli Equation

The differential equation

y ′ + P ( x ) y = Q ( x ) y n , (8.56)

where P ( x ) and Q ( x ) are known functions of x , is called the Bernoulli equation. It is nonlinear for n ≠ 0 , 1 , but it can be transformed into a linear equation through an appropriate substitution.

Step 1. Multiply by y − n .

y − n y ′ + P ( x ) y 1 − n = Q ( x ) . (8.57)

Step 2. Simplify using the substitution z = y 1 − n .

d z d x = ( 1 − n ) y − n y ′ . (8.58)

Hence, y − n y ′ = 1 1 − n z ′ . Substitute this into the previous equation:

1 1 − n z ′ + P ( x ) z = Q ( x ) . (8.59)

Step 3. Multiply through by ( 1 − n ) to simplify.

z ′ + ( 1 − n ) P ( x ) z = ( 1 − n ) Q ( x ) . (8.60)

This is now a first-order linear ODE in z ( x ) , which can be solved using the integrating factor method.

Reduced linear form: z' + (1-n)P(x)z = (1-n)Q(x).

After solving for z ( x ) , the original dependent variable is recovered via

y = z 1 1 − n . (8.61)
Remark

The Bernoulli equation provides an important link between nonlinear and linear first-order ODEs. By multiplying through by y − n and substituting z = y 1 − n , we convert a nonlinear equation into a solvable linear form. This transformation frequently appears in problems involving population dynamics, exponential growth and decay, and fluid motion.

ExampleReduce to linear form and solve
y ′ + y = x y 2 / 3 . (8.62)

Solution.

Step 1. Multiply by y − n with n = 2 3 .

y − 2 / 3 y ′ + y 1 / 3 = x . (8.63)

Step 2. Let z = y 1 − n = y 1 / 3 . Then z ′ = 1 3 y − 2 / 3 y ′ , so y − 2 / 3 y ′ = 3 z ′ . Substitute:

3 z ′ + z = x ⟹ z ′ + 1 3 z = 1 3 x . (8.64)

Step 3. Solve the linear equation using the integrating-factor formula. For

z ′ + p ( x ) z = q ( x ) , p ( x ) = 1 3 , q ( x ) = 1 3 x , (8.65)

the integrating factor is μ ( x ) = e ∫ p ( x ) d x = e x / 3 . Apply

z = [ μ ( x ) ] − 1 ∫ μ ( x ) q ( x ) d x : (8.66)
z = e − x / 3 [ ∫ e x / 3 ⋅ 1 3 x d x + C ] = e − x / 3 [ e x / 3 ( x − 3 ) + C ] = x − 3 + C e − x / 3 . (8.67)

Step 4. Back–substitute to y . Since z = y 1 / 3 ,

y ( x ) = ( x − 3 + C e − x / 3 ) 3 . (8.68)

Step 5. Singular solution. Because y 2 / 3 ≥ 0 for all real y , the constant function

y ( x ) ≡ 0 (8.69)

also satisfies the original ODE. Thus the complete set consists of the one-parameter family above together with y ≡ 0 .

8.3.5Exact Differential Equations

A general first-order differential equation can often be written in the form

M ( x , y ) d x + N ( x , y ) d y = 0 , (8.70)

where M and N are functions of two variables x and y .

DefinitionExact Differential Equation

The first–order differential equation

M ( x , y ) d x + N ( x , y ) d y = 0 (8.71)

is called exact if there exists a scalar function U ( x , y ) (called a potential function) such that

d U ( x , y ) = M ( x , y ) d x + N ( x , y ) d y , where  M = ∂ U ∂ x , N = ∂ U ∂ y . (8.72)

In this case, the general solution can be written implicitly as

U ( x , y ) = C . (8.73)

A necessary and sufficient condition for exactness (assuming continuous partial derivatives) is

∂ M ∂ y = ∂ N ∂ x . (8.74)
Remark

The condition above ensures that the mixed second derivatives of U ( x , y ) are equal:

∂ 2 U ∂ x ∂ y = ∂ 2 U ∂ y ∂ x . (8.75)

This is guaranteed by Clairaut’s theorem when M and N have continuous partial derivatives.

Solution Procedure:

  1. Check whether ∂ M ∂ y = ∂ N ∂ x . If true, the equation is exact.

  2. Integrate M ( x , y ) with respect to x , treating y as constant:

    U ( x , y ) = ∫ M ( x , y ) d x + F ( y ) , (8.76)

    where F ( y ) is an arbitrary function of y .

  3. Since U ( x , y ) must satisfy

    N ( x , y ) = ∂ U ∂ y , (8.77)

    we differentiate the above expression for U ( x , y ) with respect to y :

    ∂ U ∂ y = ∂ ∂ y ( ∫ M ( x , y ) d x ) + F ′ ( y ) . (8.78)

    Now substitute the known expression for N ( x , y ) from the original equation and equate:

    N ( x , y ) = ∂ ∂ y ( ∫ M ( x , y ) d x ) + F ′ ( y ) . (8.79)

    From this, we can solve for F ′ ( y ) :

    F ′ ( y ) = N ( x , y ) − ∂ ∂ y ( ∫ M ( x , y ) d x ) . (8.80)

    Integrate with respect to y to find F ( y ) , and then write the final expression for U ( x , y ) . The general solution is obtained from

    U ( x , y ) = constant. (8.81)
  4. Integrate F ′ ( y ) to find F ( y ) , substitute back, and write the final solution U ( x , y ) = C .

ExampleSolving an Exact Differential Equation

Solve

( 2 x y + y 3 ) d x + ( x 2 + 3 x y 2 ) d y = 0. (8.82)

Solution.

Step 1. Identify

M ( x , y ) = 2 x y + y 3 , N ( x , y ) = x 2 + 3 x y 2 . (8.83)

Step 2. Check the exactness condition:

∂ M ∂ y = 2 x + 3 y 2 , ∂ N ∂ x = 2 x + 3 y 2 . (8.84)

They are equal, so the equation is exact.

Step 3. Integrate M ( x , y ) with respect to x :

U ( x , y ) = ∫ ( 2 x y + y 3 ) d x = x 2 y + x y 3 + F ( y ) . (8.85)

Step 4. Differentiate with respect to y :

∂ U ∂ y = x 2 + 3 x y 2 + F ′ ( y ) . (8.86)

Compare with N ( x , y ) = x 2 + 3 x y 2 , which implies F ′ ( y ) = 0 .

Step 5. Hence F ( y ) = constant . The potential function is

U ( x , y ) = x 2 y + x y 3 . (8.87)

Step 6. The general solution is

x 2 y + x y 3 = C . (8.88)

8.3.6Integrating Factors

If the equation M ( x , y ) d x + N ( x , y ) d y = 0 is not exact, it may sometimes be made exact by multiplying by a function μ ( x , y ) called an integrating factor:

μ ( x , y ) M ( x , y ) d x + μ ( x , y ) N ( x , y ) d y = 0. (8.89)

The new equation is exact if

∂ ( μ M ) ∂ y = ∂ ( μ N ) ∂ x . (8.90)

Unfortunately, there is no universal method for finding μ ( x , y ) . However, there are two common and important special cases.

Case 1: Integrating factor depends on x only.

If μ = μ ( x ) , then the equation becomes exact provided that

1 μ d μ d x = ∂ M ∂ y − ∂ N ∂ x N . (8.91)

Hence,

μ ( x ) = exp ( ∫ 1 N ( ∂ M ∂ y − ∂ N ∂ x ) d x ) . (8.92)

Case 2: Integrating factor depends on y only.

If μ = μ ( y ) , then the equation becomes exact provided that

1 μ d μ d y = ∂ N ∂ x − ∂ M ∂ y M . (8.93)

Hence,

μ ( y ) = exp ( ∫ 1 M ( ∂ N ∂ x − ∂ M ∂ y ) d y ) . (8.94)
ExampleIntegrating factor μ = μ ( x ) , not separable

Solve

[ ( x + 1 ) y + x ] d x + x d y = 0. (8.95)

Solution.

Step 1. Identify M , N and test exactness.

M ( x , y ) = ( x + 1 ) y + x , N ( x , y ) = x . (8.96)

Compute

M y = x + 1 , N x = 1. (8.97)

Since M y ≠ N x , the equation is not exact.

Step 2. Seek an integrating factor μ = μ ( x ) . Use

1 μ d μ d x = M y − N x N = ( x + 1 ) − 1 x = x x = 1. (8.98)

Hence

ln ⁡ ( μ ( x ) ) = ∫ 1 d x = x ⇒ μ ( x ) = e x . (8.99)

Step 3. Multiply the equation by μ ( x ) = e x .

e x [ ( x + 1 ) y + x ] d x + e x x d y = 0. (8.100)

Define

M ˜ = e x [ ( x + 1 ) y + x ] , N ˜ = e x x . (8.101)

Step 4. Check exactness & find a potential U ( x , y ) .

∂ M ˜ ∂ y = e x ( x + 1 ) , ∂ N ˜ ∂ x = e x ( x + 1 ) ⇒ exact . (8.102)

Integrate M ˜ w.r.t. x (treating y constant):

U ( x , y ) = ∫ e x [ ( x + 1 ) y + x ] d x = y ∫ e x ( x + 1 ) d x + ∫ x e x d x . (8.103)

Using ∫ e x ( x + 1 ) d x = x e x and ∫ x e x d x = ( x − 1 ) e x ,

U ( x , y ) = y x e x + ( x − 1 ) e x + F ( y ) . (8.104)

Now

U y = x e x + F ′ ( y ) = ! N ˜ = x e x ⇒ F ′ ( y ) = 0 ⇒ F ( y ) = const . (8.105)

Step 5. Implicit solution.

e x ( x y + x − 1 ) = C . (8.106)
ExampleIntegrating factor μ = μ ( y ) , not separable

Solve

y d x + ( 3 x + y ) d y = 0. (8.107)

Solution.

Step 1. Identify M , N and test exactness.

M ( x , y ) = y , N ( x , y ) = 3 x + y . (8.108)

Compute

M y = 1 , N x = 3. (8.109)

Since M y ≠ N x , the equation is not exact.

Step 2. Seek an integrating factor μ = μ ( y ) . Use

1 μ d μ d y = N x − M y M = 3 − 1 y = 2 y . (8.110)

Hence

ln ⁡ ( μ ( y ) ) = ∫ 2 y d y = 2 ln ⁡ | y | ⇒ μ ( y ) = y 2 ( y ≠ 0 ) . (8.111)

Step 3. Multiply the equation by μ ( y ) = y 2 .

y 3 d x + ( 3 x y 2 + y 3 ) d y = 0. (8.112)

Define

M ˜ = y 3 , N ˜ = 3 x y 2 + y 3 . (8.113)

Step 4. Check exactness & find a potential U ( x , y ) .

∂ M ˜ ∂ y = 3 y 2 , ∂ N ˜ ∂ x = 3 y 2 ⇒ exact . (8.114)

Integrate M ˜ w.r.t. x (treating y constant):

U ( x , y ) = ∫ y 3 d x = x y 3 + F ( y ) . (8.115)

Now

U y = 3 x y 2 + F ′ ( y ) = ! N ˜ = 3 x y 2 + y 3 ⇒ F ′ ( y ) = y 3 ⇒ F ( y ) = y 4 4 . (8.116)

Step 5. Implicit solution.

x y 3 + y 4 4 = C . (8.117)
Remark

Many physical systems—such as thermodynamics, potential flow, and electrostatics—lead to exact differential equations, where U ( x , y ) represents a potential energy, enthalpy, or potential function. When the equation is not exact, an integrating factor often restores this structure.

8.4Second-Order Ordinary Differential Equations

A second-order linear ordinary differential equation (ODE) has the general form

a 2 ( x ) y ″ + a 1 ( x ) y ′ + a 0 ( x ) y = f ( x ) , (8.118)

where a 2 ( x ) , a 1 ( x ) , a 0 ( x ) , and f ( x ) are known functions of x , and y ( x ) is the unknown function to be determined.

When a 2 , a 1 , a 0 are constants, the equation simplifies to

a y ″ + b y ′ + c y = f ( x ) , a , b , c ∈ ℝ ,   a ≠ 0. (8.119)

We will first study the homogeneous case ( f ( x ) = 0 ) and then the nonhomogeneous case ( f ( x ) ≠ 0 ).

8.4.1Homogeneous Equations with Constant Coefficients

Video Lecture 22, Part 5: The Exponential Guess (18:16)

DefinitionHomogeneous Linear ODE (Second Order)

A second–order homogeneous linear differential equation with constant coefficients has the form

a y ″ + b y ′ + c y = 0 , a , b , c ∈ ℝ ,   a ≠ 0. (8.120)
TheoremGeneral Solution of a Constant–Coefficient ODE

Consider the homogeneous linear differential equation

a y ″ + b y ′ + c y = 0 , a ≠ 0. (8.121)

Its solutions are determined by the characteristic (auxiliary) equation

a r 2 + b r + c = 0. (8.122)

If r 1 and r 2 are the roots of this quadratic, then the general solution is:

(i) Distinct real roots  r 1 ≠ r 2 : y ( x ) = C 1 e r 1 x + C 2 e r 2 x , (ii) Repeated root  r 1 = r 2 = r : y ( x ) = ( C 1 + C 2 x ) e r x , (iii) Complex roots  r = α ± i β : y ( x ) = e α x ( C 1 cos ⁡ ( β x ) + C 2 sin ⁡ ( β x ) ) , (8.123)

where C 1 , C 2 are arbitrary constants. The sign of the discriminant Δ = b 2 − 4 a c decides the case: Δ > 0 gives (i), Δ = 0 gives (ii) with r = − b / ( 2 a ) , and Δ < 0 gives (iii) with

α = − b 2 a , β = − Δ 2 a = 4 a c − b 2 2 a . (8.124)
RemarkWhy two solutions

A second-order law, such as Newton's, needs two starting facts: the starting position and the starting velocity. The general solution must therefore carry two free constants, y = C 1 y 1 + C 2 y 2 , with y 1 and y 2 linearly independent; if y 2 were a multiple of y 1 , the two constants would merge into one. The Wronskians in the proof below check the independence in each case.

Video Lecture 22, Part 6: Three Kinds of Roots (24:33)

Consider the homogeneous constant–coefficient ODE

a y ″ + b y ′ + c y = 0 , a ≠ 0. (8.125)

Step 1: Exponential trial and substitution. Assume a trial solution y = e r x with constant r . Then

y ′ = r e r x , y ″ = r 2 e r x . (8.126)

Substituting into the ODE gives

a ( r 2 e r x ) + b ( r e r x ) + c ( e r x ) = e r x ( a r 2 + b r + c ) = 0. (8.127)

Since e r x ≠ 0 for all x , we must have the characteristic equation

a r 2 + b r + c = 0. (8.128)

Step 2: Distinct real roots r 1 ≠ r 2 . If the characteristic polynomial has two distinct real roots r 1 and r 2 , then

y 1 = e r 1 x , y 2 = e r 2 x (8.129)

are both solutions. Their Wronskian is

W [ y 1 , y 2 ] ( x ) = | e r 1 x e r 2 x r 1 e r 1 x r 2 e r 2 x | = ( r 2 − r 1 ) e ( r 1 + r 2 ) x ≠ 0 , (8.130)

so y 1 , y 2 are linearly independent. Hence the general solution is

y ( x ) = C 1 e r 1 x + C 2 e r 2 x . (8.131)

Step 3: Repeated real root r 1 = r 2 = r . (Construction of the x e r x term.) If the characteristic polynomial has a double root r , then we already have one solution y 1 = e r x . To find a second, linearly independent solution, set

y 2 ( x ) = v ( x ) e r x , (8.132)

where v is to be determined. Compute derivatives:

y 2 ′ = v ′ e r x + r v e r x , y 2 ″ = v ″ e r x + 2 r v ′ e r x + r 2 v e r x . (8.133)

Substitute y 2 , y 2 ′ , y 2 ″ into the ODE:

a ( v ″ + 2 r v ′ + r 2 v ) e r x + b ( v ′ + r v ) e r x + c ( v ) e r x = 0. (8.134)

Divide by e r x ≠ 0 and group terms by v ″ , v ′ , v :

a v ″ + ( 2 a r + b ) v ′ + ( a r 2 + b r + c ) v = 0. (8.135)

Because r is a root of the characteristic polynomial, we have

a r 2 + b r + c = 0. (8.136)

Moreover, because the root is repeated, the derivative of the characteristic polynomial also vanishes at r :

d d r ( a r 2 + b r + c ) | r = 2 a r + b = 0. (8.137)

Hence the equation for v reduces to

a v ″ = 0 ⇒ v ″ = 0 ⇒ v ( x ) = A x + B . (8.138)

Discarding the multiple of the first solution (the B e r x part), we take v ( x ) = x and obtain

y 2 ( x ) = x e r x . (8.139)

Therefore, the general solution in the repeated-root case is

y ( x ) = ( C 1 + C 2 x ) e r x . (8.140)

Step 4: Complex conjugate roots r = α ± i β with β ≠ 0 . If r = α ± i β , then e ( α ± i β ) x are solutions. Taking real and imaginary parts,

e α x cos ⁡ ( β x ) , e α x sin ⁡ ( β x ) (8.141)

are real solutions. Their Wronskian is

W [ e α x cos ⁡ ( β x ) , e α x sin ⁡ ( β x ) ] = β e 2 α x ≠ 0 , (8.142)

so they are linearly independent. Thus the general real solution is

y ( x ) = e α x ( C 1 cos ⁡ ( β x ) + C 2 sin ⁡ ( β x ) ) . (8.143)

The same result comes from the two complex solutions directly: by Euler's formula, e α x ( c 1 e i β x + c 2 e − i β x ) = e α x ( ( c 1 + c 2 ) cos ⁡ ( β x ) + i ( c 1 − c 2 ) sin ⁡ ( β x ) ) , and the choice c 1 = ( C 1 − i C 2 ) / 2 , c 2 = ( C 1 + i C 2 ) / 2 gives c 1 + c 2 = C 1 and i ( c 1 − c 2 ) = C 2 , real.

Combining the three cases completes the proof.

Remark
  • The step 2 a r + b = 0 in the repeated-root case is precisely the condition p ′ ( r ) = 0 where p ( r ) = a r 2 + b r + c . This is why the reduction–of–order equation collapses to v ″ = 0 , giving v ( x ) = x and hence y 2 = x e r x .

  • The Wronskians shown above explicitly verify linear independence in the distinct-root and complex-root cases.

  • The exponential ansatz works here because constant coefficients make the ODE invariant under differentiation of e r x : derivatives only pull down factors of r , converting the differential equation to an algebraic one.

  • A common mistake is β = Δ / ( 2 a ) in case (iii). That is the square root of a negative number; the i has already been taken out into r = α ± i β , so β = − Δ / ( 2 a ) . For example, y ″ + 2 y ′ + 5 y = 0 has Δ = 4 − 20 = − 16 , α = − 1 , β = 16 / 2 = 2 , and y = e − x ( C 1 cos ⁡ ( 2 x ) + C 2 sin ⁡ ( 2 x ) ) .

For a block on a spring with a damper, a y ″ + b y ′ + c y = 0 is m x ¨ + b x ˙ + k x = 0 , and the three cases are three motions after the block is let go (Figure 8.4): with heavy damping ( Δ > 0 ) both roots are negative (their product c / a is positive and their sum − b / a negative, since m , b and k are positive) and the block creeps back without crossing equilibrium; at Δ = 0 (critical damping) it returns as fast as it can without crossing; with light damping ( Δ < 0 ) it bounces, its swings shrinking inside the envelope ± e α t . A car's shock absorbers are tuned close to critical damping.

ExampleTwo starting facts fix the two constants

Solve y ″ − 3 y ′ + 2 y = 0 with y ( 0 ) = 0 and y ′ ( 0 ) = 1 .

Solution.

The characteristic equation r 2 − 3 r + 2 = ( r − 1 ) ( r − 2 ) = 0 has the roots 1 and 2 , so y = c 1 e x + c 2 e 2 x . At x = 0 both exponentials equal one:

y ( 0 ) = c 1 + c 2 = 0 , y ′ ( 0 ) = c 1 + 2 c 2 = 1 ⟹ c 2 = 1 ,   c 1 = − 1 , y = e 2 x − e x . (8.144)

Check: y ( 0 ) = 1 − 1 = 0 and y ′ ( 0 ) = 2 − 1 = 1 .

The same block and spring, let go at rest from the same place, with three dampers: the three kinds of roots of the characteristic equation are the three motions.
Figure 8.4. The same block and spring, let go at rest from the same place, with three dampers: the three kinds of roots of the characteristic equation are the three motions.

8.4.2Nonhomogeneous Equations

Video Lecture 22, Part 7: The Push and the Oscillator (30:25)

Definition

A nonhomogeneous second-order linear ODE is

a y ″ + b y ′ + c y = f ( x ) , (8.145)

where f ( x ) is a known forcing (nonzero) function.

Theorem

The general solution of a nonhomogeneous linear ODE is

y ( x ) = y h ( x ) + y p ( x ) , (8.146)

where

  • y h ( x ) is the homogeneous (complementary) solution satisfying a y ″ + b y ′ + c y = 0 ,

  • y p ( x ) is a particular solution satisfying the full equation for the given f ( x ) .

DefinitionMethod of Undetermined Coefficients

If f ( x ) is composed of elementary functions such as exponentials, polynomials, or sines and cosines, we assume a trial form for y p ( x ) resembling f ( x ) , substitute into the ODE, and solve for the unknown coefficients.

If any term of the assumed y p ( x ) duplicates a part of y h ( x ) , multiply by the smallest power of x necessary to ensure linear independence.

The particular solution has the same form as the forcing, because the derivatives of these functions keep their form:

f ( x ) = { 2 e α x 5 e i α x 3 sin ⁡ ( α x ) 10 cos ⁡ ( α x ) ⟹ y p = { A e α x A e i θ e i α x A sin ⁡ ( α x + θ ) A cos ⁡ ( α x + θ ) (8.147)

Here α is the rate in the forcing (not the α of the roots), and substituting y p gives equations for the constants A and θ .

ExampleThe rule, and the warning

Take y ″ − 3 y ′ + 2 y , whose homogeneous solution is y h = c 1 e x + c 2 e 2 x .

  • f ( x ) = 2 e 3 x : try y p = A e 3 x . Each derivative brings down a 3 : ( 9 − 9 + 2 ) A e 3 x = 2 e 3 x , so A = 1 and y = c 1 e x + c 2 e 2 x + e 3 x .

  • f ( x ) = e x : the trial A e x gives ( 1 − 3 + 2 ) A e x = 0 ≠ e x , because e x already solves the homogeneous equation. Multiply by x : with y p = A x e x , y p ′ = A ( x + 1 ) e x and y p ″ = A ( x + 2 ) e x , so A e x [ ( x + 2 ) − 3 ( x + 1 ) + 2 x ] = − A e x = e x , A = − 1 and y p = − x e x .

8.4.3Example: Forced and Damped Harmonic Oscillator

ExampleForced and Damped Harmonic Oscillator (dot notation)

Consider the driven, damped oscillator

m x ¨ + b x ˙ + k x = F 0 sin ⁡ ( ω t ) , (8.148)

where m is the mass, b the damping coefficient, k the spring constant, and F 0 sin ⁡ ( ω t ) the external driving force.

Solution.

Step 1. Newton's second law. The block moves along x , measured from equilibrium (Figure 8.5). Along x three forces act: the spring pulls back toward equilibrium with k x , the drag f = b x ˙ points against the velocity, and the push F ( t ) comes from outside; along y , the weight m g and the normal force N balance, since the block does not move up or down:

m x ¨ = − b x ˙ − k x + F ( t ) , N = m g . (8.149)

Moving the drag and the spring to the left gives the equation above. (With the drag's sign wrong, the motion would grow by itself.)

The driven damped oscillator: a block of mass m on a spring of stiffness k, displaced x(t) from equilibrium (dashed), with the spring force kx, the drag f = bx, the push F(t), its weight mg and the normal force N.
Figure 8.5. The driven damped oscillator: a block of mass m on a spring of stiffness k , displaced x ( t ) from equilibrium (dashed), with the spring force k x , the drag f = b x ˙ , the push F ( t ) , its weight m g and the normal force N .

Divide through by m :

x ¨ + 2 γ x ˙ + ω 0 2 x = F 0 m sin ⁡ ( ω t ) , (8.150)

where

ω 0 = k m , 2 γ = b m . (8.151)

Video Lecture 22, Part 8: The Oscillator Left Alone (36:48)

Step 2. Homogeneous solution.

For the unforced system,

x ¨ h + 2 γ x ˙ h + ω 0 2 x h = 0 , (8.152)

the characteristic equation is

r 2 + 2 γ r + ω 0 2 = 0 , r = − γ ± i ω d , (8.153)

where

ω d = ω 0 2 − γ 2 (8.154)

is the damped natural frequency. Hence,

x h ( t ) = e − γ t ( C 1 cos ⁡ ( ω d t ) + C 2 sin ⁡ ( ω d t ) ) . (8.155)

(With γ ≥ ω 0 the roots are real instead: the creeping and critical motions, which never swing.) The two constants come from the start. For a block pulled to x 0 and let go at rest, x h ( 0 ) = C 1 = x 0 and x ˙ h ( 0 ) = ω d C 2 − γ C 1 = 0 , so C 2 = ( γ / ω d ) x 0 and

x h ( t ) = x 0 e − γ t ( cos ⁡ ( ω d t ) + γ ω d sin ⁡ ( ω d t ) ) , (8.156)

nearly a cosine starting at its peak when the damping is weak.

Video Lecture 22, Part 9: The Driven Response (41:29)

Step 3. Particular (steady–state) solution using complex amplitude.

We look for a steady–state oscillation at the same frequency as the driving force. To simplify the algebra, we use a complex trial solution.

Step 3(a). Choose a complex trial solution.

Assume

x p ( t ) = Im { z 0 e i ω t } , (8.157)

where z 0 is a complex constant. We may write

z 0 = A e i ϕ , (8.158)

so that

x p ( t ) = Im { A e i ( ω t + ϕ ) } = A sin ⁡ ( ω t + ϕ ) . (8.159)

Step 3(b). Substitute into the differential equation.

The driven damped oscillator equation (after dividing by m ) is

d 2 x d t 2 + 2 γ d x d t + ω 0 2 x = F 0 m sin ⁡ ( ω t ) = Im { F 0 m e i ω t } . (8.160)

We substitute the full complex function z 0 e i ω t :

d d t ( z 0 e i ω t ) = i ω z 0 e i ω t , d 2 d t 2 ( z 0 e i ω t ) = − ω 2 z 0 e i ω t . (8.161)

Substituting into the ODE gives

( − ω 2 z 0 + 2 γ i ω z 0 + ω 0 2 z 0 ) e i ω t = F 0 m e i ω t . (8.162)

Step 3(c). Cancel e i ω t .

( − ω 2 + i 2 γ ω + ω 0 2 ) z 0 = F 0 m . (8.163)

Step 3(d). Solve for the complex amplitude z 0 .

z 0 = F 0 / m ω 0 2 − ω 2 + i 2 γ ω . (8.164)

Write the denominator in polar form:

ω 0 2 − ω 2 + i 2 γ ω = R e i ϕ , (8.165)

where

R = ( ω 0 2 − ω 2 ) 2 + ( 2 γ ω ) 2 , tan ⁡ ( ϕ ) = 2 γ ω ω 0 2 − ω 2 . (8.166)

The imaginary part 2 γ ω is positive, so the point R e i ϕ lies above the real axis and 0 < ϕ < π : ϕ = π / 2 exactly at ω = ω 0 , and when ω > ω 0 the real part is negative and ϕ lies between π / 2 and π (a calculator's tan − 1 must be moved into that quadrant).

Thus,

z 0 = F 0 / m R e − i ϕ . (8.167)

Step 3(e). Take the imaginary part.

x p ( t ) = Im { z 0 e i ω t } = F 0 / m R Im { e i ( ω t − ϕ ) } = F 0 / m R sin ⁡ ( ω t − ϕ ) . (8.168)

Its velocity, which the example also asks for, is

x ˙ p ( t ) = F 0 / m R ω cos ⁡ ( ω t − ϕ ) . (8.169)

Since ϕ > 0 , the block reaches each peak after the push does: the response lags the force. (Writing x p = A sin ⁡ ( ω t + θ ) , as in the lecture video, θ = − ϕ ; taking θ = + ϕ would make the block move before it is pushed, and it does not solve the equation.)

Final steady–state response:

x p ( t ) = F 0 / m ( ω 0 2 − ω 2 ) 2 + ( 2 γ ω ) 2 sin ⁡ ( ω t − ϕ ) (8.170)

with

tan ⁡ ( ϕ ) = 2 γ ω ω 0 2 − ω 2 . (8.171)

Step 4. Complete solution.

x ( t ) = e − γ t ( C 1 cos ⁡ ( ω d t ) + C 2 sin ⁡ ( ω d t ) ) + F 0 / m ( ω 0 2 − ω 2 ) 2 + ( 2 γ ω ) 2 sin ⁡ ( ω t − ϕ ) . (8.172)

Video Lecture 22, Part 10: Resonance, and the Answer (47:22)

Step 5. Physical interpretation.

  • x h ( t ) : Transient response, which decays exponentially as e − γ t and oscillates with the damped frequency ω d .

  • x p ( t ) : Steady–state response, which oscillates at the driving frequency ω .

  • The steady–state amplitude, for any damping, is

    A ( ω ) = F 0 / m ( ω 0 2 − ω 2 ) 2 + ( 2 γ ω ) 2 . (8.173)

    A check: for a very slow push, ω → 0 , A → F 0 / ( m ω 0 2 ) = F 0 / k and θ → 0 : the spring stretches as under a steady force (Hooke's law), in step with the push.

  • The amplitude reaches a maximum (resonance) when the driving frequency is close to the natural frequency of oscillation,

    ω ≈ ω 0 . (8.174)

    More precisely, minimising the denominator ( ω 0 2 − ω 2 ) 2 + ( 2 γ ω ) 2 gives the peak at ω res = ω 0 2 − 2 γ 2 , which reduces to ω 0 in the weak-damping limit γ ≪ ω 0 . Evaluating the amplitude at ω = ω 0 ,

    A ( ω 0 ) = F 0 / m 2 γ ω 0 = F 0 2 m γ ω 0 , (8.175)

    which is large when γ is small — the amplitude at resonance is limited only by the damping, and would diverge if γ → 0 .

As t → ∞ , the transient term x h ( t ) vanishes and only the steady oscillation x p ( t ) remains.

Left: the steady amplitude A() for three dampings. The peak sits near the natural frequency 0, and the weaker the damping, the taller and sharper it is: resonance. Right: the phase = - goes from 0 (a slow push is followed in step) through -/2 at resonance to - (a fast push finds the block moving the other way).
Figure 8.6. Left: the steady amplitude A ( ω ) for three dampings. The peak sits near the natural frequency ω 0 , and the weaker the damping, the taller and sharper it is: resonance. Right: the phase θ = − ϕ goes from 0 (a slow push is followed in step) through − π / 2 at resonance to − π (a fast push finds the block moving the other way).

8.5Where Differential Equations Are Used

A differential equation is a statement about how a quantity changes, and change is what physics is about. The forced damped oscillator worked at the end of this chapter is not one example among many — it is the template. The same equation m x ¨ + b x ˙ + k x = F ( t ) , with the symbols reinterpreted, governs a startling range of systems.

ExampleWhy the middle-height buildings fell in Mexico City, 1985

In the earthquake of 19 September 1985, the buildings of Mexico City that collapsed were mostly between six and fifteen floors, while many lower and taller buildings beside them stood. The soft clay of the old lake bed under the city shook back and forth with a period of about 2 s .

Model a building by its simplest way of swaying, one block on a spring: the floors are the mass, the bending columns the spring, the internal friction the damping. When the ground moves as X g sin ⁡ ( ω t ) , the sway x of the floors relative to the ground obeys

m x ¨ + b x ˙ + k x = m ω 2 X g sin ⁡ ( ω t ) , (8.176)

the forced oscillator with F 0 = m ω 2 X g (seen from the moving ground, the floors feel the force that keeps them up with its acceleration). The derivation: with the ground at x g = X g sin ⁡ ( ω t ) , the floors' own acceleration is x ¨ + x ¨ g , while the columns and the friction act only on the bending x , so Newton's law reads m ( x ¨ + x ¨ g ) = − k x − b x ˙ ; with x ¨ g = − ω 2 X g sin ⁡ ( ω t ) the ground's term moves to the right side as the push. Write the damping as γ = ζ ω 0 ; buildings have ζ ≈ 5 % . At ω 0 = ω the steady amplitude is

A = ω 2 X g 2 γ ω = X g 2 ζ ≈ 10 X g : (8.177)

a building whose natural period matches the ground's sways ten times as far as the ground moves. A low, stiff building (natural period 0.4 s , say) moves with the ground, A ≈ 0.04 X g ; a much taller one ( 4.5 s ) cannot follow the fast ground and bends little, A ≈ 1.2 X g spread over many floors (Figure 8.7). Many buildings of the middle height had natural periods near 2 s : they were driven at resonance.

The steady sway of a building, divided by the ground's motion, against the building's natural period, for ground shaking with period 2\,s and 5\% damping. The peak sits at 2\,s.
Figure 8.7. The steady sway of a building, divided by the ground's motion, against the building's natural period, for ground shaking with period 2 s and 5 % damping. The peak sits at 2 s .
Remark

Two ideas from this chapter carry the most weight later. First, for a linear equation the general solution is y h + y p : the full space of solutions is a particular solution plus the entire solution set of the homogeneous equation. Second, the exponential ansatz y = e r x turns a constant-coefficient linear ODE into an algebraic equation, because differentiating e r x only multiplies it by r . Almost every linear system in physics is attacked by some version of these two moves.

Summary Table

TypeFormMethod
Separable d y d x = g ( x ) h ( y ) Separate and integrate: ∫ d y h = ∫ g d x .
Linear (1st order) y ′ + P ( x ) y = Q ( x ) Integrating factor μ = e ∫ P d x .
Bernoulli y ′ + P y = Q y n Substitute z = y 1 − n to linearise.
Exact M d x + N d y = 0 , M y = N x Find U with U x = M , U y = N ; solution U = C .
Non-exact M d x + N d y = 0 , M y ≠ N x Integrating factor μ ( x ) or μ ( y ) .
Homogeneous (2nd, const.) a y ″ + b y ′ + c y = 0 Roots of a r 2 + b r + c = 0 ; three cases.
distinct real r 1 , r 2 y = C 1 e r 1 x + C 2 e r 2 x .
repeated root r y = ( C 1 + C 2 x ) e r x .
complex α ± i β y = e α x ( C 1 cos ⁡ ( β x ) + C 2 sin ⁡ ( β x ) ) .
Nonhomogeneous (2nd) a y ″ + b y ′ + c y = f ( x ) y = y h + y p ; undetermined coefficients for y p .

For the Interested Reader

Differential equations is a subject where the mechanics of solving can hide the point, which is that an equation relating a quantity to its rate of change already contains the system's whole future. The first item below is the best short antidote to losing sight of that. Everything listed is free.

The idea, seen

3Blue1Brown's opening film treats differential equations as a way of thinking about change, using the pendulum and the very oscillator of this chapter. It is worth watching before the techniques start to feel mechanical:

Video

Differential equations, a tourist's guide — 3Blue1Brown

Video thumbnail for Differential equations, a tourist's guide — 3Blue1BrownWatch on YouTube

Open video on YouTube

Worked technique and practice

Remark

One method this chapter did not cover is worth knowing exists: the Laplace transform, which turns a linear constant-coefficient ODE with given initial conditions into an algebraic equation, handles discontinuous and impulsive forcing cleanly, and is the standard tool in engineering. Paul's notes above develop it in full. It is, in spirit, the same trade we made with e r x and with the complex amplitude in the oscillator example — replace calculus by algebra by moving to a transform.

Video lectures

Each section of this chapter links to the part of a lecture that teaches it. The full lectures are below, and all of them are in the course playlist.

Video Lecture 22: Why Mexico City's Buildings Fell - Ordinary Differential Equations (full lecture)