the integrating-factor solution recipe
The integrating-factor solution recipe is the fixed, reliable checklist for solving any first-order linear equation. It is the same four moves every time, which is part of what makes linear first-order equations so dependable: you do not invent a trick, you run the procedure.
Step one: write the equation in standard form y' + p(x) y = q(x), dividing through if the coefficient of y' is not already 1. Step two: compute the integrating factor mu(x) = e^(integral of p(x) dx) (any antiderivative; no constant needed). Step three: multiply the whole equation by mu, recognize the left side as the derivative (mu y)', so the equation reads (mu y)' = mu q(x). Step four: integrate both sides to get mu y = integral of mu q dx + C, then divide by mu to isolate y = (1/mu)(integral of mu q dx + C). That C is the one arbitrary constant of the general solution; if you have an initial condition, plug it in to pin C down.
This recipe is valuable because it is complete and unconditional: as long as p and q are continuous on an interval, it returns the general solution on that interval, with no special cases and no guessing. Where it bites is the third step's integral — integral of mu q dx may have no elementary antiderivative (for example with q a Gaussian-type term), in which case the recipe still gives the answer, but only as an integral you may have to evaluate numerically. The method always works in principle; the resulting integral may not be expressible in closed form.
Solve y' + 2 y = e^(-x), y(0) = 1. Standard form already; mu = e^(2x). Multiply: (e^(2x) y)' = e^(2x) e^(-x) = e^x. Integrate: e^(2x) y = e^x + C, so y = e^(-x) + C e^(-2x). Apply y(0) = 1: 1 = 1 + C gives C = 0, so y = e^(-x).
Four moves: standardize, build mu, integrate (mu y)' = mu q, divide back — then use the initial condition to fix C.
The recipe handles the constant of integration once, in step four — never tack a separate constant onto mu. And the final integral can be left as integral of mu q dx if it has no elementary form; that is still a valid answer.