Recipe
Solve a first-order linear equation
Use when: the equation is (or can be rearranged into) \dfrac{dy}{dx}+P(x)y=Q(x) — y and y' appear only to the first power, never multiplied together or raised to a power
Goal: an explicit solution y(x)
Taught in First-order linear equations and integrating factors
Quick recipe
-
1
Divide through so the coefficient on y' is exactly 1, giving \dfrac{dy}{dx}+P(x)y=Q(x).
Example
Take \dfrac{dy}{dx}+\dfrac2xy=x^2 (for x>0) — already standard form, since the coefficient on y' is already 1. Reading off P(x)=\dfrac2x and Q(x)=x^2 is only safe because that coefficient is 1; a leading 3\dfrac{dy}{dx} would need to be divided away first.
Why: P(x) only means what the method needs it to mean once the y' coefficient is 1 — skipping this step is the most common way the method goes wrong.
-
2
Compute \mu(x)=e^{\int P(x)\,dx}.
Example
\mu(x)=e^{\int (2/x)\,dx}=e^{2\ln x}=x^2.
Why: \mu(x) is chosen for exactly one purpose — multiplying the standard-form equation by it collapses the entire left side into the single derivative \frac{d}{dx}[\mu(x)y].
-
3
Multiply both sides by \mu(x), then rewrite the left side as \dfrac{d}{dx}[\mu(x)y].
Example
x^2\dfrac{dy}{dx}+2xy=x^4, and the left side is exactly \dfrac{d}{dx}[x^2y], so \dfrac{d}{dx}[x^2y]=x^4
Why: this is the identity the integrating factor exists to create — it turns an equation that mixes y and y' into one that's directly integrable.
-
4
Integrate to get \mu(x)y=\displaystyle\int\mu(x)Q(x)\,dx.
Example
x^2y=\int x^4\,dx=\dfrac{x^5}{5}+CWhy: the left side is now literally the derivative of \mu(x)y, so undoing the derivative is the only step left on that side.
-
5
Divide by \mu(x) to isolate y; if given y(x_0), substitute it to solve for the constant.
Example
Dividing by x^2: y=\dfrac{x^3}{5}+\dfrac{C}{x^2}. If y(1)=3: 3=\dfrac15+C, so C=\dfrac{14}5, giving \boxed{y=\dfrac{x^3}{5}+\dfrac{14}{5x^2}}
Why: dividing by \mu(x) (never zero, since it's an exponential) is what finally isolates the actual unknown.
Common mistakes
- Reading off P(x) before dividing to make the y' coefficient exactly 1.
- Forgetting the constant of integration when integrating \mu(x)Q(x).
- Dropping the absolute value inside e^{\int P(x)\,dx} when P(x) involves a logarithm, then not restricting to the interval where the simplified form is valid.
- Multiplying only the left side by \mu(x) and forgetting the right side.