Flow Lab

Syllabus / Module 5: Second-Order Linear ODEs & Oscillations

Lesson 5.2

Constant Coefficients & the Characteristic Equation

ay'' + by' + cy = 0: real distinct, repeated and complex roots; Euler's formula turns complex exponentials into sines and cosines.

Written byClaude Sonnet

🌊
Why this matters for simulation: Gravity waves on water and acoustic modes in a pipe solve constant-coefficient oscillator equations.

By the end of this lesson you can…

  • Substitute $y = e^{rt}$ into $ay'' + by' + cy = 0$ to derive the characteristic equation $ar^2 + br + c = 0$, and explain why the exponential turns calculus into algebra.
  • Write the general solution for distinct real roots, a repeated root (deriving $te^{rt}$ by reduction of order) and a complex pair (deriving the cosine and sine form from Euler's formula), and fit $y(0)$, $y'(0)$ with the Wronskian.
  • Rewrite oscillatory solutions as $Re^{\alpha t}\cos(\beta t - \varphi)$ and read growth rate and frequency off the roots in the complex plane.
  • Show that the roots are the eigenvalues of the companion matrix, with trace $-b/a$ and determinant $c/a$.
  • Explain how the roots limit the RK4 step size, and why none of this applies to variable coefficients.
On this page
·
  1. Trying the exponential
  2. Case 1: two distinct real roots
  3. Case 2: a repeated root
  4. Case 3: complex roots and Euler’s formula
  5. Roots in the complex plane
  6. The roots are eigenvalues
  7. Roots and the step size
  8. Where this stops
  9. Lab
  10. Exercise: closed-form solver, verified against RK45
  11. Key Takeaways

A spring-mass-damper, the pitch oscillation of a simulated aircraft and one Fourier mode of a water wave all reduce to the same small equation, ay′′+by′+cy=0a y'' + b y' + c y = 0 with three constant numbers. 5.1 Second-Order Linear Equations: Structure showed that its solutions form a 2-dimensional space, so two independent solutions and a Wronskian settle everything, but it found them only by the one-off trick of reduction of order. With constant coefficients there is a complete recipe. You turn the differential equation into a quadratic, and the two roots, placed in the complex plane, tell you what the solution does before you draw it.

▶ Video Trying e^{rt}, the characteristic equation, the three root cases, Euler's formula, roots in the complex plane, and the companion matrixcaptions only
Transcript
  1. Try y equals e to the r t. Each derivative just multiplies by r, so the equation collapses to a r squared plus b r plus c, times e to the r t. That is never zero, so r solves the characteristic equation. Check at t equals one, r minus a half: residual zero.
  2. The discriminant sorts every equation. Plot P over a: the first example crosses zero twice, delta twenty-five. The second just touches, delta zero. The third floats above zero, delta minus sixteen: complex roots. The roots sum to minus b over a and multiply to c over a.
  3. Two real roots, two exponentials. The Wronskian at zero is the root gap, minus two and a half, so Cramer's rule gives c one two, c two minus one. At t equals two the slow part is 0.735759 and the fast part minus 0.002479: late on, only the root nearest zero matters.
  4. A repeated root gives one exponential. Differentiate the identity in r: the extra term is P prime. At a double root both vanish, so t e to the r t solves it too. Here the slope is always negative, and y of two is 0.199148.
  5. Complex roots need e to the r t with complex r. Euler's formula makes it a spiral: the radius shrinks, the angle turns. The coefficients are real, so the real and imaginary parts are separately solutions, with Wronskian two e to the minus two t: a basis.
  6. Last lesson's example: roots minus one plus or minus two i, value two, slope one. So c one is two, c two is one and a half, R is two and a half, and the phase is 0.6435011. y of two is minus 0.330555, inside the envelope R e to the minus t.
  7. Zeros are half a period apart, pi over beta: 1.570796. Shift by a full period and the envelope shrinks by the same factor, so each peak is e to the minus pi times the one before: 0.043214.
  8. A root is a mode. Its real part alpha is the growth rate, its imaginary part beta the frequency. Start at the example's roots and drag them left: the ringing dies faster. Cross the imaginary axis and decay becomes growth. Drag up: same envelope, faster oscillation.
  9. The companion matrix has trace minus b over a and determinant c over a, and its eigenvalues are exactly the roots. An eigenvector is the pair one, r: the pure solution e to the r t slides along that line. A double root has only one line; the t pays for the missing one. Everything decays when the trace is negative and the determinant positive.
  10. The roots set the step size: RK4 multiplies each mode by R of h lambda per step. For roots minus one and minus one thousand, h of 0.0025 gives factor 0.6484 and the exact answer 0.60714. h of 0.004 gives factor 5, and an answer of minus 2.3533 times ten to the 84. Stability needs h below 2.7853 over a thousand.
  11. For roots minus one plus or minus ten i, failure is gentler. The exact amplitude shrinks by e to the minus h each step. At 0.05 RK4 agrees; at 0.2 it is stable but damps by about 0.59 instead of about 0.82: the ringing dies far too fast.
  12. Where it stops: try e to the r t in t squared y double prime minus two t y prime plus two y. The residual is r squared t squared minus two r t plus two. Vanishing everywhere forces r to be zero, leaving the constant two. The solutions are powers: this trick needs constant coefficients.
  13. So: try e to the r t, solve the characteristic equation, read the three cases off the roots. The real part is the growth rate, the imaginary part the frequency. The roots are eigenvalues of the companion matrix and limit the step size. Variable coefficients break it. Next: mechanical vibrations.

Trying the exponential

Take constants a≠0a \neq 0, bb, cc. This is y′′+py′+qy=0y'' + py' + qy = 0 with p=b/ap = b/a, q=c/aq = c/a, so the previous lesson applies. In 3.3 Separable Equations you solved y′=ryy' = ry and got erte^{rt}, the function whose derivative is a constant multiple of itself. A constant-coefficient equation uses yy, y′y', y′′y'' only with constant multipliers, so try y=erty = e^{rt}. Then y′=rerty' = re^{rt}, y′′=r2erty'' = r^2e^{rt} and

ay′′+by′+cy=(ar2+br+c) ert.a y'' + b y' + c y = \bigl(a r^2 + b r + c\bigr)\,e^{rt} .

Since ert≠0e^{rt} \neq 0, it is a solution if and only if

 ar2+br+c=0 \boxed{\,a r^2 + b r + c = 0\,}

the characteristic equation, with characteristic polynomial P(r)=ar2+br+cP(r) = ar^2 + br + c. The mechanism: ddtert=rert\frac{d}{dt}e^{rt} = re^{rt} says erte^{rt} is an eigenfunction of d/dtd/dt with eigenvalue rr, in the sense of 1.5 Eigenvectors & Eigenvalues. The operator a(d/dt)2+b(d/dt)+ca(d/dt)^2 + b(d/dt) + c is a polynomial in d/dtd/dt, so it rescales that same function by P(r)P(r). Solving the equation means finding the rr where the scale factor is zero.

The quadratic formula gives r=(−b±b2−4ac)/(2a)r = \bigl(-b \pm \sqrt{b^2 - 4ac}\bigr)/(2a), and the discriminant Δ=b2−4ac\Delta = b^2 - 4ac sorts every equation into three cases.

Δ\Deltarootstwo independent solutions
>0\gt 0distinct real r1,r2r_1, r_2er1t, er2te^{r_1 t},\ e^{r_2 t}
=0= 0repeated real rrert, terte^{rt},\ te^{rt}
<0\lt 0complex pair α±iβ\alpha \pm i\betaeαtcos⁡βt, eαtsin⁡βte^{\alpha t}\cos\beta t,\ e^{\alpha t}\sin\beta t

Expanding P(r)=a(r−r1)(r−r2)P(r) = a(r - r_1)(r - r_2) gives ar2−a(r1+r2)r+ar1r2ar^2 - a(r_1 + r_2)r + ar_1r_2, so

r1+r2=−ba,r1r2=ca.(Vieta)r_1 + r_2 = -\frac{b}{a}, \qquad r_1 r_2 = \frac{c}{a}. \tag{Vieta}

Case 1: two distinct real roots

If Δ>0\Delta \gt 0 the Wronskian of er1te^{r_1t}, er2te^{r_2t} is (r2−r1) e(r1+r2)t(r_2 - r_1)\,e^{(r_1 + r_2)t}, never zero, so y=c1er1t+c2er2ty = c_1e^{r_1t} + c_2e^{r_2t} is the general solution. (Abel’s theorem predicts W′=−(b/a)WW' = -(b/a)W, and r1+r2=−b/ar_1 + r_2 = -b/a by Vieta: they agree.)

Worked example. 2y′′+7y′+3y=02y'' + 7y' + 3y = 0, y(0)=1y(0) = 1, y′(0)=2y'(0) = 2. Here Δ=49−24=25\Delta = 49 - 24 = 25 and r=(−7±5)/4r = (-7 \pm 5)/4, so r1=−12r_1 = -\tfrac12, r2=−3r_2 = -3. At t=0t = 0 the (value, slope) pairs of e−t/2e^{-t/2}, e−3te^{-3t} are (1,−12)(1, -\tfrac12) and (1,−3)(1, -3), so W(0)=−3+12=−2.5=r2−r1W(0) = -3 + \tfrac12 = -2.5 = r_2 - r_1. Cramer’s rule from the previous lesson gives

c1=1⋅(−3)−2⋅1−2.5=2,c2=1⋅2+12⋅1−2.5=−1,y=2e−t/2−e−3t.c_1 = \frac{1\cdot(-3) - 2\cdot 1}{-2.5} = 2, \qquad c_2 = \frac{1\cdot 2 + \tfrac12\cdot 1}{-2.5} = -1, \qquad y = 2e^{-t/2} - e^{-3t}.

At t=2t = 2 the slow term is 2e−1=0.7357592e^{-1} = 0.735759, the fast term is e−6=0.002479e^{-6} = 0.002479 and y(2)=0.733280y(2) = 0.733280 (block C prints these). Late in the solution only the root nearest zero matters. A real-root solution also crosses zero at most once: c1er1t+c2er2t=0c_1e^{r_1t} + c_2e^{r_2t} = 0 means e(r1−r2)t=−c2/c1e^{(r_1 - r_2)t} = -c_2/c_1, and the left side is strictly monotone in tt.

Case 2: a repeated root

If Δ=0\Delta = 0 there is one root r=−b/(2a)r = -b/(2a) and one solution erte^{rt}. Use reduction of order from the previous lesson: put y2=verty_2 = ve^{rt}, so vv obeys y1v′′+(2y1′+py1)v′=0y_1v'' + (2y_1' + py_1)v' = 0. At the double root b/a=−2rb/a = -2r, hence 2y1′+py1=2rert−2rert=02y_1' + py_1 = 2re^{rt} - 2re^{rt} = 0. The v′v' term cancels, leaving ertv′′=0e^{rt}v'' = 0, so v=c1+c2tv = c_1 + c_2t and

y=(c1+c2t) ert,y(0)=y0, y′(0)=v0 ⇒ y=(y0+(v0−ry0)t)ert.y = (c_1 + c_2t)\,e^{rt}, \qquad y(0) = y_0,\ y'(0) = v_0 \ \Rightarrow\ y = \bigl(y_0 + (v_0 - ry_0)t\bigr)e^{rt}.

Why does the cancellation happen exactly at a double root? Differentiate L[ert]=P(r)ertL[e^{rt}] = P(r)e^{rt} with respect to rr. The operator does not involve rr and ∂rert=tert\partial_re^{rt} = te^{rt}, so

L[tert]=(tP(r)+P′(r))ert.L[te^{rt}] = \bigl(tP(r) + P'(r)\bigr)e^{rt}.

At a double root P(r)=0P(r) = 0 and P′(r)=2ar+b=0P'(r) = 2ar + b = 0, so tertte^{rt} is a solution; at a simple root it is not. Block G confirms both identities symbolically. The Wronskian of erte^{rt} and tertte^{rt} is e2rte^{2rt}.

Worked example. 4y′′+12y′+9y=04y'' + 12y' + 9y = 0, y(0)=1y(0) = 1, y′(0)=0y'(0) = 0. Here Δ=144−144=0\Delta = 144 - 144 = 0 and r=−32r = -\tfrac32, so y=(1+32t)e−3t/2y = (1 + \tfrac32 t)e^{-3t/2} by the formula (the slope condition is c2−32c1=0c_2 - \tfrac32 c_1 = 0). Block A gives y(2)=4e−3=0.199148y(2) = 4e^{-3} = 0.199148. The slope is −2.25 te−1.5t<0-2.25\,te^{-1.5t} \lt 0, so the solution falls monotonically. Like Case 1 it crosses zero at most once, because c1+c2tc_1 + c_2t has at most one zero.

Case 3: complex roots and Euler’s formula

If Δ<0\Delta \lt 0 the roots are α±iβ\alpha \pm i\beta with α=−b/(2a)\alpha = -b/(2a) and β=4ac−b2/(2a)\beta = \sqrt{4ac - b^2}/(2a) (taking a>0a \gt 0). The ansatz needs erte^{rt} for complex rr. By Euler’s formula from 1.7 Complex Eigenvalues & Rotation, e(α+iβ)t=eαt(cos⁡βt+isin⁡βt)e^{(\alpha + i\beta)t} = e^{\alpha t}(\cos\beta t + i\sin\beta t). The calculation only needs ddtert=rert\frac{d}{dt}e^{rt} = re^{rt}, and it holds: differentiating the right side gives eαt[(αcos⁡βt−βsin⁡βt)+i(αsin⁡βt+βcos⁡βt)]e^{\alpha t}[(\alpha\cos\beta t - \beta\sin\beta t) + i(\alpha\sin\beta t + \beta\cos\beta t)], which is (α+iβ)(\alpha + i\beta) times the original. So L[ert]=P(r)ert=0L[e^{rt}] = P(r)e^{rt} = 0 and z=u+ivz = u + iv, with u=eαtcos⁡βtu = e^{\alpha t}\cos\beta t and v=eαtsin⁡βtv = e^{\alpha t}\sin\beta t, is a complex solution.

You want real ones. Because a,b,ca, b, c are real, L[u]L[u] and L[v]L[v] are real, and 0=L[z]=L[u]+iL[v]0 = L[z] = L[u] + iL[v] forces both to vanish: the real and imaginary parts are separately solutions. Their Wronskian is uv′−u′v=βe2αt≠0uv' - u'v = \beta e^{2\alpha t} \neq 0 (the cross terms combine into cos⁡2+sin⁡2\cos^2 + \sin^2), so

y=eαt(c1cos⁡βt+c2sin⁡βt),c1=y0,c2=v0−αy0β,y = e^{\alpha t}\bigl(c_1\cos\beta t + c_2\sin\beta t\bigr), \qquad c_1 = y_0, \quad c_2 = \frac{v_0 - \alpha y_0}{\beta},

where the constants come from y(0)=c1y(0) = c_1 and y′(0)=αc1+βc2y'(0) = \alpha c_1 + \beta c_2. The conjugate root gives the same pair, with the sine’s sign flipped.

Worked example, owed from last lesson. y′′+2y′+5y=0y'' + 2y' + 5y = 0: Δ=4−20=−16\Delta = 4 - 20 = -16, r=−1±2ir = -1 \pm 2i, so the basis is e−tcos⁡2te^{-t}\cos 2t, e−tsin⁡2te^{-t}\sin 2t, the pair the previous lesson asked you to check by substitution, with Wronskian βe2αt=2e−2t\beta e^{2\alpha t} = 2e^{-2t} as it quoted (block G prints the Wronskian and a residual of 00 for each function). With y(0)=2y(0) = 2, y′(0)=1y'(0) = 1: c1=2c_1 = 2, c2=(1+2)/2=1.5c_2 = (1 + 2)/2 = 1.5, so

y=e−t(2cos⁡2t+1.5sin⁡2t),y(2)=−0.330555.y = e^{-t}\bigl(2\cos 2t + 1.5\sin 2t\bigr), \qquad y(2) = -0.330555.

Amplitude-phase form. Since cos⁡(βt−φ)=cos⁡βtcos⁡φ+sin⁡βtsin⁡φ\cos(\beta t - \varphi) = \cos\beta t\cos\varphi + \sin\beta t\sin\varphi, choose Rcos⁡φ=c1R\cos\varphi = c_1, Rsin⁡φ=c2R\sin\varphi = c_2:

y=R eαtcos⁡(βt−φ),R=c12+c22,φ=atan2⁡(c2,c1).y = R\,e^{\alpha t}\cos(\beta t - \varphi), \qquad R = \sqrt{c_1^2 + c_2^2}, \quad \varphi = \operatorname{atan2}(c_2, c_1).

Use two-argument arctangent: arctan⁡(c2/c1)\arctan(c_2/c_1) loses the quadrant and shifts the wave by half a period. Here R=2.5R = 2.5, φ=0.6435011\varphi = 0.6435011, and block C confirms the match to 10−1210^{-12}. Zeros are spaced π/β=1.570796\pi/\beta = 1.570796 apart, the first at 2t−φ=π/22t - \varphi = \pi/2, i.e. t=1.107149t = 1.107149. Shifting time by one period T=2π/βT = 2\pi/\beta leaves the cosine unchanged and scales the envelope by eαTe^{\alpha T}, so y(t+T)=eαTy(t)y(t + T) = e^{\alpha T}y(t) for all tt: successive maxima shrink by the fixed factor eαTe^{\alpha T}. Here e−π=0.043214e^{-\pi} = 0.043214, which block C also finds numerically from the maxima.

Roots in the complex plane

Every mode is erte^{rt} with r=α+iβr = \alpha + i\beta (β=0\beta = 0 for real roots), and ∣ert∣=eαt|e^{rt}| = e^{\alpha t} with oscillation at angular frequency β\beta. So the location of a root is the behavior of its mode:

  • Real part α\alpha is the growth rate, with e-fold time 1/∣α∣1/|\alpha|: left half-plane decays, right half-plane grows, the imaginary axis keeps the amplitude.
  • Imaginary part β\beta is the frequency, period 2π/β2\pi/\beta. A root on the real axis does not oscillate; a root at zero is a constant mode.
◆ Interactive Drag the characteristic roots in the complex plane and watch y(t), the (y, y') plane, and a, b, c respond

Loading simulation…

The underdamped preset has roots −1±2i-1 \pm 2i; its readout reports b=2b = 2, c=5c = 5, discriminant −16-16, and the R=2.5R = 2.5, φ=0.6435\varphi = 0.6435 above. Drag the pair left and the ringing dies faster; right across the imaginary axis and it grows; up and it speeds up with the same envelope. Push it onto the real axis and it lands as a repeated root; pull the two copies apart for two real roots. The saddle preset has roots −2-2 and 11 with data (1,−2)(1, -2), chosen so the growing mode’s coefficient is exactly zero: the solution decays despite a root in the right half-plane, and any change to y′(0)y'(0) brings the growth back. The words underdamped, critical and overdamped get their spring-and-damper meaning in the next lesson, on mechanical vibrations.

When do all solutions decay? For a>0a \gt 0, exactly when b>0b \gt 0 and c>0c \gt 0. By Vieta, two real roots are both negative exactly when the sum −b/a-b/a is negative and the product c/ac/a is positive. For a complex pair the real part −b/(2a)-b/(2a) is negative exactly when b>0b \gt 0, and the product α2+β2=c/a\alpha^2 + \beta^2 = c/a is automatically positive. Block E tests this on 2000020000 random equations: 00 mismatches with the computed roots.

The roots are eigenvalues

With x⃗=(y,y′)\vec x = (y, y') the equation becomes x⃗′=Ax⃗\vec x' = A\vec x with the companion matrix

A=(01−c/a−b/a),det⁡(A−λI)=−λ(−ba−λ)+ca=1a(aλ2+bλ+c).A = \begin{pmatrix} 0 & 1\\ -c/a & -b/a\end{pmatrix}, \qquad \det(A - \lambda I) = -\lambda\Bigl(-\frac{b}{a} - \lambda\Bigr) + \frac{c}{a} = \frac1a\bigl(a\lambda^2 + b\lambda + c\bigr).

So the eigenvalues of AA are exactly the roots, tr⁡A=−b/a\operatorname{tr}A = -b/a is their sum and det⁡A=c/a\det A = c/a their product (Vieta is the general fact about trace and determinant). Block D prints trace and determinant for the three examples (−3.5,1.5-3.5, 1.5; −3,2.25-3, 2.25; −2,5-2, 5) and checks the eigenvalues against the roots. All solutions decay exactly when tr⁡A<0\operatorname{tr}A \lt 0 and det⁡A>0\det A \gt 0.

Here is what the eigenvector is. The solution erte^{rt} has state (ert,rert)=ert(1,r)(e^{rt}, re^{rt}) = e^{rt}(1, r): its direction in the (y,y′)(y, y') plane never changes, and it slides along the line through (1,r)(1, r) toward or away from the origin. That line is an eigenvector of AA, and A(1,r)T=r(1,r)TA(1, r)^{\mathsf T} = r(1, r)^{\mathsf T} is the characteristic equation again (the second row says −c/a−(b/a)r=r2-c/a - (b/a)r = r^2). The sim’s third panel draws these lines dashed for real roots. Three cases:

  • Distinct real roots: two eigen-lines. The eigenvector matrix (11r1r2)\begin{pmatrix}1 & 1\\ r_1 & r_2\end{pmatrix} has determinant r2−r1r_2 - r_1, which is the Wronskian at t=0t = 0 (block D prints −2.5-2.5 for the first example). This is the diagonalization of 1.6 Change of Basis & Diagonalization.
  • Complex pair: no real eigen-line, so the matrix rotates and scales, the spirals of 1.7 Complex Eigenvalues & Rotation.
  • Repeated root: then c/a=r2c/a = r^2, so A−rI=(−r1−r2r)A - rI = \begin{pmatrix}-r & 1\\ -r^2 & r\end{pmatrix} has second row rr times the first: rank 11, a one-dimensional kernel, one eigen-direction for a doubled eigenvalue (block D prints rank 11). The matrix cannot be diagonalized, and the missing direction is what the factor tt in tertte^{rt} pays for; see 1.8 The Matrix Exponential: From Hops to Flows.

Roots and the step size

A solver steps the system form with a fixed hh. For RK4 on x⃗′=Ax⃗\vec x' = A\vec x one step is x⃗n+1=R(hA)x⃗n\vec x_{n+1} = R(hA)\vec x_n with R(z)=1+z+z2/2+z3/6+z4/24R(z) = 1 + z + z^2/2 + z^3/6 + z^4/24, so each mode is multiplied per step by R(hλ)R(h\lambda). This is the scalar test of 4.5 Stability Regions & Stiffness applied mode by mode: the true solution wants Re⁡λ<0\operatorname{Re}\lambda \lt 0, the discrete one wants hλh\lambda inside a bounded region. Block F finds by bisection that ∣R(−z)∣≤1|R(-z)| \le 1 out to z=2.7853z = 2.7853, the figure in that lesson’s table.

Take y′′+1001y′+1000y=0y'' + 1001y' + 1000y = 0, roots −1-1 and −1000-1000, y(0)=1y(0) = 1, y′(0)=0y'(0) = 0. The exact solution is (1000e−t−e−1000t)/999(1000e^{-t} - e^{-1000t})/999, and by t=0.01t = 0.01 the fast factor e−1000te^{-1000t} is e−10=4.5400×10−5e^{-10} = 4.5400\times10^{-5}: invisible. Yet block F, running RK4 (4.3 Runge–Kutta Methods & Butcher Tableaux) on the companion system to t=0.5t = 0.5, shows:

step hhhλfasth\lambda_{\text{fast}}∣R∣\lvert R\rverty(0.5)y(0.5) from RK4exact
0.00250.0025−2.5-2.50.64840.64840.607140.607140.607140.60714
0.0040.004−4-45.00005.0000−2.3533×1084-2.3533\times10^{84}0.607140.60714

The invisible mode sets the largest usable step (stiffness, treated in the stability lesson): here h<2.7853/1000h \lt 2.7853/1000. For an oscillating pair the failure is gentler. With roots −1±10i-1 \pm 10i the numerical amplitude factor per step is ∣R(hλ)∣|R(h\lambda)|, shown beside the exact decay e−he^{-h}:

step hhRK4 factor per stepexact e−he^{-h}
0.050.050.9512510.9512510.9512290.951229
0.10.10.9021160.9021160.9048370.904837
0.20.20.5912370.5912370.8187310.818731

At h=0.2h = 0.2 RK4 is stable but damps by 0.590.59 per step instead of 0.820.82: the ringing dies far too fast.

Where this stops

The method rests on one fact: with constant coefficients erte^{rt} passes through the operator and cancels, leaving a polynomial in rr. Try y=erty = e^{rt} in t2y′′−2ty′+2y=0t^2y'' - 2ty' + 2y = 0, whose solutions are tt and t2t^2. Block G computes the left side divided by erte^{rt} and gets r2t2−2rt+2r^2t^2 - 2rt + 2. For that to vanish at every tt you need r=0r = 0 from the t2t^2 coefficient, and then the constant 22 is left over: no rr works. The solutions are powers, not exponentials, and some equations, such as the Airy equation y′′−ty=0y'' - ty = 0 (from memory), have no elementary solutions at all. For those you fall back on the structure theory and on the system form with a numerical integrator. Likewise, for a system with time-varying A(t)A(t) the frozen eigenvalues do not by themselves decide stability (from memory, not proved here), though simulators lean on them for slowly varying conditions.

Lab

Block A/B solves the three examples and compares with RK45, C holds the worked-example numbers, the amplitude-phase check and peak ratios, D the companion matrix, E the decay criterion, F the RK4 experiments, G the symbolic identities.

🐍 PythonLab: closed forms against RK45, amplitude-phase, companion matrix, decay criterion, RK4 step size, symbolic identities (blocks A to G)
⌘/Ctrl + Enter
✏️ Pen & paperMatch, then ask which starts decay●○○

Solve y′′−y′−6y=0y'' - y' - 6y = 0 with y(0)=4y(0) = 4, y′(0)=7y'(0) = 7. Then find all initial data for which the solution decays to zero, and name the line they form in the (y,y′)(y, y') plane.

Show worked solution

r2−r−6=(r−3)(r+2)r^2 - r - 6 = (r - 3)(r + 2), so y=c1e3t+c2e−2ty = c_1e^{3t} + c_2e^{-2t} with c1+c2=4c_1 + c_2 = 4 and 3c1−2c2=73c_1 - 2c_2 = 7. Doubling the first and adding: 5c1=155c_1 = 15, so c1=3c_1 = 3, c2=1c_2 = 1 and y=3e3t+e−2ty = 3e^{3t} + e^{-2t} (check: y′(0)=9−2=7y'(0) = 9 - 2 = 7).

The solution decays exactly when the growing mode is absent, c1=0c_1 = 0, since e3te^{3t} beats any other term. Then y=c2e−2ty = c_2e^{-2t} and y′(0)=−2y(0)y'(0) = -2y(0): the data lie on the line through (1,−2)=(1,r2)(1, -2) = (1, r_2), the companion-matrix eigenvector for −2-2.

✏️ Pen & paperFrom roots to an equation and its envelope●●○

An equation y′′+by′+cy=0y'' + by' + cy = 0 has roots −2±5i-2 \pm 5i. (a) Find bb, cc. (b) Solve it with y(0)=3y(0) = 3, y′(0)=−11y'(0) = -11. (c) Write the answer as Re−2tcos⁡(5t−φ)Re^{-2t}\cos(5t - \varphi). (d) By what factor does each maximum differ from the previous one?

Show worked solution

(a) P(r)=(r+2)2+25=r2+4r+29P(r) = (r + 2)^2 + 25 = r^2 + 4r + 29, so b=4b = 4, c=29c = 29 (Vieta: sum −4-4, product 4+25=294 + 25 = 29).

(b) α=−2\alpha = -2, β=5\beta = 5, c1=3c_1 = 3, c2=(−11+6)/5=−1c_2 = (-11 + 6)/5 = -1, so y=e−2t(3cos⁡5t−sin⁡5t)y = e^{-2t}(3\cos 5t - \sin 5t). Check: y′(0)=αc1+βc2=−6−5=−11y'(0) = \alpha c_1 + \beta c_2 = -6 - 5 = -11.

(c) R=9+1=3.1623R = \sqrt{9 + 1} = 3.1623. The point (c1,c2)=(3,−1)(c_1, c_2) = (3, -1) is in the fourth quadrant, so φ=atan2⁡(−1,3)=−0.32175\varphi = \operatorname{atan2}(-1, 3) = -0.32175 and y=10 e−2tcos⁡(5t+0.32175)y = \sqrt{10}\,e^{-2t}\cos(5t + 0.32175).

(d) Maxima are one period T=2π/5T = 2\pi/5 apart and y(t+T)=eαTy(t)y(t + T) = e^{\alpha T}y(t), so the factor is e−4π/5=0.0810e^{-4\pi/5} = 0.0810.

✏️ Pen & paperCritical damping can still overshoot●●●

Take y′′+4y′+4y=0y'' + 4y' + 4y = 0 with y(0)=1y(0) = 1, y′(0)=v0y'(0) = v_0. (a) Show y=(1+(v0+2)t)e−2ty = \bigl(1 + (v_0 + 2)t\bigr)e^{-2t}. (b) For which v0v_0 does yy cross zero at some t>0t \gt 0, and how often? (c) For v0=−5v_0 = -5 find the crossing time and the lowest value reached.

Show worked solution

(a) (r+2)2=0(r + 2)^2 = 0, so y=(c1+c2t)e−2ty = (c_1 + c_2t)e^{-2t}. Then c1=1c_1 = 1, and y′=(c2−2c1−2c2t)e−2ty' = (c_2 - 2c_1 - 2c_2t)e^{-2t} gives y′(0)=c2−2=v0y'(0) = c_2 - 2 = v_0, so c2=v0+2c_2 = v_0 + 2.

(b) Zeros of yy are zeros of 1+(v0+2)t1 + (v_0 + 2)t. If v0+2≥0v_0 + 2 \geq 0 this is at least 11 for t≥0t \geq 0: no crossing. If v0+2<0v_0 + 2 \lt 0 there is exactly one zero, t=−1/(v0+2)>0t = -1/(v_0 + 2) \gt 0. So yy crosses exactly once, exactly when v0<−2v_0 \lt -2: no oscillation, yet an overshoot.

(c) y=(1−3t)e−2ty = (1 - 3t)e^{-2t} crosses at t=1/3t = 1/3. Its slope is (−3−2(1−3t))e−2t=(6t−5)e−2t(-3 - 2(1 - 3t))e^{-2t} = (6t - 5)e^{-2t}, zero at t=5/6t = 5/6 where the slope changes from negative to positive: the minimum, y(5/6)=−1.5e−5/3=−0.28331y(5/6) = -1.5e^{-5/3} = -0.28331.

✅ Concept check

Which equation has solutions that oscillate while decaying?

✅ Concept check

The equation y'' + 2y' + 10y = 0 has roots -1 plus or minus 3i. Each maximum of a solution is how many times the previous maximum? Give a decimal.

✅ Concept check

The companion matrix of y'' + b y' + c y = 0 has trace -4 and determinant 13. What are the characteristic roots?

Exercise: closed-form solver, verified against RK45

Implement the lesson in three functions. classify reads the discriminant with a tolerance (floats like 0.60.6 and 0.090.09 make b2−4acb^2 - 4ac a rounding-level number, not 00). closed_form returns the real function y(t)y(t) in whichever case applies, using cosine and sine for complex roots. rk45_gap integrates with SciPy’s RK45 and reports the largest difference: an independent numerical method agreeing with your formula.

🧪 Coding exerciseExercise: closed-form solver for a y'' + b y' + c y = 0, verified against RK45
⌘/Ctrl + Enter

Key Takeaways

  • Substituting y=erty = e^{rt} gives (ar2+br+c)ert=0(ar^2 + br + c)e^{rt} = 0: erte^{rt} is an eigenfunction of d/dtd/dt, so the operator multiplies it by P(r)P(r) and the equation becomes P(r)=0P(r) = 0.
  • The discriminant picks the case: c1er1t+c2er2tc_1e^{r_1t} + c_2e^{r_2t} (Wronskian (r2−r1)e(r1+r2)t(r_2 - r_1)e^{(r_1 + r_2)t}), (c1+c2t)ert(c_1 + c_2t)e^{rt}, or eαt(c1cos⁡βt+c2sin⁡βt)e^{\alpha t}(c_1\cos\beta t + c_2\sin\beta t) with c1=y0c_1 = y_0, c2=(v0−αy0)/βc_2 = (v_0 - \alpha y_0)/\beta.
  • The factor tt comes from reduction of order, where 2y1′+py12y_1' + py_1 vanishes at a double root; equivalently L[tert]=(tP+P′)ertL[te^{rt}] = (tP + P')e^{rt} and both PP, P′P' vanish there.
  • Complex roots work because Euler’s formula keeps ddtert=rert\frac{d}{dt}e^{rt} = re^{rt} and real coefficients make the real and imaginary parts separate solutions; the shape is Reαtcos⁡(βt−φ)Re^{\alpha t}\cos(\beta t - \varphi) with φ=atan2⁡(c2,c1)\varphi = \operatorname{atan2}(c_2, c_1).
  • Real part of a root is growth rate, imaginary part is frequency; for a>0a \gt 0 all solutions decay exactly when b>0b \gt 0 and c>0c \gt 0.
  • The roots are the eigenvalues of (01−c/a−b/a)\begin{pmatrix}0 & 1\\ -c/a & -b/a\end{pmatrix} (trace −b/a-b/a, determinant c/ac/a, eigenvectors (1,r)(1, r)); a repeated root leaves one eigen-direction, hence tertte^{rt}.
  • An explicit solver multiplies each mode by R(hλ)R(h\lambda), so RK4 with a root at −1000-1000 needs h<2.7853/1000h \lt 2.7853/1000 even if that mode is invisible.
  • Constant coefficients only: for t2y′′−2ty′+2y=0t^2y'' - 2ty' + 2y = 0 the substitution erte^{rt} leaves r2t2−2rt+2r^2t^2 - 2rt + 2, which no rr makes zero.
Finished this lesson?

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