Ordinary Differential Equations

Differential equations of 1st order

↩ Back
General first-order ODE
$$\frac{dy}{dx} = f(x,y) \qquad \text{or} \qquad M(x,y)\,dx + N(x,y)\,dy = 0$$
Separable? $\dfrac{dy}{dx} = g(x)\,h(y)$

Separation of Variables

The most direct case: $x$ and $y$ can be fully isolated on opposite sides.
Condition
$\dfrac{dy}{dx} = g(x)\,h(y)$
1
Separate
$$\frac{dy}{h(y)} = g(x)\,dx$$
2
Integrate both sides independently
$$\int \frac{dy}{h(y)} = \int g(x)\,dx + C$$
3
Isolate $y$ if possible, to obtain an explicit solution.
Example
$$\frac{dy}{dx} = xy \;\Rightarrow\; \frac{dy}{y} = x\,dx \;\Rightarrow\; \ln|y| = \frac{x^2}{2} + C$$
$$y(x) = C e^{x^2/2}$$
Recognizable pattern? spot a known differential

Grouping Known Differentials

Spot a familiar group of terms, replace it with $du$, and what remains is usually separable.
1
Look for a group of terms that matches one of the differentials below, e.g. $y\,dx+x\,dy = d(xy)$.
2
Replace that group with $du$, where $u$ is the matching expression (e.g. $u=xy$).
3
Rewrite the rest of the equation in terms of $u$ and the remaining variable. This is usually now separable.
4
Solve as a separable equation, then substitute back for $u$.
$$d(xy) = x\,dy + y\,dx$$
$$d(x^2+y^2) = 2(x\,dx+y\,dy)$$
$$d\!\left(\frac{x}{y}\right) = \frac{y\,dx-x\,dy}{y^2}$$
$$d\!\left(\arctan\frac{y}{x}\right) = \frac{x\,dy-y\,dx}{x^2+y^2}$$
$$d\!\left(\ln\frac{x}{y}\right) = \frac{y\,dx-x\,dy}{xy}$$
There are other identities beyond these five; the goal is to recognize the pattern, not to memorize a list.
Example
$$y\,dx + x\,dy + x^2y^5\,dy = 0$$
$$y\,dx+x\,dy = d(xy) \;\Rightarrow\; u = xy, \;\; x = \frac{u}{y}$$
$$du + x^2y^5\,dy = 0 \;\Rightarrow\; du + u^2y^3\,dy = 0 \;\Rightarrow\; \frac{du}{u^2} = -y^3\,dy$$
$$\text{separable in } u,y \;\Rightarrow\; -\frac{1}{u} = -\frac{y^4}{4} + C$$
$$xy = \frac{4}{y^4 + C}$$
This is a shortcut, not a general method. If nothing matches, try Exact (Method 4) or Integrating Factor (Method 5) instead.
Linear in $y$? $y' + P(x)\,y = Q(x)$

Linear Differential Equations

Always solvable via an integrating factor; no exactness check needed.
Condition
$y' + P(x)\,y = Q(x)$
1
Compute the integrating factor
$$\mu(x) = e^{\int P(x)\,dx}$$
2
Integrate and isolate $y$
$$y(x) = \frac{1}{\mu(x)} \int \mu(x)\,Q(x)\,dx$$
Example
$$y' + \frac{1}{x}y = 3x \;\Rightarrow\; \mu(x) = e^{\int \frac{1}{x}dx} = x$$
$$y(x) = \frac{1}{x}\int 3x \cdot x\,dx = \frac{1}{x}\left(x^3 + C\right)$$
$$y(x) = x^2 + \frac{C}{x}$$
Exact? $\dfrac{\partial M}{\partial y} = \dfrac{\partial N}{\partial x}$

Exact Differential Equations

Condition
$$M(x,y)\,dx + N(x,y)\,dy = 0$$
$$\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}$$
1
Integrate $M$ with respect to $x$
$$f(x,y) = \int M(x,y)\,dx + g(y)$$
2
Differentiate with respect to $y$ and compare with $N(x,y)$ to determine $g(y)$.
3
Write the implicit solution $f(x,y) = C$.
Example
$$e^y\,dx + (xe^y + 2y)\,dy = 0 \quad \Rightarrow \quad M_y = e^y = N_x \;\checkmark$$
$$f(x,y) = \int e^y\,dx + g(y) = xe^y + g(y), \quad f_y = xe^y + g'(y) = xe^y + 2y \Rightarrow g(y)=y^2$$
$$xe^y + y^2 = C$$
Not exact but a suitable integrating factor may exist

Exact with Integrating Factor

If $M\,dx + N\,dy = 0$ has a general solution, multiplying by a suitable factor $\mu(x,y)$ makes it exact. In practice, only the two cases below are checked.
1
Try $\mu = \mu(x)$. Compute:
$$g(x) = \frac{1}{N}\left(\frac{\partial M}{\partial y} - \frac{\partial N}{\partial x}\right)$$
If this depends only on $x$, then $\mu(x) = e^{\int g(x)\,dx}$.
2
Otherwise, try $\mu = \mu(y)$. Compute:
$$h(y) = \frac{1}{M}\left(\frac{\partial N}{\partial x} - \frac{\partial M}{\partial y}\right)$$
If this depends only on $y$, then $\mu(y) = e^{\int h(y)\,dy}$.
3
Multiply the whole equation by $\mu$. It is now exact, so solve as in Method 4.
Case 1: depends on x
$\mu(x) = e^{\int g(x)\,dx}$
Case 2: depends on y
$\mu(y) = e^{\int h(y)\,dy}$
Example
$$y\,dx + (x^2 y - x)\,dy = 0 \;\Rightarrow\; M_y - N_x = 1-(2xy-1) = 2(1-xy)$$
$$\frac{M_y-N_x}{N} = -\frac{2}{x} \;\;\text{(depends only on } x\text{)} \;\Rightarrow\; \mu(x) = \frac{1}{x^2}$$
$$\frac{y}{x^2}\,dx + \left(y - \frac{1}{x}\right)dy = 0 \;\; \text{is now exact; solve with Method 4}$$

If neither $g(x)$ nor $h(y)$ comes out as a function of a single variable, these two simple cases don't apply. A more general integrating factor may still exist, but finding it requires other techniques (grouping known differentials, inspection, or case-specific formulas).