Flow Lab

Syllabus / Module 3: First-Order ODEs

Lesson 3.4

Linear First-Order Equations & Integrating Factors

y' + p(t)y = g(t), the integrating factor, transients vs steady state, and the structure of linear solutions.

Written byClaude Sonnet

🌊
Why this matters for simulation: Relaxation of a tracer toward an equilibrium concentration follows a linear first-order law.

By the end of this lesson you can…

  • Put a first-order linear equation into standard form y' + p(t)y = g(t), and say what goes wrong where the leading coefficient vanishes.
  • Derive the integrating factor μ = e^{∫p dt} from the demand that μy' + μpy equal (μy)', and recognise that the condition on μ is a separable equation.
  • Solve a linear first-order IVP end to end, including y' = t − y with y(0) = 1.
  • Split a general solution into a homogeneous part that remembers the start and a particular part that the forcing drives, and show that two solutions differ by a homogeneous one.
  • Find the steady state, amplitude, phase lag and transient decay time of a sinusoidally forced linear equation, and check them against RK4.
  • Derive the same formula by variation of parameters, and apply it to a tracer relaxing toward an equilibrium concentration.
On this page
·
  1. Standard form, and why the leading coefficient matters
  2. Deriving the integrating factor
  3. The promised payoff: y’ = t − y
  4. The structure of linear solutions
  5. Transient and steady state
  6. Variation of parameters
  7. What you can now decide
  8. Exercise: the forced response, by formula and by RK4
  9. Where this goes next
  10. Key Takeaways

Lesson 3.3 Separable Equations ended with an equation it could not touch: y′=t−yy' = t - y is not separable, because no factorization f(t) g(y)f(t)\,g(y) equals t−yt - y. 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.

▶ Video The integrating factor, the homogeneous and forced parts, and a transient dying into a steady statecaptions only
Transcript
  1. Last lesson left y prime equals t minus y unsolved. Now we solve it, and see what every solution of its family looks like.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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 yy and y′y' appear only to the first power and are never multiplied together. Every such equation can be written

a(t) y′+b(t) y=c(t).a(t)\,y' + b(t)\,y = c(t).

To solve it we divide by a(t)a(t) and work in the standard form

y′+p(t) y=g(t),p=ba,g=ca.y' + p(t)\,y = g(t), \qquad p = \frac{b}{a},\quad g = \frac{c}{a}.

The function gg is the forcing: what is being pushed in from outside. When g=0g = 0 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 a(t)≠0a(t) \neq 0, and where aa vanishes the theory really does change. Take t y′=yt\,y' = y, so a=ta = t, b=−1b = -1. In standard form y′−y/t=0y' - y/t = 0, and p(t)=−1/tp(t) = -1/t is undefined at t=0t = 0. The solutions are y=Cty = Ct (check: t⋅C=Ctt \cdot C = Ct), and every one of them passes through the origin. So the initial condition y(0)=0y(0) = 0 has infinitely many solutions, while y(0)=1y(0) = 1 has none. Away from t=0t = 0, on t>0t \gt 0 say, each initial condition has exactly one solution. The honest statement of the theory is: if pp and gg 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 y′=y2y' = y^2 last lesson. Linear equations cannot blow up in the middle of an interval where pp and gg are continuous.

Deriving the integrating factor

We want a trick that makes the left side of y′+p y=gy' + p\,y = g into a derivative that we can integrate. Multiply the whole equation by an unknown function μ(t)\mu(t):

μ y′+μp y=μg.\mu\,y' + \mu p\,y = \mu g .

The product rule says (μy)′=μy′+μ′y(\mu y)' = \mu y' + \mu' y. The left side above has the right first term, μy′\mu y'. It becomes exactly (μy)′(\mu y)' if and only if the second terms agree, μp y=μ′y\mu p\,y = \mu' y. So demand that

μ′=p μ.\mu' = p\,\mu .

Now look at what kind of equation this is. It is μ′=p(t)⋅μ\mu' = p(t)\cdot\mu: a function of tt times a function of μ\mu. It is separable, and the previous lesson solves it in one line. The root of g(μ)=μg(\mu) = \mu is μ≡0\mu \equiv 0, which is useless here, so divide:

