Linear First-Order Equations and Integrating Factors
Solve y′ + P(t)y = Q(t) with an integrating factor, then model mixing tanks and RC circuits, and see how solutions split into transient and steady parts.
Welcome back!
Step 1 of 12Learn
The integrating factor trick
Every linear first-order equation can be written in standard form:
y′ + P(t)·y = Q(t)
These equations aren't always separable, but there's a method that always works. The idea is to multiply the whole equation by a cleverly chosen function μ(t) so that the left side becomes the derivative of a product.
By the product rule, (μy)′ = μy′ + μ′y. We want this to equal μy′ + μPy, so we need μ′ = μP. That's separable, with solution
μ(t) = e^(∫P(t) dt)
called the integrating factor. With it, the equation becomes
(μy)′ = μQ, so μy = ∫ μQ dt + C, and y = (1/μ)(∫ μQ dt + C).
Example. Solve y′ + 2y = 4, y(0) = 0.
- P = 2, so μ = e^(2t).
- Multiply: e^(2t)y′ + 2e^(2t)y = 4e^(2t), which is (e^(2t)y)′ = 4e^(2t).
- Integrate: e^(2t)y = 2e^(2t) + C.
- Divide: y = 2 + Ce^(−2t).
- Apply y(0) = 0: C = −2, so y = 2 − 2e^(−2t).
The solution rises from 0 toward 2. You don't need a constant when computing μ, because any constant would cancel at the end.
Step 2 of 12Practice · Work it out
Solve y′ + 3y = 6 with y(0) = 5. What is the value of the constant C in y = 2 + Ce^(−3t)?
Step 3 of 12Learn
A worked example with variable coefficients
When P depends on t, the integrating factor is more interesting.
Solve t·y′ + 2y = t2 for t > 0, with y(1) = 1.
- Standard form. Divide by t: y′ + (2/t)·y = t. So P = 2/t and Q = t.
- Integrating factor. ∫P dt = 2 ln t = ln(t2), so μ = e^(ln t2) = t2.
- Multiply. t2y′ + 2ty = t3, and the left side is exactly (t2·y)′.
- Integrate. t2·y = t4/4 + C.
- Solve. y = t2/4 + C/t2.
- Initial condition. y(1) = 1/4 + C = 1, so C = 3/4. The solution is y = t2/4 + 3/(4t2).
Check: y′ = t/2 − 3/(2t3), so t·y′ + 2y = t2/2 − 3/(2t2) + t2/2 + 3/(2t2) = t2. It works.
Common mistakes:
- Skipping standard form. The method requires the coefficient of y′ to be 1. With t·y′ + 2y, using P = 2 instead of 2/t gives the wrong μ.
- Sign errors in P. For y′ − 3y = …, P = −3 and μ = e^(−3t).
- Forgetting to multiply Q by μ before integrating.
Step 4 of 12Practice · Fill in the blanks
Fill in the blanks
For the equation y′ − (1/t)·y = t2 (t > 0), the integrating factor is μ = .
Step 5 of 12Learn
Mixing tanks
A classic application tracks a substance flowing in and out of a container.
Problem. A 100-liter tank holds pure water. Brine with 0.5 kg of salt per liter flows in at 4 L/min, and the well-mixed solution drains at 4 L/min. How much salt x(t) is in the tank?
Model: rate of change = rate in − rate out.
- Rate in = (0.5 kg/L)(4 L/min) = 2 kg/min.
- Rate out = (concentration in tank)(outflow) = (x/100)(4) = 0.04x kg/min.
So x′ = 2 − 0.04x, or in standard form x′ + 0.04x = 2, with x(0) = 0.
The integrating factor is e^(0.04t), and the solution is x(t) = 50 − 50e^(−0.04t).
As t → ∞, x → 50 kg, which makes sense: the tank's concentration approaches the incoming 0.5 kg/L, and 0.5 × 100 = 50. After 25 minutes, x = 50(1 − e^(−1)) ≈ 31.6 kg.
The solution has two parts. The steady-state part, 50, is what the system settles to. The transient part, −50e^(−0.04t), depends on the initial condition and dies away. This split appears in every stable linear system with constant forcing.
If inflow and outflow rates differ, the volume changes with time, P(t) is no longer constant, and the integrating factor becomes a power of the volume, but the method is the same.
Step 6 of 12Practice · Chart
Salt in the tank: x(t) = 50 − 50e^(−0.04t)
The transient dies away and the amount approaches the 50 kg steady state, fast at first and then ever more slowly.
Tap the first time at which the tank is more than 90% of the way to steady state.
Tap the point that answers the question, then press Check.
| Minutes | Salt in tank | Steady state |
|---|---|---|
| 0 | 0 | 50 |
| 10 | 16.5 | 50 |
| 20 | 27.5 | 50 |
| 30 | 34.9 | 50 |
| 40 | 39.9 | 50 |
| 50 | 43.2 | 50 |
| 60 | 45.5 | 50 |
| 80 | 48 | 50 |
| 100 | 49.1 | 50 |
Step 7 of 12Practice · Work it out
A 200-liter tank initially holds 10 kg of dissolved salt. Pure water flows in at 5 L/min and the mixture flows out at 5 L/min. How much salt (kg) remains after 40 minutes? Round to two decimals.
Step 8 of 12Note
Step 9 of 12Explore
Charging toward a final value
A charging capacitor, a mixing tank and a cooling cup all follow y = 1 − e^(−t/τ) (shown as a fraction of the final value). Change the time constant τ and watch the readouts.
- Time to reach 63%
- 2 s
- Time to reach 99%
- 9.2 s
Step 10 of 12Practice · What would you do?
What would you do?
A student solves y′ + 4y = 8 and writes: "Integrating factor e^(4t). Then e^(4t)y = ∫8 dt = 8t + C, so y = (8t + C)e^(−4t)." What went wrong?
Step 11 of 12Tap to reveal
The integrating factor method in five steps
1. Standard form
Divide so the coefficient of y′ is 1: y′ + P(t)y = Q(t).
2. Integrating factor
Compute μ = e^(∫P dt), with no constant of integration.
3. Multiply through
Multiply every term, including Q, by μ. The left side becomes (μy)′.
4. Integrate
Integrate both sides: μy = ∫μQ dt + C. Keep the constant here.
5. Solve and apply conditions
Divide by μ, then use the initial condition to find C. Check by substituting back into the original equation.
Step 12 of 12Practice · Choose one
For the RC circuit q′ + q/(RC) = V/R with R = 2,000 Ω and C = 0.0005 F, what is the time constant?
Lesson complete!