1 / 10
Chapter 1 · First-Order ODEs

First-Order Linear Differential Equations

The Integrating Factor Method
Dr. Mohamed Mabrok · Qatar University

What is a Linear First-Order ODE?

A linear equation is one where $y$ and $y'$ appear only to the first power — no $y^2$, $\sin(y)$, or $y \cdot y'$ terms.
Standard Form
A first-order linear ODE has the form:
$$\frac{dy}{dx} + P(x)y = Q(x)$$
where $P(x)$ and $Q(x)$ are functions of $x$ alone (not $y$).
What Makes It Linear?
Both $y$ and $\frac{dy}{dx}$ appear to the first power only. The equation is linear in both the dependent variable and its derivative.

The Integrating Factor Method

The key insight: multiply the equation by a special function $\mu(x)$ called the integrating factor.
Integrating Factor Formula
$$\mu(x) = e^{\int P(x)\,dx}$$
Multiply both sides of the ODE by $\mu(x)$.
General Solution Formula
After multiplying by $\mu$ and integrating:
$$y(x) = \frac{1}{\mu(x)}\left[\int \mu(x)\,Q(x)\,dx + C\right]$$

Why the Integrating Factor Works

STEP 1 Start with the standard form
$$\frac{dy}{dx} + P(x)y = Q(x)$$
STEP 2 Multiply both sides by $\mu(x) = e^{\int P(x)\,dx}$
$$\mu(x)\frac{dy}{dx} + \mu(x)P(x)y = \mu(x)Q(x)$$
STEP 3 The left side is the product rule!
$$\frac{d}{dx}[\mu(x) \cdot y] = \mu(x)Q(x)$$
STEP 4 Integrate both sides and solve for $y$

The 4-Step Solution Method

STEP 1
Write in standard form
Divide by coefficient of $y'$ if needed: $\frac{dy}{dx} + P(x)y = Q(x)$
STEP 2
Compute $\mu(x)$
$\mu(x) = e^{\int P(x)\,dx}$ (ignore the $+C$ in the exponent)
STEP 3
Apply the formula
$y = \frac{1}{\mu}\left[\int \mu Q\,dx + C\right]$
STEP 4
Apply initial conditions
Use $y(x_0) = y_0$ to find the constant $C$
Worked Example

Solve: $y' + 2y = 6$,   $y(0)=1$

STEPS 1–2 Identify $P(x)$ and compute $\mu(x)$
$$P(x) = 2, \quad Q(x) = 6 \quad \Longrightarrow \quad \mu(x) = e^{\int 2\,dx} = e^{2x}$$
STEP 3 Apply the formula: $y = \frac{1}{e^{2x}}\left[\int 6e^{2x}\,dx + C\right]$
$$\int 6e^{2x}\,dx = 3e^{2x} + C_1 \quad \Longrightarrow \quad y = e^{-2x}(3e^{2x} + C) = 3 + Ce^{-2x}$$
General solution: $\boxed{y = 3 + Ce^{-2x}}$
Worked Example (continued)

Apply Initial Condition: $y(0) = 1$

STEP 4 Substitute $x=0$, $y=1$
$$1 = 3 + Ce^{0} = 3 + C \quad \Longrightarrow \quad C = -2$$
Particular solution:
$$\boxed{y = 3 - 2e^{-2x}}$$
Key Observation
As $x \to \infty$, $e^{-2x} \to 0$, so $y \to 3$. The value $y = 3$ is called the equilibrium.
All solutions (regardless of initial condition) converge to this equilibrium!

Variable Coefficients Example

The integrating factor method also works when $P(x)$ varies with $x$.
Example Solve $xy' + y = x^2$
Step 1: Divide by $x$ to get standard form:
$$y' + \frac{1}{x}y = x$$
Step 2: Compute $\mu(x)$:
$$\mu(x) = e^{\int (1/x)\,dx} = e^{\ln|x|} = x$$
Step 3: General solution:
$$y = \frac{1}{x}\left[\int x \cdot x\,dx + C\right] = \frac{1}{x}\left[\frac{x^3}{3} + C\right] = \frac{x^2}{3} + \frac{C}{x}$$

Common Pitfalls

Pitfall 1: Coefficient of $y'$ is not 1
Always divide first! If your equation is $2y' + 4y = 10$, divide by 2 to get $y' + 2y = 5$ before finding $\mu(x)$.
Pitfall 2: Forgetting the integration constant
When you compute $\mu(x) = e^{\int P(x)\,dx}$, ignore the $+C$ in the integral. But don't forget $C$ in the final formula!
Pitfall 3: Negative $P(x)$ leads to exponential growth
If $P(x) = -3$ (negative), then $\mu(x) = e^{-3x}$ causes growth as $x$ increases. This is correct — solutions grow!
Pitfall 4: Not all integrals have closed forms
If $\int P(x)\,dx$ or $\int \mu Q\,dx$ cannot be evaluated, your solution may be left in integral form (implicit).

Key Takeaways

📄
Standard form is essential
Always write as $\frac{dy}{dx} + P(x)y = Q(x)$ with coefficient of $y'$ equal to 1.
✓️
$\mu$ transforms via product rule
Multiplying by $\mu = e^{\int P\,dx}$ makes the left side $\frac{d}{dx}[\mu y]$.
Constant coefficients give equilibrium
For $y' + ay = b$ (constant), the equilibrium is $y_{eq} = \frac{b}{a}$. All solutions converge to it.
🌌
Real-world applications abound
Mixing tanks, RC circuits, Newton's cooling law, pharmacokinetics, and population dynamics all use linear ODEs.
$$\text{Standard form} \;\Rightarrow\; \mu(x) = e^{\int P\,dx} \;\Rightarrow\; \text{Formula} \;\Rightarrow\; \text{Apply IC}$$
🔊 Voice