A first-order differential equation is linear if it can be written in the standard form
where $P$ and $Q$ are functions of $x$ alone (either may be constant). "Linear" means $y$ and $\dfrac{dy}{dx}$ each appear only to the first power and are not multiplied together — so $\dfrac{dy}{dx}+xy=x$ is linear, but $\dfrac{dy}{dx}+y^2=x$ and $y\dfrac{dy}{dx}=x$ are not.
The integrating factor (IF)
The trick is to multiply the whole equation by a cleverly chosen factor so that the left-hand side collapses into a single derivative. That factor is the integrating factor:
After multiplying by the IF, the left side becomes exactly $\dfrac{d}{dx}\big(y\cdot\text{IF}\big)$. Integrating both sides then gives the general solution:
When computing the IF you may drop the constant of integration in $\int P\,dx$ (it only scales the IF and cancels out). Also note $e^{\ln f(x)}=f(x)$ and $e^{-\ln f(x)}=\dfrac{1}{f(x)}$ — these simplifications appear constantly.
Method
- Rearrange into standard form $\dfrac{dy}{dx}+Py=Q$ and read off $P$ and $Q$.
- Compute $\text{IF}=e^{\int P\,dx}$.
- Write $y\cdot\text{IF}=\displaystyle\int Q\cdot\text{IF}\,dx+C$ and evaluate the integral.
- Divide by the IF to make $y$ the subject (and apply any initial condition for a particular solution).
When $x$ is the dependent variable
Some equations are not linear in $y$ but become linear if you treat $x$ as a function of $y$. The standard form is then
This is the same method with the roles of $x$ and $y$ swapped. A typical signal is an equation like $\big(\text{stuff in }y\big)\,dx = \big(\dots\big)\,dy$ that resists being linear in $y$ but is tidy in $\dfrac{dx}{dy}$ — for example $\dfrac{dy}{dx}=\dfrac{1}{x+y^2}$ rearranges to $\dfrac{dx}{dy}-x=y^2$, which is linear in $x$.
Recognising the right method (mixed/miscellaneous problems)
| If the equation… | …use |
|---|---|
| separates into $f(y)\,dy=g(x)\,dx$ | Variable separable |
| has RHS depending only on $y/x$ | Homogeneous ($y=vx$) |
| fits $\dfrac{dy}{dx}+Py=Q$ | Linear, IF $=e^{\int P\,dx}$ |
| is linear only in $x$ as a function of $y$ | Linear in $x$, IF $=e^{\int P\,dy}$ |
For miscellaneous problems, always test these in order: separable → homogeneous → linear (in $y$, then in $x$). A quick scan for which variable makes the equation first-degree usually reveals the method in seconds.
Deeper Insight — the integrating factor is engineered, not guessed. The IF is not pulled from a hat: it is the precise multiplier that makes the product rule run backwards. Multiplying $y'+Py=Q$ by $\mu$ gives $\mu y'+\mu Py$; for this to equal $\dfrac{d}{dx}(\mu y)=\mu y'+\mu' y$ we need $\mu'=\mu P$, whose solution is $\mu=e^{\int P\,dx}$. That single requirement derives the formula. Once you see this, two things follow naturally: why the constant in $\int P\,dx$ can be dropped (it only multiplies $\mu$ by a constant that divides out), and why the same idea works verbatim when $x$ is the dependent variable. Understanding the construction means you never have to memorise which side the IF goes on or worry whether the method "applies" — it always applies the moment the equation is linear.