First-Order Linear Differential Equations


First-Order Linear Differential Equations

Corey
Hey Michael, have you ever seen an integral that looks impossible, but then suddenly works out because you recognize it as a product rule in disguise?

Michael
Absolutely. Like that classic example: the integral of sine x over x has no nice elementary antiderivative, but if you add an ln x times cosine x, suddenly it becomes the derivative of sine x times ln x. That’s the product rule working backwards.

Corey
Exactly. And that idea—forcing a sum of terms to be the derivative of a product—is the heart of solving first-order linear differential equations. You know, equations like dy/dx plus some function of x times y equals another function of x.

Michael
Right, and that form is dy/dx + P(x)y = Q(x). The key is that the left side isn't already a perfect derivative, but we can multiply the whole equation by something clever—an integrating factor—to make it one.

Corey
Let's walk through how that works. Suppose we multiply the equation by an unknown function μ(x). Then we have μ dy/dx + μ P y = μ Q. Now, look at the product rule for μ times y: d/dx(μ y) = μ dy/dx + μ' y. If we can make μ' equal μ P, then the left side becomes exactly d/dx(μ y).

Michael
So that's the condition: μ' = μ P. That's a separable equation itself, and solving it gives μ = e^(∫ P dx). That's the famous integrating factor formula. And you don't need a constant of integration there—any one function works.

Corey
Once you multiply by μ, the equation becomes d/dx(μ y) = μ Q. Then you just integrate both sides with respect to x, and you get μ y = ∫ μ Q dx + C, and then solve for y. Beautiful and systematic.

Michael
Let's apply it to an example. Say we have cos x dy/dx + sin x y = 1. First, divide through by cos x to get it in standard form: dy/dx + tan x y = sec x. So P(x) = tan x and Q(x) = sec x.

Corey
Then the integrating factor μ is e^(∫ tan x dx). The integral of tan x is ln|sec x|, so μ = e^(ln|sec x|) = |sec x|. But we can just use the positive version, sec x, since we only need one factor.

Michael
Multiplying the equation by sec x gives sec x dy/dx + sec x tan x y = sec^2 x. And notice, the left side is exactly d/dx(sec x · y) because the derivative of sec x is sec x tan x. Check it: product rule gives sec x dy/dx + y · sec x tan x—matches perfectly.

Corey
Now integrate both sides: d/dx(sec x y) = sec^2 x → sec x y = ∫ sec^2 x dx = tan x + C. Then we solve for y: divide by sec x, which is the same as multiplying by cos x, so y = sin x + C cos x.

Michael
And if we have an initial condition, say y(π) = 2, we plug in: 2 = sin π + C cos π = 0 + C·(-1) → C = -2. So the particular solution is y = sin x - 2 cos x.

Corey
That's the whole method. The integrating factor turns a tricky linear ODE into a straightforward integration problem. Just like the integral example at the start, it's all about recognizing and reconstructing the product rule.

Michael
And once you see that pattern, solving these equations is just a matter of following the steps: put it in standard form, compute μ, multiply, integrate, and solve for y. It really does work out nicely.

Ask anything
We've read this whole study set, so questions about it get the best answers.