1. Solutions to 1st-order ODEs#
1.1. 1. Solution by direct integration#
When equations are of this form, we can directly integrate:
For example:
While these problems look simple, there may not be an obvious closed-form solution to all:
(You may recognize this as leading to the error function, \(\text{erf}\): \(\frac{1}{2} \sqrt{\pi} \text{erf}(x) + C\), so the exact solution to the integral over the range \([0,1]\) is 0.7468.)
1.2. 2. Solution by separation of variables#
If the given derivative is a separate function of \(x\) and \(y\), then we can solve via separation of variables:
For example, consider this problem:
We can separate this into a problem that looks like \(f(y) dy = g(x) dx\), where \(dy = \frac{1}{1+y^2}\) and \(g(x) = 1\).
Unfortunately, not every separable ODE can be integrated:
1.3. 3. General solution to linear 1st-order ODEs#
Given a general linear 1st-order ODE of the form
we can solve by integration factor:
For example, in this equation
after rearranging to the standard form
we see that \(p(x) = x\) and \(q(x) = 5e^x\).
1.4. 4. Solution to nonlinear 1st-order ODEs#
Given a general nonlinear 1st-order ODE
where \(a \neq 1\) and \(a\) is a constant. This is known as the Bernoulli equation.
We can solve by transforming to a linear equation, by changing the dependent variable from \(y\) to \(z\):
Multiply the original equation by \((1-a) y^{-a}\):
which is now a linear first-order ODE, that looks like
where \(p(x)^{\prime} = (1-a) p(x)\) and \(q(x)^{\prime} = (1-a)q(x)\).
We can solve this using the integrating-factor approach discussed above. Then, once we have \(z(x)\), we can find \(y(x)\):