So far you could only draw an ODE (3.2 Direction Fields & Euler's Method Revisited) or march along it with a solver. This lesson gives you the first technique that returns a formula. For an equation of the right shape the curves in the direction field can be written down exactly, and that changes how you use the solvers you built: they are no longer the only source of answers, they are things you can test. A closed form is an answer key.
It also settles an open account. In the last lesson Euler on from reported at , where we claimed the true solution had already blown up. We asserted that ; here you derive it by hand, in four lines.
Transcript
- Last lesson we could draw an equation, or march along it. Now we get a formula, and a way to catch a solver out.
- A separable equation has a right side that factors: a function of t times a function of y. Decay is separable. So is minus t over y. But y prime equals t minus y is not. It will not factor.
- The recipe treats dy by dt as a fraction, but it is a limit. Why does it work? Divide by g, and let H antidifferentiate one over g. By the chain rule, the t derivative of H of y is y prime over g, which is f of t. So H of y and the integral of f differ by a constant. Note we divided by g.
- Try y prime equals minus t over y, with y of zero equal to two. Separating gives y dy equals minus t dt, so y squared plus t squared equals four. That relation is a whole circle.
- But a solution must be a function of t. The start y of zero equals two picks the upper half, root of four minus t squared. At t equals plus or minus two the circle turns vertical, the slope is undefined, and the solution ends.
- Now y prime equals y squared minus one. Dividing by y squared minus one is illegal at one and minus one, and both are constant solutions. Between them the right side is negative, so solutions fall. Above one and below minus one it is positive, so they rise.
- The rest gives y equals one plus K e to the two t, over one minus K e to the two t. K zero recovers y equals one. But y equals minus one needs K infinite. Stop at the formula and you would say that start has no solution.
- From y of zero equals two, K is a third, and the denominator vanishes at t equals a half log three, 0.549. The curve is already past six and off the top of this window at 0.38; the wall is where it becomes infinite. From zero, it slides toward minus one, and never reaches it.
- Now y prime equals y squared from one half. Separating gives y equals one over two minus t. What runs out is time: the time to climb from one half to infinity is the integral of dy over y squared, which is two. Infinity arrives at t equals two.
- RK4 with h a quarter tracks it: three point nine seven two against exactly four at t equals one point seven five. Then the pole is inside its next step: thirty two point eight at t equals two, and four times ten to the eleven after that.
- Euler with h a half sails straight past the pole, still reporting small numbers: one point eight two six at t equals two. A finite number is not a solution.
- Back to minus t over y, now with y of zero equals one. The exact solution is the upper half of the unit circle, ending at t equals one. Since y squared plus t squared is constant along solutions, its drift measures a solver's error.
- Run RK4 with h of a tenth. Up to t equals one it hugs the circle, and the invariant reads one. There the exact solution reaches y equals zero. RK4 lands at 0.049, where the slope is minus twenty point five, and the next step is thrown across the axis. The invariant hops: one point five five, one point seven seven, two point four, then eight point one nine, and stays.
- Look at y alone: 2.37, 2.22, 2.05, 1.83. Smooth, finite, no warning. The invariant reads eight point one nine, not one. The values look innocent. The invariant catches it.
- Two separable laws inside fluid solvers. A shear wave decays at rate nu k squared, so doubling the wavenumber quadruples the rate: small scales die first. With quadratic drag, speed creeps toward the terminal speed, a lost constant solution: 37.7 at five seconds, 48.1 at ten.
- So: separate, justify with the chain rule, and keep the roots of g, the equilibria that dividing loses. The interval of validity belongs to the solution, and a closed form lets you test a solver. Next: linear equations.
Separating the variables
An equation is separable if the right side factors into a function of times a function of :
Exponential decay is separable (, ), and so is Newton cooling written for the temperature gap. The equation from last lesson is not: no factorization equals . That one needs a different technique (3.4 Linear First-Order Equations & Integrating Factors).
The textbook recipe is to treat as a fraction: move all the ‘s to one side, , and integrate both sides. Leibniz notation is built so that this works, but is a limit, not a quotient, so the recipe needs a reason. Here it is.
Suppose solves the equation on an interval where . Divide by :
Let be any antiderivative of . By the chain rule,
So and have the same derivative on an interval, hence differ by a constant:
That is the recipe’s output, reached without ever splitting . The “fraction” step is the substitution rule in disguise. The argument also shows exactly where the danger is: we divided by .
Implicit versus explicit
Take with . Here , so and
using to get . This is an implicit solution: a relation between and that holds along the curve, without isolated. The relation describes a full circle, but a solution must be a function of , so the solution through is the upper half, the explicit solution
The sign was chosen by the initial condition (). The interval is open because at we have and the slope is undefined: the curve has a vertical tangent and cannot be continued as a function. The equation is perfectly smooth for . The solution ends because the curve runs into the line .
Often the explicit form does not exist. For separation gives , hence
and no algebra isolates . As with the circle, the slope is undefined where . The implicit relation is still the complete answer: for each you can find by root-finding, exactly as you would solve any nonlinear equation numerically.
Exponential growth, decay and the half-life
The simplest separable equation is . Following the recipe (the root of is , noted):
The sign and merge into one arbitrary constant: with . Notice that gives , the solution we set aside. Here the general formula happens to recover it. Remember that this is luck, not a law; the next section shows a case where it does not.
With we get . For this is growth, and the time for to double satisfies , so . For decay write with . The half-life solves :
It does not mention : starting from any amount, the same time halves it. That is a property of exponentials alone, and it is why half-lives are quoted as constants of a substance.
Worked example (radiocarbon). Carbon-14 has years, so per year. A sample retains 20% of its original carbon-14. Then and
That is half-lives, a little more than two halvings (which would leave 25%).
Worked example (a cooling cup). Coffee at C sits in a C room: . Here , whose root is the lost solution (room temperature, the steady state). Elsewhere , so , and recovers again. If the coffee reaches C after 10 minutes then , so per minute, and it reaches C when , i.e. minutes. The decaying quantity is the gap from equilibrium, and its half-life is minutes.
The solutions you lose by dividing
Step 2 of the recipe divides by . That is only legal where , and where the constant function satisfies the equation (both sides are zero), yet it never appears in . It is a lost equilibrium solution, and forgetting it is the classic separation mistake.
Worked example. Solve . Constant solutions: and . Elsewhere, partial fractions give , so
Check the two lost solutions against the formula. gives : recovered. But would need . No finite produces it, and the initial condition makes a division by zero, which is the formula’s way of saying so. Someone who stops at the formula would claim that has no solution; in fact its solution is the constant .
The lost solutions are not a footnote. They are the steady states of the system (terminal velocity above is one), and they organize everything else. Because distinct solutions never cross, a solution starting between or beyond equilibria stays in its band. Here:
- gives and , which slides down into without reaching it.
- gives , and the denominator vanishes at , where the solution blows up, as the next section explains. Above the line solutions are pushed upward; every solution below is drawn toward .
Domain of validity and finite-time blow-up
Now the equation that Euler could not see. Take with . The constant is set aside, then
For this is . The denominator vanishes at
and as . There is the of the last two lessons. Euler’s at was a number for a solution that does not exist.
Three points about what “valid” means here.
The interval belongs to the solution, not the equation. The right side is smooth everywhere, so nothing in announces trouble. The maximal interval for is ; for it is ; for the pole sits at the negative time , so the solution lives on and decays; for (the lost solution) it is all of . The same equation, four different answers to “how long does it last”.
The formula continues past , the solution does not. For the expression is negative and satisfies the ODE on , but that is the solution through, say, . It is not a continuation of ours, since the solution must pass through with a finite value and none exists there.
There is a mechanism. For with , the time to travel from to is
For this equals , finite: the speed grows so much faster than that infinity is reached in finite time. For it diverges (the logarithm has no limit), so exponential growth never blows up. In general blows up in finite time exactly when ; for the same calculation gives . Finite-time blow-up is usually the model’s way of saying that a neglected effect, such as saturation, has become important.
Analytic against RK4
Here is the module’s standing habit, finally with something to compare against. The sim runs RK4 (or Euler) next to the exact solution for four separable equations and shades the region beyond the end of the exact domain.
Things to try, each of which the readout confirms:
- , , RK4, : the exact curve and RK4 agree closely on the approach (error at , exact value ), and RK4 stops after (its last finite value is ). Compare Euler with : it goes past and still reports finite values.
- , , RK4 with : after the exact solution ends at , RK4 keeps producing finite values. It hops from circle to circle: is up to , then , , , and finally for the rest of the run, with no warning of any kind. The invariant caught it; the values alone would not.
- : put and and watch the numerical solution sit exactly on the constant lines.
With RK4 is at against the exact at (0.7% off), then reads at (no exact value exists) and at . Cutting tenfold moves the explosion only from to and the value at from to , which is the right behaviour: a pole at cannot be resolved by any finite , but RK4 shows the explosion within a step or two of the truth, whereas Euler’s (last lesson) came at about . Convergence is a statement about intervals with .
Exercise: symbolic against numerical
Solve , with sympy, then check it with RK4. By hand: , and , so , with a lost solution and a blow-up at . Your code should produce the same things.
Solve , , explicitly, and give the interval on which the solution is valid.
Show worked solution
is never zero, so no solutions are lost. Then , so . From : . Therefore
The argument of the logarithm is at least for every , so the solution is valid for all real .
A radioactive sample falls to 80% of its mass in 10 days. Find the decay constant, the half-life, and the time for it to fall to 10%.
Show worked solution
and , so per day. The half-life is days. For 10%: days. (As a check, 103.2 days is half-lives and .)
Consider . (a) List the constant solutions. (b) Solve with and find when it blows up. (c) For , find , and say whether the general formula can produce the solution through .
Show worked solution
(a) gives and .
(b) , so , i.e. and
For : . The denominator vanishes at , i.e. .
(c) For : , so and . The solution through is the constant . The formula would need , so it cannot produce it; the constant must be added by hand.
Where this goes next
Separation works when the right side factors. For it generally does not, but a different trick does: 3.4 Linear First-Order Equations & Integrating Factors. The question we assumed away in the lost-solution discussion, that exactly one solution passes through each point and for how long, is the subject of 3.7 Existence & Uniqueness, and the stability of the equilibria we found is taken up with autonomous equations in 3.8 Autonomous Equations, Equilibria & Stability. You can now check a solver: next lesson’s solutions will be tested the same way.
Key Takeaways
- A separable equation is solved by . The “fraction” step is justified by the chain rule: , so and differ by a constant.
- A solution may stay implicit (), and the explicit branch is chosen by the initial condition. Its interval stops where the curve reaches a vertical tangent.
- Exponential growth and decay: gives ; the half-life and doubling time do not depend on .
- Dividing by discards the constant solutions . Check whether the formula recovers them: for , is recovered and is not. They are the steady states.
- The interval of validity belongs to the solution: from blows up at , which for is the that Euler sailed past.
- reaches infinity in finite time when converges: with , not .
- A closed form makes your solvers testable: compare against it, and compare the invariant along a run.