First-Order Linear Differential Equations
Solve first-order linear ODEs using the integrating factor method, with a worked example and final formula.
Continue where you stopped
The core idea
On this page
A first-order linear ODE is one that can be written in the standard form
In undergraduate physics, “linear” is the default model when the response is proportional to the cause (small signals, ideal components, weak damping). It shows up as:
- Exponential relaxation: y' = -(1/τ)(y-y_∞)
- RC circuits: q' + (1/RC)q = E/R
- Linear drag: v' + (k/m)v = g
- Charging/discharging: UY1: RC Circuits
- Terminal speed (linear drag model): UY1: Resistive Forces
- Math hub: Mathematics for Undergraduate Physics
Some notes write the equation as y' = p(x) y + q(x).
To use the integrating factor, rewrite it as
so in the standard form you have P(x) = -p(x) and Q(x) = q(x).
Integrating factor method
- Rewrite as y' + P(x) y = Q(x).
- Compute μ(x) = e^(∫ P(x) dx).
- Multiply the equation by μ so the left side becomes (μ y)'.
- Integrate, then apply the initial condition to find C.
-
Identify P(x) and Q(x) in
y' + P(x) y = Q(x). -
Compute the integrating factor
μ(x) = e^(∫ P(x) dx). -
Multiply the whole equation by μ(x). The left-hand side becomes a product derivative:
(d/dx)(μ y) = μ Q. -
Integrate and solve for y:
μ y = ∫ μ Q dx + C ⇒ y = (1/μ(x))(∫ μ(x) Q(x) dx + C).
- Wrong sign in P(x): always rewrite into y' + P(x)y = Q(x) first.
- Forgetting the constant of integration: it belongs after you integrate (μ y)'.
- Dropping absolute values: ∫ (1/x)dx = ln |x| + C (use this when P(x) = 1/x, etc.).
Worked example
Solve
Here P(x) = 2 and Q(x) = e^(-x), so
Multiply through:
Integrate:
So
Apply y(0) = 0:
giving
Worked example (physics): RC charging as a linear ODE
For an RC series circuit with source E, resistor R, capacitor C, Kirchhoff’s loop rule gives
So:
This is linear with P(t) = 1/RC and Q(t) = E/R.
Integrating factor:
Multiply through:
Integrate:
Divide by e^(t/RC):
Apply q(0) = q₀ to fix the constant:
Final result:
This is the standard “approach to equilibrium” form with time constant τ = RC. (For the full circuit discussion, see UY1: RC Circuits.)
Worked example (physics): linear drag and terminal speed
In the linear-drag model (downward positive),
The solution with initial speed v(0) = v₀ is:
This is the same relaxation structure as RC circuits: one time constant controls how fast the system approaches a steady value.
Practice (with hints + answers)
1) Solve: y' + 3y = 6, with y(0)=1
Hint: P = 3, so μ = e^3x.
Answer:
Integrate:
Apply y(0) = 1: 1 = 2 + C ⇒ C = -1.
2) Solve (physics form): y' = -(1/tau)(y - y_infty), y(0)=y0
Hint: Rewrite as y' + (1/τ)y = (1/τ)y_∞.
Answer:
3) Solve: y' + (2/x) y = x, for x > 0
Hint: μ(x) = e^(∫ 2/x dx) = x².
Answer: Multiply by x²:
Integrate:
4) Match the model: which of these are linear in y? (a) y' + y^2 = x (b) y' + x y = 0 (c) y' = y/x
Hint: Linear means y appears only to the first power and is not inside nonlinear functions.
Answer:
- (a) Not linear (has y²).
- (b) Linear.
- (c) Linear (rewrite as y'-(1/x)y = 0).
Related pages
- Main hub: First Order Differential Equations
- Another core type: Separable ODEs
- Nonlinear-but-solvable: Bernoulli ODEs
- Big picture: Mathematics for Undergraduate Physics