- Practice
- About 16 min
- 5 practice questions
Linear first-order equations and the integrating factor
Put a linear first-order equation in standard form dy/dx + Py = Q, find the integrating factor e^(∫P dx), and solve it, including the form linear in x.
If something looks wrong, please tell us.
The second great family of first-order equations is the linear one. Linear equations appear wherever a rate depends on the current value plus an outside input, and they are solved by one reliable method: multiply by an integrating factor so that the left side becomes the derivative of a product. This lesson sets out the method and the traps that most often cost marks.
Standard form
A first-order equation is linear in y if it can be written as dy/dx + P y = Q, where P and Q are functions of x only (or constants). The unknown y and its derivative appear only to the first power and are not multiplied together. For example, dy/dx + 2y = e^(−x) and x dy/dx + 2y = x² are linear; the second becomes dy/dx + (2/x)y = x after dividing by x. Getting the standard form right, with coefficient 1 on dy/dx, is the first and most important step.
The integrating factor
Multiply both sides of dy/dx + Py = Q by I = e^(∫P dx). Because dI/dx = PI, the left side becomes I dy/dx + PIy, which is exactly the derivative of the product Iy. So d(Iy)/dx = IQ, and integrating gives y × I = ∫ Q × I dx + C. No constant is needed when finding I itself; it would cancel.
dy/dx + Py = Q: integrating factor I = e^(∫P dx); then y × I = ∫ Q × I dx + C. Divide by the coefficient of dy/dx first.
Worked example 1
Solve dy/dx + 2y = e^(−x). Here P = 2, so I = e^(2x). Then y e^(2x) = ∫ e^(−x) e^(2x) dx = ∫ eˣ dx = eˣ + C. Dividing by e^(2x): y = e^(−x) + Ce^(−2x).
Worked example 2: divide first
Solve x dy/dx + 2y = x², for x > 0. Divide by x: dy/dx + (2/x)y = x. Now P = 2/x, so ∫P dx = 2 ln x and I = e^(2 ln x) = x². Then yx² = ∫ x × x² dx = x⁴/4 + C, so y = x²/4 + C/x². Forgetting to divide by x and using P = 2 would give a wrong integrating factor.
Worked example 3: trigonometric P
Solve dy/dx + y tan x = sec x, for −π/2 < x < π/2. P = tan x and ∫tan x dx = ln sec x (sec x > 0 here), so I = sec x. Then y sec x = ∫ sec x × sec x dx = tan x + C. Multiplying by cos x: y = sin x + C cos x.
Worked example 4: integration by parts
Solve dy/dx − y = x. P = −1, so I = e^(−x), and y e^(−x) = ∫ x e^(−x) dx. By parts, ∫ x e^(−x) dx = −x e^(−x) − e^(−x) + C. Dividing by e^(−x): y = −(x + 1) + Ceˣ. Check: dy/dx = −1 + Ceˣ and dy/dx − y = −1 + Ceˣ + x + 1 − Ceˣ = x.
Linear in x
Sometimes an equation is not linear in y but becomes linear when x is treated as the unknown function of y: dx/dy + P₁x = Q₁, with P₁ and Q₁ functions of y. Then the integrating factor is e^(∫P₁ dy) and x × I = ∫ Q₁ I dy + C. For example, dy/dx = y/(2y² − x) gives dx/dy = 2y − x/y, that is dx/dy + x/y = 2y. For y > 0, I = y, so xy = ∫ 2y² dy = 2y³/3 + C.
Key takeaways
Write the equation as dy/dx + Py = Q with coefficient 1 on dy/dx, find I = e^(∫P dx) without a constant, and integrate Q × I. Many errors come from skipping the division in the first step or from sign slips in P. If y appears awkwardly, try treating x as the unknown. A substitution check at the end confirms the answer.
Check your understanding
-
1. What is the integrating factor of dy/dx + (1/x)y = x², for x > 0?
- 1/x
- eˣ
- ln x
- x
Show answer
Answer: D. P = 1/x, so ∫P dx = ln x and I = e^(ln x) = x.
-
2. What is the integrating factor of dy/dx − 2y = cos x?
- e^(2x)
- −2x
- e^(−2)
- e^(−2x)
Show answer
Answer: D. P = −2, so I = e^(∫−2 dx) = e^(−2x). Keep the sign of P.
-
3. What is the general solution of x dy/dx + y = x³, for x > 0?
- y = x³/4 + C
- y = x³/4 + C/x
- y = x²/3 + C/x
- y = x⁴/4 + Cx
Show answer
Answer: B. The left side is d(xy)/dx (integrating factor x after dividing by x). So xy = x⁴/4 + C and y = x³/4 + C/x.
-
4. What is the general solution of dy/dx + y cot x = 2 cos x, for 0 < x < π?
- y = sin x + C cosec x
- y = cos x + C sin x
- y = sin x + C cos x
- y = 2 sin x + C
Show answer
Answer: A. I = e^(∫cot x dx) = sin x. y sin x = ∫ 2 sin x cos x dx = sin²x + C, so y = sin x + C/sin x.
-
5. What is the general solution of dy/dx − y = eˣ?
- y = eˣ + C
- y = Ceˣ
- y = (x + C)eˣ
- y = (x + C)e^(−x)
Show answer
Answer: C. I = e^(−x). y e^(−x) = ∫ eˣ e^(−x) dx = x + C, so y = (x + C)eˣ. Check: y′ − y = eˣ.
Sign in to keep track of the lessons you finish.