Numerical Methods · Learn
Some nonlinear ODEs are nonlinear by exactly one term — a single power of y. Strip that power out with the right substitution and a "hard" nonlinear equation becomes an ordinary linear one.
A Bernoulli equation is a first-order ODE of the shape
For $n=0$ or $n=1$ this is already linear. For any other $n$, the $y^n$ term makes it nonlinear — and nonlinear ODEs generally have no algorithm for solving them. Bernoulli equations are the exception: a clean substitution turns them linear.
Let $v = y^{1-n}$. By the chain rule, $v' = (1-n)y^{-n}y'$. Divide the original equation by $y^n$ first:
Every term is now expressible in $v$: $y^{-n}y' = \frac{1}{1-n}v'$ and $y^{1-n}=v$. Multiply through by $(1-n)$ and you get a first-order linear equation:
Solve this with an integrating factor — the same recipe from the first-order linear ODE page — then undo the substitution: $y = v^{1/(1-n)}$.
It's worth verifying the substitution rather than taking it on faith. Solve the original nonlinear equation directly by numerical integration (RK4), and separately solve the transformed linear v-equation by RK4, then convert back with $y=v^{1/(1-n)}$. The two curves should be identical up to numerical roundoff — which means the substitution is an exact change of variables, not an approximation.
Type your own P(x), Q(x), and n, click anywhere to drop an initial condition, and watch the direct-integration curve and the back-substituted curve land on top of each other. The "max difference" stat quantifies just how exact the match is. Open the lab →
| Model | Equation | n |
|---|---|---|
| Logistic growth | $y'=ry(1-y/K)$ | 2 |
| Velocity-squared drag | $mv'=mg-kv^2$, rearranged | 2 |
| Chemical 2nd-order kinetics | $c'=-kc^2+\text{source}(x)c$ | 2 |
Any time a rate equation has a "self-limiting" term proportional to a power of the quantity itself — population pushing against a carrying capacity, drag growing with speed squared — there's a decent chance it's a Bernoulli equation underneath.
EngineeringCandy · Learn · the theory behind the playground