μ′μ=p⟹ln⁡∣μ∣=∫p dt⟹μ(t)=e∫p dt.\frac{\mu'}{\mu} = p \quad\Longrightarrow\quad \ln|\mu| = \int p\,dt \quad\Longrightarrow\quad \mu(t) = e^{\int p\,dt} .

We need only one μ\mu, so we take any antiderivative P(t)=∫p dtP(t) = \int p\,dt 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 μ=eP\mu = e^{P} the equation reads

(μ y)′=μ g,\big(\mu\,y\big)' = \mu\,g ,

and now only integration is left:

μ(t) y(t)=∫μ g dt+C⟹y(t)=1μ(t)(∫μ(t) g(t) dt+C).\mu(t)\,y(t) = \int \mu\,g\,dt + C \quad\Longrightarrow\quad y(t) = \frac{1}{\mu(t)}\left(\int \mu(t)\,g(t)\,dt + C\right).

Check it on the simplest case, p=ap = a constant and g=0g = 0. Then μ=eat\mu = e^{at}, (eaty)′=0(e^{at}y)' = 0, so y=Ce−aty = Ce^{-at}. That is exponential decay, as it should be: y′=−ayy' = -ay.

The promised payoff: y’ = t − y

Write y′=t−yy' = t - y as y′+y=ty' + y = t. So p=1p = 1, g=tg = t, and μ=et\mu = e^{t}. The equation becomes

(ety)′=t et.\big(e^{t}y\big)' = t\,e^{t}.

Integrate the right side by parts, ∫tet dt=(t−1)et\int t e^{t}\,dt = (t - 1)e^{t} plus a constant:

ety=(t−1)et+C⟹y=t−1+Ce−t.e^{t}y = (t - 1)e^{t} + C \quad\Longrightarrow\quad y = t - 1 + Ce^{-t} .

Use y(0)=1y(0) = 1: 1=−1+C1 = -1 + C, so C=2C = 2, and

y=t−1+2e−t.y = t - 1 + 2e^{-t}.

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: y′=1−2e−ty' = 1 - 2e^{-t}, and t−y=t−(t−1+2e−t)=1−2e−tt - y = t - (t - 1 + 2e^{-t}) = 1 - 2e^{-t}. The exact value is y(1)=2/e=0.7358y(1) = 2/e = 0.7358, and RK4 with h=0.1h = 0.1 reaches 0.735760.73576, an error of 6.7×10−76.7\times 10^{-7}. The curve dips to its minimum where it meets the line y=ty = t, at t=ln⁡2=0.693t = \ln 2 = 0.693 with y=0.693y = 0.693, and then climbs. The line y=t−1y = t - 1 it settles onto is a solution with C=0C = 0. Notice what that means: the lesson-3.2 description “the 2e−t2e^{-t} 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 y=t−1+Ce−ty = t - 1 + Ce^{-t} has two parts, and that is not an accident of this example. In general

y=yp(t)⏟driven by g  +  C e−P(t)⏟remembers the start.y = \underbrace{y_p(t)}_{\text{driven by } g} \;+\; \underbrace{C\,e^{-P(t)}}_{\text{remembers the start}} .

The second part is the solution of the homogeneous equation y′+p y=0y' + p\,y = 0, which we found above to be Ce−PCe^{-P}: a one-parameter family, one curve for each CC, all multiples of a single shape. The first part, ypy_p, is any one solution of the full equation (a particular solution). Here yp=t−1y_p = t - 1.

Why must every solution have this shape? Suppose y1y_1 and y2y_2 both solve y′+p y=gy' + p\,y = g. Subtract the equations: z=y1−y2z = y_1 - y_2 satisfies z′+p z=g−g=0z' + p\,z = g - g = 0. So the difference of any two solutions is a homogeneous solution, which is Ce−PCe^{-P} for some CC. Take a concrete pair for y′=t−yy' = t - y: y1=t−1+2e−ty_1 = t - 1 + 2e^{-t} and y2=t−1y_2 = t - 1. Their difference 2e−t2e^{-t} does satisfy z′+z=0z' + z = 0.

You can state the structure without any vector-space language. There is one steady response to the forcing, ypy_p, that does not depend on how you started. And there is a leftover freedom, a single number CC, that records where you started. The initial condition fixes only that number: with P(0)=0P(0) = 0, it is C=y(0)−yp(0)C = y(0) - y_p(0). 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 yp1y_{p1} responds to the forcing g1g_1 and yp2y_{p2} to g2g_2, then yp1+yp2y_{p1} + y_{p2} responds to g1+g2g_1 + g_2, because the equation is linear in yy. Two tracer sources feeding a room can be solved separately and added.

✅ Concept check

$y_1$ and $y_2$ are two different solutions of $y' + 3y = \sin t$. Which statement is guaranteed?

Transient and steady state

The homogeneous part Ce−P(t)Ce^{-P(t)} is what remains of the start. When p=ap = a is a positive constant it equals Ce−atCe^{-at}, and the mechanism is the one from the last lesson: it solves z′=−azz' = -az, 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 1/e1/e in the time constant 1/a1/a and to 1% in ln⁡(100)/a\ln(100)/a. What is left, ypy_p, 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: y′+a y=cos⁡ωty' + a\,y = \cos \omega t. Guess the steady state to be yp=Acos⁡ωt+Bsin⁡ωty_p = A\cos\omega t + B\sin\omega t and substitute (the forcing has only these frequencies, and linear equations do not create new ones):

yp′+ayp=(aA+ωB)cos⁡ωt+(aB−ωA)sin⁡ωt=cos⁡ωt.y_p' + a y_p = (aA + \omega B)\cos\omega t + (aB - \omega A)\sin\omega t = \cos \omega t .

So aA+ωB=1aA + \omega B = 1 and aB−ωA=0aB - \omega A = 0, giving

yp=acos⁡ωt+ωsin⁡ωta2+ω2=1a2+ω2cos⁡(ωt−φ),tan⁡φ=ωa.y_p = \frac{a\cos\omega t + \omega\sin\omega t}{a^2 + \omega^2} = \frac{1}{\sqrt{a^2+\omega^2}}\cos(\omega t - \varphi), \qquad \tan\varphi = \frac{\omega}{a}.

(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 1/a2+ω21/\sqrt{a^2 + \omega^2}, and it lags the forcing by the phase φ=arctan⁡(ω/a)\varphi = \arctan(\omega/a), a time delay of φ/ω\varphi/\omega.

Take a=ω=1a = \omega = 1. The amplitude is 1/2=0.70711/\sqrt{2} = 0.7071 and the lag is φ=π/4=0.7854\varphi = \pi/4 = 0.7854 rad, which is 45∘45^\circ, a delay of 0.7850.785 in time. With a starting value y(0)=2y(0) = 2 the transient coefficient is y(0)−yp(0)=2−1/2=3/2y(0) - y_p(0) = 2 - 1/2 = 3/2, and the full solution is

y=12(cos⁡t+sin⁡t)+32e−t.y = \tfrac12(\cos t + \sin t) + \tfrac32 e^{-t}.

The sim draws the pieces separately and then their sum.

◆ Interactive Solution, steady state and transient of y' + a y = g(t)

Loading simulation…

Things to try, each confirmed by the readout:

  • With the defaults (a=ω=1a = \omega = 1, y(0)=2y(0) = 2) the readout says transient 1.500 e−1.00t1.500\,e^{-1.00t}, amplitude 0.70710.7071, lag 0.78540.7854 rad =45.0∘= 45.0^\circ. Drag the starting value anywhere: the red transient changes, but the dashed steady state does not move. That is the structure theorem, visible.
  • Raise aa to 3 with the oscillating push: the amplitude falls to 1/10=0.3161/\sqrt{10} = 0.316 and the transient dies faster (1% at t=ln⁡(100)/3=1.54t = \ln(100)/3 = 1.54). A strongly damped system follows the forcing closely at low ω\omega but responds less to fast oscillations.
  • Raise ω\omega to 4 with a=1a = 1: the amplitude drops to 0.2430.243 and the lag rises to 76.0∘76.0^\circ. A fast push is largely averaged out. The system is a low-pass filter.
  • On the ramp, the steady state is t/a−1/a2t/a - 1/a^2: the forcing line delayed by 1/a1/a and divided by aa. It never catches the ramp. For y′=t−yy' = t - y (a=1a = 1) that steady state is t−1t - 1, which is why the curve of the last section settled one unit below the line y=ty = t.
  • Tick the RK4 check. At a=1a = 1 the dots land on the curve. At a=3a = 3 (time constant 1/31/3) the step h=0.5h = 0.5 is too coarse, and the readout reports a largest gap of 8.3×10−28.3\times 10^{-2}: an accurate solver still needs steps that resolve the fastest decay in the problem.
✅ Concept check

For $y' + 4y = 12$ with any starting value, what does $y$ approach as $t \to \infty$?

🐍 PythonPlayground: the transient dies, the steady state stays (y' + y = cos t, y(0) = 2)
⌘/Ctrl + Enter

The table this prints has the transient column and the difference column equal: y−ypy - y_p is 1.5e−t1.5e^{-t} to six places (0.0274730.027473 at t=4t = 4, 0.0005030.000503 at t=8t = 8), which is the claim that a solver’s output and the steady state differ only by the decaying homogeneous piece. The measured lag is 0.7840.784 against the predicted π/4=0.785\pi/4 = 0.785; the peak is found on a grid in tt and still carries a leftover transient of 1.5e−7≈10−31.5e^{-7} \approx 10^{-3}, 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 yh=e−Py_h = e^{-P}. A forced solution cannot be a constant multiple of it. So let the constant vary: try

y=u(t) yh(t).y = u(t)\,y_h(t).

Substitute into y′+p y=gy' + p\,y = g:

u′yh+u(yh′+p yh)=g.u'y_h + u\big(y_h' + p\,y_h\big) = g .

The bracket is zero, because yhy_h solves the homogeneous equation. What is left is u′ yh=gu'\,y_h = g, so u′=g/yh=g eP=μgu' = g/y_h = g\,e^{P} = \mu g, and

y=e−P(∫μg dt+C).y = e^{-P}\left(\int \mu g\,dt + C\right).

That is the integrating-factor formula, word for word: 1/μ=e−P=yh1/\mu = e^{-P} = y_h. The two methods are the same formula read in two ways. In the integrating-factor reading we multiply through by μ\mu so that the equation integrates; in the variation reading we take the unforced shape yhy_h 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 g=0g = 0 then u′=0u' = 0 and the “constant” really is constant; the forcing is the only thing that changes it.

Worked example (variable pp). Solve t y′+2y=t2t\,y' + 2y = t^2 for t>0t \gt 0. Standard form: y′+(2/t) y=ty' + (2/t)\,y = t. Then P=2ln⁡tP = 2\ln t, μ=t2\mu = t^2, and (t2y)′=t3(t^2 y)' = t^3, so t2y=t4/4+Ct^2 y = t^4/4 + C and y=t2/4+C/t2y = t^2/4 + C/t^2. The homogeneous part C/t2C/t^2 blows up as t→0+t \to 0^+: here the coefficient p=2/tp = 2/t is not continuous at 00, so the interval of validity stops there, exactly as the standard-form section warned.

✅ Concept check

What is an integrating factor for $y' + \dfrac{2}{t}\,y = \sin t$ on $t \gt 0$?

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 pp and gg; the time constant 1/p1/p when pp is a constant; the steady state, which does not depend on the start; and how long to wait before the start no longer matters (ln⁡(100)/a\ln(100)/a 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 y′+ay=cos⁡ωty' + a y = \cos \omega t. 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.

🧪 Coding exerciseExercise: amplitude, lag, exact solution and RK4
⌘/Ctrl + Enter
✏️ Pen & paperSolve and read off the steady state●○○

Solve y′+3y=6y' + 3y = 6, y(0)=0y(0) = 0. What does yy approach, and how long until the transient is below 1% of its starting size?

Show worked solution

p=3p = 3, μ=e3t\mu = e^{3t}, (e3ty)′=6e3t(e^{3t}y)' = 6e^{3t}, so e3ty=2e3t+Ce^{3t}y = 2e^{3t} + C and y=2+Ce−3ty = 2 + Ce^{-3t}. From y(0)=0y(0) = 0, C=−2C = -2:

y=2(1−e−3t).y = 2\left(1 - e^{-3t}\right).

It approaches the steady state 22 (the constant solution: 3y=63y = 6). The transient −2e−3t-2e^{-3t} falls to 1% of its start when e−3t=0.01e^{-3t} = 0.01, i.e. t=ln⁡(100)/3=1.535t = \ln(100)/3 = 1.535. As a check, y(1)=2(1−e−3)=1.9004y(1) = 2(1 - e^{-3}) = 1.9004.

✏️ Pen & paperThe one start that survives t = 0●●○

The worked example above solved t y′+2y=t2t\,y' + 2y = t^2 on t>0t \gt 0 and found y=t2/4+C/t2y = t^2/4 + C/t^2.

(a) Exactly one initial condition y(1)y(1) gives a solution that extends all the way down to t=0t = 0. Which one, and what is that solution?

(b) Integrate backwards from t=1t = 1 to t=0.01t = 0.01 with RK4, starting from your answer to (a) and then from a value wrong by 0.00010.0001. Predict the two results before you run it.

Show worked solution

(a) The term C/t2C/t^2 is what blows up, so the solution extends to t=0t = 0 only when C=0C = 0. Since y(1)=1/4+Cy(1) = 1/4 + C, that start is

y(1)=14,y=t24,y(1) = \tfrac14, \qquad y = \frac{t^2}{4},

which passes through the origin with y(0)=0y(0) = 0. Every other start leaves C≠0C \neq 0 and y→±∞y \to \pm\infty as t→0+t \to 0^+, with the sign of CC. Nothing is violated: p=2/tp = 2/t is discontinuous at t=0t = 0, so the existence theorem only ever promised a solution on t>0t \gt 0.

(b) Error in the starting value is an error in CC, and C/t2C/t^2 multiplies it by 1/t2=1041/t^2 = 10^4 at t=0.01t = 0.01. So a start off by 10−410^{-4} should land near 10−4×104=110^{-4} \times 10^4 = 1, while the exact value is t2/4=2.5×10−5t^2/4 = 2.5 \times 10^{-5}. Running it (RK4, 9900 steps):

y(1)y(1)y(0.01)y(0.01)exact t2/4t^2/4
0.250.252.49999×10−52.49999 \times 10^{-5}2.5×10−52.5 \times 10^{-5}
0.25010.25011.000021.000022.5×10−52.5 \times 10^{-5}

A relative error of 0.04%0.04\% in the start becomes a factor of 4000040000 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 tt upward, and that same mode decays: you are then solving the stable direction, and all the starts collapse toward t2/4t^2/4.

✏️ Pen & paperAmplitude, lag and settling time●●●

For y′+2y=4cos⁡2ty' + 2y = 4\cos 2t with y(0)=0y(0) = 0, find (a) the steady-state amplitude and its phase lag, (b) the full solution, and (c) the time after which the transient is below 0.010.01.

Show worked solution

(a) Write 4cos⁡2t4\cos 2t as 4 times the unit forcing. With a=2a = 2, ω=2\omega = 2 the steady state for cos⁡2t\cos 2t is (2cos⁡2t+2sin⁡2t)/8(2\cos 2t + 2\sin 2t)/8, so for the factor 4 it is yp=cos⁡2t+sin⁡2ty_p = \cos 2t + \sin 2t. The amplitude is 4/a2+ω2=4/8=2=1.4144/\sqrt{a^2 + \omega^2} = 4/\sqrt 8 = \sqrt 2 = 1.414, and the lag is arctan⁡(ω/a)=arctan⁡1=π/4\arctan(\omega/a) = \arctan 1 = \pi/4, i.e. 45∘45^\circ.

(b) yp(0)=1y_p(0) = 1, so the transient coefficient is 0−1=−10 - 1 = -1:

y=cos⁡2t+sin⁡2t−e−2t.y = \cos 2t + \sin 2t - e^{-2t}.

Check: at t=5t = 5 this is −1.3831-1.3831, and RK4 with h=0.001h = 0.001 gives −1.3831-1.3831.

(c) The transient is e−2te^{-2t} in size, and it is below 0.010.01 when t>ln⁡(100)/2=2.303t \gt \ln(100)/2 = 2.303.

✅ Concept check

Two copies of $y' + y = \cos t$ start from $y(0) = 0$ and $y(0) = 5$. After $t = 10$ the two solutions differ by approximately:

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 y′+p(t)y=g(t)y' + p(t)y = g(t), reached by dividing by the leading coefficient. Where that coefficient vanishes the theory changes: t y′=yt\,y' = y has infinitely many solutions through (0,0)(0, 0) and none through (0,1)(0, 1).
  • The integrating factor is forced by one demand: μy′+μp y=(μy)′\mu y' + \mu p\,y = (\mu y)' requires μ′=pμ\mu' = p\mu. That equation is separable, so μ=e∫p dt\mu = e^{\int p\,dt} is built with last lesson’s technique.
  • Then (μy)′=μg(\mu y)' = \mu g, and y=1μ(∫μg dt+C)y = \frac{1}{\mu}\left(\int \mu g\,dt + C\right). For y′=t−yy' = t - y with y(0)=1y(0) = 1 this gives y=t−1+2e−ty = t - 1 + 2e^{-t}, the curve Euler was chasing in lesson 3.2.
  • The general solution is particular plus homogeneous: ypy_p driven by the forcing, plus Ce−PCe^{-P} that remembers the start. The difference of any two solutions is homogeneous.
  • With constant p=a>0p = a \gt 0 the homogeneous part is a transient with time constant 1/a1/a (1% after ln⁡(100)/a\ln(100)/a); the particular part is the steady state. For y′+y=cos⁡ty' + y = \cos t the steady state has amplitude 0.70710.7071 and lags by π/4=45∘\pi/4 = 45^\circ.
  • Variation of parameters reaches the same formula: put y=u yhy = u\,y_h and the forcing alone makes uu move, u′=μgu' = \mu g.
  • Tracer relaxation c′=λ(ceq−c)c' = \lambda(c_{eq} - c) is this equation: the equilibrium decides where, λ=Q/V\lambda = Q/V decides how fast, and a room low-pass filters the outdoor air. The same λ\lambda is what limits explicit Euler and what an implicit step is designed to survive.
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.

Where this leads

These later lessons build directly on this one: