Chapter 8
Ordinary Differential Equations
8.1Introduction and General Form
An ordinary differential equation (ODE) is an equation that relates a function to its derivatives with respect to a single independent variable :
Order of an ODE: The order of a differential equation is the highest derivative that appears in the equation.
(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.
(8.4)Solution of an ODE: A function that satisfies the differential equation for all in a given interval.
(8.5)
8.2Classification of ODEs
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 and all its derivatives appear only to the first power and are not multiplied or composed with each other. The general -order linear ODE can be written as
where and are known functions of the independent variable .
If any term involves products or nonlinear functions of or its derivatives (such as , , or ), the equation is said to be nonlinear.
Linear ODEs are generally easier to solve because they obey the principle of superposition, if and are solutions, then any linear combination is also a solution. 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.
Homogeneous Linear ODE: The right-hand side equals zero,
(8.7)In this case, every term involves or its derivatives, and the trivial solution always satisfies the equation. The general solution typically involves arbitrary constants determined by initial or boundary conditions.
Nonhomogeneous Linear ODE: The right-hand side is a nonzero function ,
(8.8)The general solution is the sum of two parts:
(8.9)where is the general solution of the corresponding homogeneous equation and is a particular solution to the full nonhomogeneous equation.
Linear ODEs with Constant Coefficients: When the coefficients are constants rather than functions of ,
(8.10)the equation becomes especially important in physics and engineering. Such forms describe systems like simple harmonic oscillators, RC and RL circuits, and exponential decay processes.
8.3First-Order ODEs
A first-order ODE involves only the first derivative of the unknown function:
This general form can represent both linear and nonlinear cases, depending on how depends on . Such equations appear widely in physics—for example, in modeling exponential decay, population growth, or motion with velocity-dependent forces.
8.3.1Separable Equations
A first-order ODE is called separable if it can be expressed as
where the function on the right-hand side is the product of a function of and a function of . Although separable equations are often nonlinear, they are still analytically solvable because the variables can be separated.
Rearranging terms gives
and integrating both sides yields
Solution.
Step 1. Recognize the type of equation. This is a first-order separable (and also linear) differential equation.
Step 2. Separate the variables.
Step 3. Integrate both sides.
Step 4. Simplify the result. Exponentiate both sides:
Let (a new arbitrary constant). Then
Step 5. Verification. Differentiate :
confirming that the solution satisfies the ODE.
Solution.
Step 1. Separate the variables. Divide both sides by :
Step 2. Integrate both sides.
Step 3. Simplify the constant. Let (for ) to combine logarithms conveniently:
Step 4. Remove the logarithms.
Because can absorb the sign, we write simply
Step 5. Interpretation. The general solution
represents a family of straight lines in the -plane, one line for each value of the constant . Selecting a particular value of determines a single specific curve from this family.
Find the particular solutions satisfying (a) and (b) , and discuss any solutions not obtained by separation.
Solution.
Step 1. Separation of variables and integration. For , the equation can be written in separable form:
Integrating both sides gives
so the general solution (valid where ) is
Step 2. Monotonicity and physical interpretation. Since , 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
The figure below shows the slope field and the increasing sine segments that satisfy this condition.

Step 3. Singular (boundary) solutions. In separating variables, we divided by , which is not defined when . However, substituting directly into the differential equation shows that
are valid constant solutions since . These are singular solutions that cannot be obtained from the separated form.
Step 4. Particular solutions.
(a) : From , substituting gives or . Because , we take the increasing branch:
To extend this continuously for all , attach the constant segments :
This gives a single continuous nondecreasing solution over the entire real line.
(b) : The constant function is an obvious solution. Alternatively, using at gives . Choosing the increasing branch near ,
To extend for all :
There exist infinitely many such piecewise continuous solutions, obtained by shifting these arcs horizontally.
Step 5. Interpretation and summary.
The general solution applies where and .
The singular solutions correspond to the flat portions of the slope field where .
The complete solution set consists of rising sine arcs smoothly connected to horizontal segments at .
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
Integrating Factor Method:
Compute the integrating factor:
(8.39)Multiply through by :
(8.40)Integrate:
(8.41)Solve for :
(8.42)
Solution.
Step 1. Identify and . The equation is in the standard linear form
where
Step 2. Compute the integrating factor. The integrating factor is
Step 3. Apply the general solution formula.
Substitute and :
Step 4. Evaluate the integral.
Final Answer:
Verification. Substitute into the original equation:
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
where and are known functions of , is called the Bernoulli equation. It is nonlinear for , but it can be transformed into a linear equation through an appropriate substitution.
Step 1. Multiply by .
Step 2. Simplify using the substitution .
Hence, . Substitute this into the previous equation:
Step 3. Multiply through by to simplify.
This is now a first-order linear ODE in , 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 , the original dependent variable is recovered via
The Bernoulli equation provides an important link between nonlinear and linear first-order ODEs. By multiplying through by and substituting , 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.
Solution.
Step 1. Multiply by with .
Step 2. Let . Then , so . Substitute:
Step 3. Solve the linear equation using the integrating-factor formula. For
the integrating factor is . Apply
Step 4. Back–substitute to . Since ,
Step 5. Singular solution. Because for all real , the constant function
also satisfies the original ODE. Thus the complete set consists of the one-parameter family above together with .
8.3.5Exact Differential Equations
A general first-order differential equation can often be written in the form
where and are functions of two variables and .
The first–order differential equation
is called exact if there exists a scalar function (called a potential function) such that
In this case, the general solution can be written implicitly as
A necessary and sufficient condition for exactness (assuming continuous partial derivatives) is
The condition above ensures that the mixed second derivatives of are equal:
This is guaranteed by Clairaut’s theorem when and have continuous partial derivatives.
Solution Procedure:
Check whether . If true, the equation is exact.
Integrate with respect to , treating as constant:
(8.72)where is an arbitrary function of .
Since must satisfy
(8.73)we differentiate the above expression for with respect to :
(8.74)Now substitute the known expression for from the original equation and equate:
(8.75)From this, we can solve for :
(8.76)Integrate with respect to to find , and then write the final expression for . The general solution is obtained from
(8.77)Integrate to find , substitute back, and write the final solution .
Solve
Solution.
Step 1. Identify
Step 2. Check the exactness condition:
They are equal, so the equation is exact.
Step 3. Integrate with respect to :
Step 4. Differentiate with respect to :
Compare with , which implies .
Step 5. Hence . The potential function is
Step 6. The general solution is
8.3.6Integrating Factors
If the equation is not exact, it may sometimes be made exact by multiplying by a function called an integrating factor:
The new equation is exact if
Unfortunately, there is no universal method for finding . However, there are two common and important special cases.
Case 1: Integrating factor depends on only.
If , then the equation becomes exact provided that
Hence,
Case 2: Integrating factor depends on only.
If , then the equation becomes exact provided that
Hence,
Solve
Solution.
Step 1. Identify and test exactness.
Compute
Since , the equation is not exact.
Step 2. Seek an integrating factor . Use
Hence
Step 3. Multiply the equation by .
Define
Step 4. Check exactness \& find a potential .
Integrate w.r.t. (treating constant):
Using and ,
Now
Step 5. Implicit solution.
Solve
Solution.
Step 1. Identify and test exactness.
Compute
Since , the equation is not exact.
Step 2. Seek an integrating factor . Use
Hence
Step 3. Multiply the equation by .
Define
Step 4. Check exactness \& find a potential .
Integrate w.r.t. (treating constant):
Now
Step 5. Implicit solution.
Many physical systems—such as thermodynamics, potential flow, and electrostatics—lead to exact differential equations, where 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
where , and are known functions of , and is the unknown function to be determined.
When are constants, the equation simplifies to
We will first study the homogeneous case () and then the nonhomogeneous case ().
8.4.1Homogeneous Equations with Constant Coefficients
A second–order homogeneous linear differential equation with constant coefficients has the form
Consider the homogeneous linear differential equation
Its solutions are determined by the characteristic (auxiliary) equation
If and are the roots of this quadratic, then the general solution is:
where are arbitrary constants.
Consider the homogeneous constant–coefficient ODE
Step 1: Exponential trial and substitution. Assume a trial solution with constant . Then
Substituting into the ODE gives
Since for all , we must have the characteristic equation
Step 2: Distinct real roots . If the characteristic polynomial has two distinct real roots and , then
are both solutions. Their Wronskian is
so are linearly independent. Hence the general solution is
Step 3: Repeated real root . (Construction of the term.) If the characteristic polynomial has a double root , then we already have one solution . To find a second, linearly independent solution, set
where is to be determined. Compute derivatives:
Substitute into the ODE:
Divide by and group terms by :
Because is a root of the characteristic polynomial, we have
Moreover, because the root is repeated, the derivative of the characteristic polynomial also vanishes at :
Hence the equation for reduces to
Discarding the multiple of the first solution (the part), we take and obtain
Therefore, the general solution in the repeated-root case is
Step 4: Complex conjugate roots with . If , then are solutions. Taking real and imaginary parts,
are real solutions. Their Wronskian is
so they are linearly independent. Thus the general real solution is
Combining the three cases completes the proof.
The step in the repeated-root case is precisely the condition where . This is why the reduction–of–order equation collapses to , giving and hence .
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 : derivatives only pull down factors of , converting the differential equation to an algebraic one.
8.4.2Nonhomogeneous Equations
A nonhomogeneous second-order linear ODE is
where is a known forcing (nonzero) function.
The general solution of a nonhomogeneous linear ODE is
where
is the homogeneous (complementary) solution satisfying ,
is a particular solution satisfying the full equation for the given .
If is composed of elementary functions such as exponentials, polynomials, or sines and cosines, we assume a trial form for resembling , substitute into the ODE, and solve for the unknown coefficients.
If any term of the assumed duplicates a part of , multiply by the smallest power of necessary to ensure linear independence.
8.4.3Example: Forced and Damped Harmonic Oscillator
Consider the driven, damped oscillator
where is the mass, the damping coefficient, the spring constant, and the external driving force.
Solution.
Divide through by :
where
Step 2. Homogeneous solution.
For the unforced system,
the characteristic equation is
where
is the damped natural frequency. Hence,
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
where is a complex constant. We may write
so that
Step 3(b). Substitute into the differential equation.
The driven damped oscillator equation (after dividing by ) is
We substitute the full complex function :
Substituting into the ODE gives
Step 3(c). Cancel .
Step 3(d). Solve for the complex amplitude .
Write the denominator in polar form:
where
Thus,
Step 3(e). Take the imaginary part.
Final steady–state response:
with
Step 4. Complete solution.
Step 5. Physical interpretation.
: Transient response, which decays exponentially as and oscillates with the damped frequency .
: Steady–state response, which oscillates at the driving frequency .
For weak damping (), the steady–state amplitude is
(8.163)The amplitude reaches a maximum (resonance) when the driving frequency is close to the natural frequency of oscillation,
(8.164)More precisely, minimising the denominator gives the peak at , which reduces to in the weak-damping limit . Evaluating the amplitude at ,
(8.165)which is large when is small — the amplitude at resonance is limited only by the damping, and would diverge if .
As , the transient term vanishes and only the steady oscillation remains.
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 , with the symbols reinterpreted, governs a startling range of systems.
Mechanical vibration. Mass on a spring, a pendulum, a building swaying in wind: all are , and the resonance condition is why soldiers break step on bridges.
Electrical circuits. The series RLC circuit obeys , identical in form to the oscillator with , , . Resonance here is how a radio selects a station.
Growth and decay. The first-order equation describes radioactive decay, population growth, cooling, and the charging of a capacitor — the separable equations of this chapter.
Chemical kinetics and mixing. Reaction rates and concentration in a stirred tank are first-order linear ODEs solved by the integrating factor.
The starting point for everything later. Series solutions (Chapter 9) handle ODEs with variable coefficients that these elementary methods cannot; partial differential equations (Chapter 10) are solved by separating them into ordinary ones.
Two ideas from this chapter carry the most weight later. First, for a linear equation the general solution is : the full space of solutions is a particular solution plus the entire solution set of the homogeneous equation. Second, the exponential ansatz turns a constant-coefficient linear ODE into an algebraic equation, because differentiating only multiplies it by . Almost every linear system in physics is attacked by some version of these two moves.
Summary Table
| Type | Form | Method |
| Separable | Separate and integrate: . | |
| Linear (1st order) | Integrating factor . | |
| Bernoulli | Substitute to linearise. | |
| Exact | , | Find with , ; solution . |
| Non-exact | , | Integrating factor or . |
| Homogeneous (2nd, const.) | Roots of ; three cases. | |
| distinct real | . | |
| repeated root | . | |
| complex | . | |
| Nonhomogeneous (2nd) | ; undetermined coefficients for . |
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:
Differential equations, a tourist's guide — 3Blue1Brown
Watch on YouTube
Worked technique and practice
Paul's Online Math Notes — Differential Equations. The closest match to this chapter and the best source of extra practice: the full set, with Linear Equations and Second Order Equations covering our first- and second-order material in more detail, including variation of parameters, which we did not treat.
OpenStax, Calculus Volume 2, Chapter 4. 4.3 Separable Equations and 4.5 First-Order Linear Equations — a slower first pass with many worked examples and applications to growth, decay and mixing.
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 and with the complex amplitude in the oscillator example — replace calculus by algebra by moving to a transform.