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, 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.
Transcript
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 , , . This is with , , so the previous lesson applies. In 3.3 Separable Equations you solved and got , the function whose derivative is a constant multiple of itself. A constant-coefficient equation uses , , only with constant multipliers, so try . Then , and
Since , it is a solution if and only if
the characteristic equation, with characteristic polynomial . The mechanism: says is an eigenfunction of with eigenvalue , in the sense of 1.5 Eigenvectors & Eigenvalues. The operator is a polynomial in , so it rescales that same function by . Solving the equation means finding the where the scale factor is zero.
The quadratic formula gives , and the discriminant sorts every equation into three cases.
| roots | two independent solutions | |
|---|---|---|
| distinct real | ||
| repeated real | ||
| complex pair |
Expanding gives , so
Case 1: two distinct real roots
If the Wronskian of , is , never zero, so is the general solution. (Abel’s theorem predicts , and by Vieta: they agree.)
Worked example. , , . Here and , so , . At the (value, slope) pairs of , are and , so . Cramer’s rule from the previous lesson gives
At the slow term is , the fast term is and (block C prints these). Late in the solution only the root nearest zero matters. A real-root solution also crosses zero at most once: means , and the left side is strictly monotone in .
Case 2: a repeated root
If there is one root and one solution . Use reduction of order from the previous lesson: put , so obeys . At the double root , hence . The term cancels, leaving , so and
Why does the cancellation happen exactly at a double root? Differentiate with respect to . The operator does not involve and , so
At a double root and , so is a solution; at a simple root it is not. Block G confirms both identities symbolically. The Wronskian of and is .
Worked example. , , . Here and , so by the formula (the slope condition is ). Block A gives . The slope is , so the solution falls monotonically. Like Case 1 it crosses zero at most once, because has at most one zero.
Case 3: complex roots and Euler’s formula
If the roots are with and (taking ). The ansatz needs for complex . By Euler’s formula from 1.7 Complex Eigenvalues & Rotation, . The calculation only needs , and it holds: differentiating the right side gives , which is times the original. So and , with and , is a complex solution.
You want real ones. Because are real, and are real, and forces both to vanish: the real and imaginary parts are separately solutions. Their Wronskian is (the cross terms combine into ), so
where the constants come from and . The conjugate root gives the same pair, with the sine’s sign flipped.
Worked example, owed from last lesson. : , , so the basis is , , the pair the previous lesson asked you to check by substitution, with Wronskian as it quoted (block G prints the Wronskian and a residual of for each function). With , : , , so
Amplitude-phase form. Since , choose , :
Use two-argument arctangent: loses the quadrant and shifts the wave by half a period. Here , , and block C confirms the match to . Zeros are spaced apart, the first at , i.e. . Shifting time by one period leaves the cosine unchanged and scales the envelope by , so for all : successive maxima shrink by the fixed factor . Here , which block C also finds numerically from the maxima.
Roots in the complex plane
Every mode is with ( for real roots), and with oscillation at angular frequency . So the location of a root is the behavior of its mode:
- Real part is the growth rate, with e-fold time : left half-plane decays, right half-plane grows, the imaginary axis keeps the amplitude.
- Imaginary part is the frequency, period . A root on the real axis does not oscillate; a root at zero is a constant mode.
The underdamped preset has roots ; its readout reports , , discriminant , and the , 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 and with data , 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 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 , exactly when and . By Vieta, two real roots are both negative exactly when the sum is negative and the product is positive. For a complex pair the real part is negative exactly when , and the product is automatically positive. Block E tests this on random equations: mismatches with the computed roots.
The roots are eigenvalues
With the equation becomes with the companion matrix
So the eigenvalues of are exactly the roots, is their sum and their product (Vieta is the general fact about trace and determinant). Block D prints trace and determinant for the three examples (; ; ) and checks the eigenvalues against the roots. All solutions decay exactly when and .
Here is what the eigenvector is. The solution has state : its direction in the plane never changes, and it slides along the line through toward or away from the origin. That line is an eigenvector of , and is the characteristic equation again (the second row says ). The sim’s third panel draws these lines dashed for real roots. Three cases:
- Distinct real roots: two eigen-lines. The eigenvector matrix has determinant , which is the Wronskian at (block D prints 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 , so has second row times the first: rank , a one-dimensional kernel, one eigen-direction for a doubled eigenvalue (block D prints rank ). The matrix cannot be diagonalized, and the missing direction is what the factor in 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 . For RK4 on one step is with , so each mode is multiplied per step by . This is the scalar test of 4.5 Stability Regions & Stiffness applied mode by mode: the true solution wants , the discrete one wants inside a bounded region. Block F finds by bisection that out to , the figure in that lesson’s table.
Take , roots and , , . The exact solution is , and by the fast factor is : invisible. Yet block F, running RK4 (4.3 Runge–Kutta Methods & Butcher Tableaux) on the companion system to , shows:
| step | from RK4 | exact | ||
|---|---|---|---|---|
The invisible mode sets the largest usable step (stiffness, treated in the stability lesson): here . For an oscillating pair the failure is gentler. With roots the numerical amplitude factor per step is , shown beside the exact decay :
| step | RK4 factor per step | exact |
|---|---|---|
At RK4 is stable but damps by per step instead of : the ringing dies far too fast.
Where this stops
The method rests on one fact: with constant coefficients passes through the operator and cancels, leaving a polynomial in . Try in , whose solutions are and . Block G computes the left side divided by and gets . For that to vanish at every you need from the coefficient, and then the constant is left over: no works. The solutions are powers, not exponentials, and some equations, such as the Airy equation (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 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.
Solve with , . Then find all initial data for which the solution decays to zero, and name the line they form in the plane.
Show worked solution
, so with and . Doubling the first and adding: , so , and (check: ).
The solution decays exactly when the growing mode is absent, , since beats any other term. Then and : the data lie on the line through , the companion-matrix eigenvector for .
An equation has roots . (a) Find , . (b) Solve it with , . (c) Write the answer as . (d) By what factor does each maximum differ from the previous one?
Show worked solution
(a) , so , (Vieta: sum , product ).
(b) , , , , so . Check: .
(c) . The point is in the fourth quadrant, so and .
(d) Maxima are one period apart and , so the factor is .
Take with , . (a) Show . (b) For which does cross zero at some , and how often? (c) For find the crossing time and the lowest value reached.
Show worked solution
(a) , so . Then , and gives , so .
(b) Zeros of are zeros of . If this is at least for : no crossing. If there is exactly one zero, . So crosses exactly once, exactly when : no oscillation, yet an overshoot.
(c) crosses at . Its slope is , zero at where the slope changes from negative to positive: the minimum, .
Exercise: closed-form solver, verified against RK45
Implement the lesson in three functions. classify reads the discriminant with a tolerance (floats like and make a rounding-level number, not ). closed_form returns the real function 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.
Key Takeaways
- Substituting gives : is an eigenfunction of , so the operator multiplies it by and the equation becomes .
- The discriminant picks the case: (Wronskian ), , or with , .
- The factor comes from reduction of order, where vanishes at a double root; equivalently and both , vanish there.
- Complex roots work because Euler’s formula keeps and real coefficients make the real and imaginary parts separate solutions; the shape is with .
- Real part of a root is growth rate, imaginary part is frequency; for all solutions decay exactly when and .
- The roots are the eigenvalues of (trace , determinant , eigenvectors ); a repeated root leaves one eigen-direction, hence .
- An explicit solver multiplies each mode by , so RK4 with a root at needs even if that mode is invisible.
- Constant coefficients only: for the substitution leaves , which no makes zero.