Lesson 3.3 Separable Equations ended with an equation it could not touch: is not separable, because no factorization equals . This is the lesson that pays that debt. The equation belongs to the most important family in the course, the linear first-order equations, and the technique that solves it also tells you what every solution of the family looks like: a piece that fades, riding on a piece that persists.
That second part is what matters for simulation. A tracer dye in a ventilated room, the temperature of a cooling cup, the velocity of a body in slow viscous drag under a changing push: each relaxes toward whatever the forcing is asking for, and each forgets its starting state at a rate you can read off the equation. Once you can see that split, you can look at a solver’s output and ask which part is physics and which part is the start-up transient you should discard.
Transcript
- Last lesson left y prime equals t minus y unsolved. Now we solve it, and see what every solution of its family looks like.
- A warning first. Take t y prime equals y. In standard form p is minus one over t, undefined at zero. The solutions are lines y equals C t, all through the origin. From zero, zero: infinitely many. From zero, one: none. Anywhere else, exactly one.
- The trick: multiply by an unknown mu. The product rule gives mu y, differentiated, equals mu y prime plus mu prime y. The first terms already match. The second terms match only if mu prime equals p mu.
- Look at that demand. It is a function of t times a function of mu: separable, which last lesson solved. Divide by mu, integrate, and mu is e to the P. Now mu y, differentiated, equals mu g, and only integration is left.
- Apply it to y prime equals t minus y. Here p is one, so mu is e to the t. Then e to the t y, differentiated, is t e to the t. Integrate and divide: y is t minus one plus C e to the minus t. Starting at one makes C two.
- Here it is on the direction field from lesson 3.2: the curve Euler was chasing. It dips to a minimum where it meets the line y equals t, at t equals log two, 0.693, with y also 0.693. Then it climbs.
- The line y equals t minus one is the solution with C zero. The curve settles onto it, and the gap is exactly two e to the minus t: 0.736 at one, 0.271 at two, 0.100 at three, and only 0.0135 at five.
- Now push with a cosine: y prime plus y equals cos t, starting at two. The solution is two pieces: a steady state driven by the forcing, and a transient, one and a half e to the minus t, that remembers the start. At zero, half plus one and a half is two.
- Why does the transient die? It solves z prime equals minus z, so its slope is minus its own size: minus 1.5 at size 1.5, minus 0.552 at size 0.552. Smaller means gentler. By t equals four it is 0.0275, by eight 0.0005.
- Beside the push, the steady state has amplitude one over root two, 0.7071. It peaks late: the push peaks at zero, the response at pi over four, 0.785, a lag of forty-five degrees. It peaks where y prime is zero, so y equals cos t: where it meets the push.
- Start from six different values. Each curve is the steady state plus a transient, and two starts differ only by a multiple of e to the minus t: five at the start, 0.249 by t equals three. All collapse onto one sinusoid. The start is forgotten; the forcing persists.
- Raise a from one to three at omega one, and the amplitude falls from 0.7071 to 0.3162. Keep a at one and push at omega four: 0.2425, with the lag at seventy-six degrees. A fast push is averaged out: a low-pass filter.
- A second route. Take the unforced shape y h and let its constant vary: y equals u y h. The bracket multiplying u is zero, since y h solves the unforced equation. What is left is u prime equals mu g.
- In a ventilated room, c prime equals lambda times c equilibrium minus c. The equilibrium decides where it ends, lambda how fast: 779 ppm after one time constant, two hours. A daily swing outdoors reaches the room smaller by 0.886, and 1.84 hours late.
- So: multiply by mu, which separation builds. The solution is a driven part plus a part that remembers the start, and that part dies. Where the leading coefficient vanishes, the theory changes. Next: what equilibria do.
Standard form, and why the leading coefficient matters
A first-order equation is linear if and appear only to the first power and are never multiplied together. Every such equation can be written
To solve it we divide by and work in the standard form
The function is the forcing: what is being pushed in from outside. When the equation is homogeneous, and we will see that its solutions are the key to everything.
The division is not a formality. It is legal only where , and where vanishes the theory really does change. Take , so , . In standard form , and is undefined at . The solutions are (check: ), and every one of them passes through the origin. So the initial condition has infinitely many solutions, while has none. Away from , on say, each initial condition has exactly one solution. The honest statement of the theory is: if and are continuous on an interval, then every initial condition in that interval has exactly one solution, and it lives on the whole interval. The interval of validity comes from the coefficients, not from the solution, which is a contrast with the blow-up of last lesson. Linear equations cannot blow up in the middle of an interval where and are continuous.
Deriving the integrating factor
We want a trick that makes the left side of into a derivative that we can integrate. Multiply the whole equation by an unknown function :
The product rule says . The left side above has the right first term, . It becomes exactly if and only if the second terms agree, . So demand that
Now look at what kind of equation this is. It is : a function of times a function of . It is separable, and the previous lesson solves it in one line. The root of is , which is useless here, so divide:
We need only one , so we take any antiderivative and ignore the constant. This is the point of the whole lesson: separation of variables is not a separate topic from linear equations, it is the machine that builds the integrating factor. With the equation reads
and now only integration is left:
Check it on the simplest case, constant and . Then , , so . That is exponential decay, as it should be: .
The promised payoff: y’ = t − y
Write as . So , , and . The equation becomes
Integrate the right side by parts, plus a constant:
Use : , so , and
This is the curve that 3.2 Direction Fields & Euler's Method Revisited used as its answer key, the one you watched Euler chase. Substitution confirms it: , and . The exact value is , and RK4 with reaches , an error of . The curve dips to its minimum where it meets the line , at with , and then climbs. The line it settles onto is a solution with . Notice what that means: the lesson-3.2 description “the term fades and the curve settles onto the straight line” was already the statement of transient and steady state. We just did not have the words yet.
The structure of linear solutions
The answer has two parts, and that is not an accident of this example. In general
The second part is the solution of the homogeneous equation , which we found above to be : a one-parameter family, one curve for each , all multiples of a single shape. The first part, , is any one solution of the full equation (a particular solution). Here .
Why must every solution have this shape? Suppose and both solve . Subtract the equations: satisfies . So the difference of any two solutions is a homogeneous solution, which is for some . Take a concrete pair for : and . Their difference does satisfy .
You can state the structure without any vector-space language. There is one steady response to the forcing, , that does not depend on how you started. And there is a leftover freedom, a single number , that records where you started. The initial condition fixes only that number: with , it is . This one-parameter freedom is the “first-order” in the name; each extra derivative in a later lesson adds one more knob.
Linearity also gives superposition: if responds to the forcing and to , then responds to , because the equation is linear in . Two tracer sources feeding a room can be solved separately and added.
Transient and steady state
The homogeneous part is what remains of the start. When is a positive constant it equals , and the mechanism is the one from the last lesson: it solves , so its rate of decrease is proportional to its own size, and it loses a fixed fraction every unit of time. It is called the transient. It falls to in the time constant and to 1% in . What is left, , persists as long as the forcing persists, because there is nothing that decays it: it is what the equation does when it is pushed. This is the steady state, even though it may be moving.
The clearest case is a sinusoidal forcing: . Guess the steady state to be and substitute (the forcing has only these frequencies, and linear equations do not create new ones):
So and , giving
(The second form is the standard identity for combining a cosine and a sine of the same frequency.) The steady state oscillates at the forcing frequency with amplitude , and it lags the forcing by the phase , a time delay of .
Take . The amplitude is and the lag is rad, which is , a delay of in time. With a starting value the transient coefficient is , and the full solution is
The sim draws the pieces separately and then their sum.
Things to try, each confirmed by the readout:
- With the defaults (, ) the readout says transient , amplitude , lag rad . Drag the starting value anywhere: the red transient changes, but the dashed steady state does not move. That is the structure theorem, visible.
- Raise to 3 with the oscillating push: the amplitude falls to and the transient dies faster (1% at ). A strongly damped system follows the forcing closely at low but responds less to fast oscillations.
- Raise to 4 with : the amplitude drops to and the lag rises to . A fast push is largely averaged out. The system is a low-pass filter.
- On the ramp, the steady state is : the forcing line delayed by and divided by . It never catches the ramp. For () that steady state is , which is why the curve of the last section settled one unit below the line .
- Tick the RK4 check. At the dots land on the curve. At (time constant ) the step is too coarse, and the readout reports a largest gap of : an accurate solver still needs steps that resolve the fastest decay in the problem.
The table this prints has the transient column and the difference column equal: is to six places ( at , at ), which is the claim that a solver’s output and the steady state differ only by the decaying homogeneous piece. The measured lag is against the predicted ; the peak is found on a grid in and still carries a leftover transient of , which accounts for the small gap.
Variation of parameters
There is a second way to arrive at the same formula, and it is the one that generalizes to higher-order equations. We already know the homogeneous solution . A forced solution cannot be a constant multiple of it. So let the constant vary: try
Substitute into :
The bracket is zero, because solves the homogeneous equation. What is left is , so , and
That is the integrating-factor formula, word for word: . The two methods are the same formula read in two ways. In the integrating-factor reading we multiply through by so that the equation integrates; in the variation reading we take the unforced shape and let its amplitude drift, with the forcing as the thing that makes the constant move. In the second reading the mechanism is explicit: if then and the “constant” really is constant; the forcing is the only thing that changes it.
Worked example (variable ). Solve for . Standard form: . Then , , and , so and . The homogeneous part blows up as : here the coefficient is not continuous at , so the interval of validity stops there, exactly as the standard-form section warned.
What you can now decide
Given any linear first-order IVP you can read off four things before touching a solver: the interval of validity from the continuity of and ; the time constant when is a constant; the steady state, which does not depend on the start; and how long to wait before the start no longer matters ( for 1%). This last point is the working use of the theory: if you simulate for much longer than a few time constants you are looking at the forced response, and if you run shorter you are looking at the start-up transient, which is an artifact of your initial condition.
Exercise: the forced response, by formula and by RK4
Implement the sinusoidally forced response of . You write the amplitude and the lag, the exact solution (steady state plus transient), and an RK4 integrator, and the tests check them against one another.
Solve , . What does approach, and how long until the transient is below 1% of its starting size?
Show worked solution
, , , so and . From , :
It approaches the steady state (the constant solution: ). The transient falls to 1% of its start when , i.e. . As a check, .
The worked example above solved on and found .
(a) Exactly one initial condition gives a solution that extends all the way down to . Which one, and what is that solution?
(b) Integrate backwards from to with RK4, starting from your answer to (a) and then from a value wrong by . Predict the two results before you run it.
Show worked solution
(a) The term is what blows up, so the solution extends to only when . Since , that start is
which passes through the origin with . Every other start leaves and as , with the sign of . Nothing is violated: is discontinuous at , so the existence theorem only ever promised a solution on .
(b) Error in the starting value is an error in , and multiplies it by at . So a start off by should land near , while the exact value is . Running it (RK4, 9900 steps):
| exact | ||
|---|---|---|
A relative error of in the start becomes a factor of at the end. The exceptional solution is perfectly well defined and completely unusable numerically in this direction, because the mode you are trying to hold at zero is the fastest-growing one. Integrate the other way, from small upward, and that same mode decays: you are then solving the stable direction, and all the starts collapse toward .
For with , find (a) the steady-state amplitude and its phase lag, (b) the full solution, and (c) the time after which the transient is below .
Show worked solution
(a) Write as 4 times the unit forcing. With , the steady state for is , so for the factor 4 it is . The amplitude is , and the lag is , i.e. .
(b) , so the transient coefficient is :
Check: at this is , and RK4 with gives .
(c) The transient is in size, and it is below when .
Where this goes next
Linear first-order equations are the one family where a closed form always exists (if you can do the two integrals), and the structure we found, homogeneous plus particular, is what carries over to second order and to systems in 5.1 Second-Order Linear Equations: Structure and the module after it. The qualitative picture of a state settling to an equilibrium, for equations that are not linear, is the subject of 3.8 Autonomous Equations, Equilibria & Stability. And the question we assumed away in the standard-form section, when exactly one solution passes through a point, is the subject of 3.7 Existence & Uniqueness.
Key Takeaways
- Standard form is , reached by dividing by the leading coefficient. Where that coefficient vanishes the theory changes: has infinitely many solutions through and none through .
- The integrating factor is forced by one demand: requires . That equation is separable, so is built with last lesson’s technique.
- Then , and . For with this gives , the curve Euler was chasing in lesson 3.2.
- The general solution is particular plus homogeneous: driven by the forcing, plus that remembers the start. The difference of any two solutions is homogeneous.
- With constant the homogeneous part is a transient with time constant (1% after ); the particular part is the steady state. For the steady state has amplitude and lags by .
- Variation of parameters reaches the same formula: put and the forcing alone makes move, .
- Tracer relaxation is this equation: the equilibrium decides where, decides how fast, and a room low-pass filters the outdoor air. The same is what limits explicit Euler and what an implicit step is designed to survive.