← Rates of Change and Differential Equations›First-Order Linear Differential Equations
First-Order Linear Differential Equations
Key Terms
- Standard form
- A first-order linear ODE has the form dy/dx + P(x)y = Q(x), where P(x) and Q(x) are functions of x only.
- Integrating factor
- μ(x) = e∫P(x) dx. Multiplying both sides by μ makes the left side an exact derivative: d/dx[μy] = μQ(x).
- Solution method
- 1. Write the equation in standard form: dy/dx + P(x)y = Q(x).
- 2. Compute μ(x) = e∫P(x) dx (omit the constant of integration here).
- 3. Multiply both sides by μ: μ dy/dx + μP(x)y = μQ(x).
- 4. Recognise the left side as d/dx[μy] and integrate both sides.
- 5. Solve for y: y = (1/μ) ∫μQ(x) dx + C/μ.
- Particular solution
- Apply the initial condition y(x0) = y0 to determine C.
- Constant coefficients
- When P(x) = p (constant), μ = epx. When Q(x) = 0, the equation is homogeneous and the solution is y = Ae−∫P dx.
- Standard form: dy/dx + P(x)y = Q(x)
- Integrating factor: μ(x) = e∫P(x) dx
- General solution: y = (1/μ) ∫μQ(x) dx + C/μ
- Equivalently: d/dx[μy] = μQ(x), so μy = ∫μQ(x) dx + C
Worked Example 1 — Constant coefficient
Solve dy/dx + 2y = 6.
Standard form: dy/dx + 2y = 6. Here P(x) = 2, Q(x) = 6.
Integrating factor: μ = e∫2 dx = e2x.
Multiply: e2x dy/dx + 2e2xy = 6e2x, i.e., d/dx[e2xy] = 6e2x.
Integrate: e2xy = ∫6e2x dx = 3e2x + C.
y = 3 + Ce−2x
Worked Example 2 — Variable coefficient
Solve dy/dx + (1/x)y = x, for x > 0.
P(x) = 1/x, so μ = e∫(1/x) dx = eln x = x.
Multiply: x dy/dx + y = x², i.e., d/dx[xy] = x².
Integrate: xy = x³/3 + C.
y = x²/3 + C/x
Worked Example 3 — Particular solution
Solve dy/dx − y = e2x, given y(0) = 1.
Standard form: dy/dx + (−1)y = e2x. P(x) = −1, μ = e−x.
d/dx[e−xy] = e−x × e2x = ex.
Integrate: e−xy = ex + C, so y = e2x + Cex.
Apply y(0) = 1: 1 = 1 + C, so C = 0.
y = e2x
Why the Integrating Factor Works
The equation dy/dx + P(x)y = Q(x) cannot in general be solved by simple separation of variables, because the left side mixes y and dy/dx in a non-factorable way. The integrating factor method is a clever trick: we seek a function μ(x) such that multiplying both sides by μ makes the left side the derivative of a product.
By the product rule, d/dx[μy] = μ dy/dx + y dμ/dx. Comparing with μ dy/dx + μP(x)y, we need dμ/dx = μP(x), which is a separable equation: dμ/μ = P(x) dx, giving μ = e∫P(x) dx. Once μ is found, the equation becomes d/dx[μy] = μQ(x), which is integrated directly.
Step-by-Step Procedure
- Standard form: Rearrange to dy/dx + P(x)y = Q(x). Both P and Q must be functions of x only (not y).
- Find μ: Compute μ(x) = e∫P(x) dx. Choose the simplest antiderivative (set the constant of integration to zero).
- Multiply through: Multiply the whole equation by μ.
- Recognise: The left side is always d/dx[μy].
- Integrate: μy = ∫μQ(x) dx + C.
- Divide: y = [∫μQ(x) dx + C] / μ.
- Apply ICs: If an initial condition is given, substitute to find C.
The Case Q(x) = 0 (Homogeneous)
If Q(x) = 0, the equation is dy/dx + P(x)y = 0, which is separable: dy/y = −P(x) dx, giving y = Ae−∫P dx. This matches the integrating factor result with the right-hand integral equal to zero.
Bernoulli Equations (Extension)
The equation dy/dx + P(x)y = Q(x)yn (n ≠ 0, 1) is called a Bernoulli equation. It can be transformed into a linear equation by the substitution v = y1−n, which converts it to dv/dx + (1−n)P(x)v = (1−n)Q(x), solvable by the integrating factor method.
Common Pitfalls
- Forgetting to divide through to get the equation into standard form before computing μ.
- Adding a constant when computing μ — this cancels and only complicates working.
- Forgetting the constant of integration C in the final step.
- Sign errors: if the equation is dy/dx − P(x)y = Q(x), the standard form uses +(−P(x))y, so μ = e−∫P dx.
Mastery Practice
-
Solve dy/dx + 3y = 12. Fluency
-
Solve dy/dx − 4y = 0, given y(0) = 5. Fluency
-
Solve dy/dx + y = ex. Fluency
-
Solve dy/dx + (2/x)y = x3, for x > 0. Fluency
-
Solve dy/dx + 2xy = 4x, given y(0) = 3. Understanding
-
Solve x dy/dx − y = x², for x > 0. Understanding
-
Solve dy/dx + y tan x = sec x, for −π/2 < x < π/2. Understanding
-
Solve dy/dx − 2y = e3x, given y(0) = 0. Understanding
-
An RL circuit satisfies L dI/dt + RI = V, where L = 2 H, R = 4 Ω, V = 12 V (constant). Find I(t) given I(0) = 0. Problem Solving
-
Solve (1 + x²) dy/dx + 2xy = cos x. Find the general solution. Problem Solving