Flow Lab

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

Lesson 5.1

Second-Order Linear Equations: Structure

Superposition, linear independence of solutions, the Wronskian, fundamental sets, and existence–uniqueness for linear ODEs.

Written byClaude Sonnet

🌊
Why this matters for simulation: Superposition is why potential-flow solutions (uniform flow + source + vortex) can simply be added.

By the end of this lesson you can…

  • Write a second-order linear equation as $L[y] = 0$ with $L[y] = y'' + p y' + q y$, show that $L$ is linear, and use superposition to build new solutions from old ones.
  • Explain why the solutions of $L[y] = 0$ form a 2-dimensional space (the kernel of $L$) using existence and uniqueness, and say what a fundamental set is.
  • Compute the Wronskian of two functions as a $2\times2$ determinant, interpret it as an area in the $(y, y')$ plane, and use it to test independence and to match initial conditions.
  • Derive Abel's theorem $W' = -pW$ and use it to find the Wronskian without knowing the solutions, and to show it either vanishes everywhere or nowhere.
  • Use reduction of order to find a second solution from a first, including the repeated-root example $y'' - 2y' + y = 0$.
  • Convert $y'' + py' + qy = 0$ to a first-order system for $(y, y')$ and integrate it with RK4, checking the Wronskian against Abel's formula.
  • State where superposition and the Wronskian test fail (nonlinear or inhomogeneous equations, functions that are not solutions).
On this page
·
  1. The operator L and superposition
  2. Why there are exactly two: existence and uniqueness
  3. The Wronskian: a determinant, an area, a test
  4. Abel’s theorem
  5. Reduction of order
  6. From one second-order equation to a first-order system
  7. Where this stops: nonlinear, inhomogeneous, not solutions
  8. Lab
  9. Exercise: the system form, RK4 and a numerical Wronskian
  10. Key Takeaways

A mass on a spring, a pendulum at small angles, a gust-loaded wing flexing and the pitch oscillation of an aircraft are all described by a second derivative equal to a combination of lower derivatives. In 3.4 Linear First-Order Equations & Integrating Factors the first-order linear equation was solved in one stroke by an integrating factor. A second derivative needs two initial conditions, and the single integrating factor is not enough. What replaces it is a piece of structure: the solutions form a small vector space, and everything in this module (5.2 Constant Coefficients & the Characteristic Equation, vibrations, forcing, series) is a way of finding a basis of it. This lesson builds that structure without solving any particular family of equations; the pay-off is that once you have two good solutions you have all of them.

▶ Video The operator L, superposition, the kernel of L is two-dimensional, the Wronskian as the area of a parallelogram, Abel's theorem, reduction of order, and the system form with RK4captions only
Transcript
  1. L takes y to y double prime plus p y prime plus q y. It is linear, since derivatives pass through sums and constants, so combinations of solutions are solutions. Test on y double prime equals y: e to the t, e to the minus t and two e to the t minus e to the minus t all leave residual zero.
  2. Existence and uniqueness: each starting value and slope has exactly one solution. So the map from solutions to pairs is linear, onto, and sends only the zero function to zero. The solutions form a plane: two dimensional. A basis is a fundamental set.
  3. Stack the value-and-slope vectors of two solutions. At time zero, e to the t gives one, one and e to the minus t gives one, minus one. Their determinant, the Wronskian, is one times minus one, minus one times one: minus two. A signed area, two, clockwise.
  4. Let time run. For cosine and sine the area stays exactly one. For cosine and twice cosine the arrows always share a line: area zero, so combinations reach only that line, and the target one, three is out of reach.
  5. Match value one and slope three: c one plus c two equals one, c one minus c two equals three. Cramer's rule with W equal minus two gives c one two, c two minus one: two of v one, minus one of v two, reaches the target. So y is two e to the t minus e to the minus t, 5.068684 at t equals one.
  6. Differentiate W: the first-derivative products cancel. Substitute the equation for each second derivative and the q terms cancel too, leaving W prime equals minus p W. So W equals W at t zero times the exponential of minus the integral of p: zero everywhere or nowhere.
  7. Check on y double prime plus two y prime plus five y, solved by e to the minus t cosine two t and sine two t. At zero W is two and p is two, so Abel says two e to the minus two t: 0.270671 at t equals one, 0.036631 at two, matching the product-rule values. The area shrinks, and q never entered.
  8. Reduction of order: let y two be v times y one. The v terms multiply L of y one, which is zero, leaving v prime and v double prime. For the repeated-root example, with y one e to the t, the v prime coefficient vanishes, so v is c one plus c two t and y two is t e to the t. Its Wronskian, e to the two t, agrees with Abel.
  9. To compute, convert: let x be y and y prime, so x prime is A x with trace minus p. RK4 on y double prime plus two y prime plus five y shows errors at t equals three shrinking by 16.66, then 16.50, when h halves: fourth order.
  10. Place two solutions as columns of X; its determinant is the Wronskian, and from memory its derivative is the trace times itself, Abel's law. RK4 returns 0.13533593 at t equals one against e to the minus two, 0.13533528. The undamped case keeps 0.99999861, the t squared case gives 9.00000113 against nine.
  11. Where it stops: for y double prime equals y squared, six over t squared solves it, but twice it does not: seventy-two against one hundred forty-four at t equals one. The flow agrees: from value 0.8, slope minus 0.6, the superposition gap is zero for the linear equation, and about minus 0.217, minus 0.585 here.
  12. Last warning: t squared and t times absolute t have Wronskian zero, yet their ratio is minus one at t equals minus one and plus one at t equals one. No linear equation with continuous p and q has both as solutions, so the zero means nothing.
  13. So: the solutions form a two-dimensional space, the Wronskian is a signed area that tests independence, and Abel's law makes it zero everywhere or nowhere. Compute by converting to a system; nonlinear equations break all this. Next: constant coefficients.

The operator L and superposition

Fix an interval II of time and two functions p(t)p(t), q(t)q(t). Define a machine that takes a (twice differentiable) function yy and returns another function:

L[y]=y′′+p(t) y′+q(t) y.L[y] = y'' + p(t)\,y' + q(t)\,y .

The equation L[y]=0L[y] = 0 is second-order linear homogeneous. “Linear” refers to how yy enters: yy, y′y' and y′′y'' appear only to the first power, multiplied by functions of tt alone. The machine is linear in the sense of 1.2 Matrices as Transformations: for functions y1,y2y_1, y_2 and numbers c1,c2c_1, c_2,

L[c1y1+c2y2]=(c1y1+c2y2)′′+p (c1y1+c2y2)′+q (c1y1+c2y2)=c1L[y1]+c2L[y2].L[c_1y_1 + c_2y_2] = (c_1y_1 + c_2y_2)'' + p\,(c_1y_1 + c_2y_2)' + q\,(c_1y_1 + c_2y_2) = c_1L[y_1] + c_2L[y_2].

The middle step uses only that differentiation passes through sums and constants ((c1y1+c2y2)′=c1y1′+c2y2′(c_1y_1 + c_2y_2)' = c_1y_1' + c_2y_2') and that multiplying by pp and qq does too. So if L[y1]=0L[y_1] = 0 and L[y2]=0L[y_2] = 0 then L[c1y1+c2y2]=c1⋅0+c2⋅0=0L[c_1y_1 + c_2y_2] = c_1\cdot 0 + c_2\cdot 0 = 0. This is the superposition principle: any combination of solutions is a solution.

Here is the matrix picture. For a matrix AA, the kernel of 1.3 Linear Systems, Kernel & Column Space is the set of inputs xx that AA sends to 0⃗\vec 0, and it is closed under combinations for exactly the reason above. The operator LL is the same idea with functions as the inputs: its kernel is the set of all functions that LL sends to the zero function. That kernel is the solution set. A matrix with 4 columns and 2 independent rows has a 2-dimensional kernel because 2 of the 4 unknowns are free. The question for LL is how many free choices a solution has.

Why there are exactly two: existence and uniqueness

The answer comes from 3.7 Existence & Uniqueness in its linear form (stated here, not proved). If pp and qq are continuous on an interval II and t0∈It_0 \in I, then for any two numbers a,ba, b there is exactly one solution of L[y]=0L[y] = 0 with y(t0)=ay(t_0) = a and y′(t0)=by'(t_0) = b, and it exists on all of II. The last clause differs from the nonlinear case, where solutions can blow up early (see “Where this stops” below).

Now count. Define the map Φ\Phi that takes a solution yy to the pair (y(t0),y′(t0))∈R2(y(t_0), y'(t_0)) \in \mathbb{R}^2.

  • Φ\Phi is linear (value and derivative of a sum are sums).
  • Φ\Phi is onto: existence says every pair (a,b)(a, b) is hit.
  • Φ\Phi has kernel zero: if Φ(y)=(0,0)\Phi(y) = (0, 0), then yy and the zero function both solve the equation with the same data, so uniqueness says y=0y = 0.

A linear map that is onto and one-to-one identifies the solution space with R2\mathbb{R}^2. So the kernel of LL is 2-dimensional: a solution is determined by two free numbers, its starting value and starting slope, which is the “two free unknowns” of the matrix picture. A fundamental set is a pair y1,y2y_1, y_2 of solutions that forms a basis, so that every solution is c1y1+c2y2c_1y_1 + c_2y_2 for exactly one pair (c1,c2)(c_1, c_2). Finding a fundamental set is the whole game; the tool that recognizes one is next.

The Wronskian: a determinant, an area, a test

Suppose y1,y2y_1, y_2 are solutions and you want the combination with y(t0)=ay(t_0) = a and y′(t0)=by'(t_0) = b. Write down both conditions:

c1 y1(t0)+c2 y2(t0)=a,c1 y1′(t0)+c2 y2′(t0)=b.\begin{aligned} c_1\,y_1(t_0) + c_2\,y_2(t_0) &= a,\\ c_1\,y_1'(t_0) + c_2\,y_2'(t_0) &= b. \end{aligned}

This is a 2×22\times2 linear system for (c1,c2)(c_1, c_2) with matrix whose columns are v⃗1=(y1,y1′)\vec v_1 = (y_1, y_1') and v⃗2=(y2,y2′)\vec v_2 = (y_2, y_2') at t0t_0. By 1.4 Determinants as Volume Scaling it has exactly one solution for every (a,b)(a, b) if and only if the determinant is nonzero. That determinant is the Wronskian,

W(t)=det⁡(y1y2y1′y2′)=y1y2′−y1′y2.W(t) = \det\begin{pmatrix} y_1 & y_2\\ y_1' & y_2'\end{pmatrix} = y_1y_2' - y_1'y_2 .

Geometrically, v⃗1\vec v_1 and v⃗2\vec v_2 are two arrows in the (y,y′)(y, y') plane (the phase plane of 4.7 Energy & Symplectic Integrators), and W(t0)W(t_0) is the signed area of the parallelogram they span. If the area is zero the arrows lie on one line, and combinations of them can only reach that line: most targets (a,b)(a, b) cannot be matched. If the area is nonzero the arrows span the plane and every target is reached, with the coefficients given by Cramer’s rule,

c1=a y2′(t0)−b y2(t0)W(t0),c2=b y1(t0)−a y1′(t0)W(t0).c_1 = \frac{a\,y_2'(t_0) - b\,y_2(t_0)}{W(t_0)}, \qquad c_2 = \frac{b\,y_1(t_0) - a\,y_1'(t_0)}{W(t_0)}.

Worked example. y′′−y=0y'' - y = 0 has solutions y1=ety_1 = e^t and y2=e−ty_2 = e^{-t} (differentiate twice: each returns itself). At t0=0t_0 = 0 the vectors are (1,1)(1, 1) and (1,−1)(1, -1) and W=1⋅(−1)−1⋅1=−2W = 1\cdot(-1) - 1\cdot 1 = -2. For y(0)=1y(0) = 1, y′(0)=3y'(0) = 3 the system is c1+c2=1c_1 + c_2 = 1, c1−c2=3c_1 - c_2 = 3, so adding gives 2c1=42c_1 = 4 and c1=2c_1 = 2, c2=−1c_2 = -1. Check with Cramer: c1=(1⋅(−1)−3⋅1)/(−2)=2c_1 = (1\cdot(-1) - 3\cdot 1)/(-2) = 2. So y=2et−e−ty = 2e^t - e^{-t}. The playground below computes y(1)=5.068684y(1) = 5.068684 from it, and the sim’s et,e−te^t, e^{-t} option with a=1a = 1, b=3b = 3 reproduces c1=2c_1 = 2, c2=−1c_2 = -1 (the minus sign in W=−2W = -2 only says the pair is oriented clockwise; the area is 22).

The same determinant tests independence. If c1y1+c2y2=0c_1y_1 + c_2y_2 = 0 for all tt, differentiating gives c1y1′+c2y2′=0c_1y_1' + c_2y_2' = 0, so the matrix times (c1,c2)(c_1, c_2) is zero. If W(t0)≠0W(t_0) \neq 0 at even one point, the matrix is invertible there and (c1,c2)=(0,0)(c_1, c_2) = (0, 0): the functions are independent. Conversely, for solutions of the same equation, W(t0)=0W(t_0) = 0 means some nonzero (c1,c2)(c_1, c_2) makes c1v⃗1+c2v⃗2=0⃗c_1\vec v_1 + c_2\vec v_2 = \vec 0. Then c1y1+c2y2c_1y_1 + c_2y_2 is a solution with zero value and zero slope at t0t_0, and uniqueness forces it to be the zero function: the two are dependent. The uniqueness step is where “solutions of the same linear equation” matters, and the last section shows the test failing without it.

◆ Interactive Two solutions, their combination, the Wronskian W(t) against Abel's curve, and the (y, y') parallelogram

Loading simulation…

Abel’s theorem

The sim’s middle panel draws W(t)W(t) for each preset together with a dotted curve W(t0)exp⁡(−∫t0tp)W(t_0)\exp\bigl(-\int_{t_0}^t p\bigr). They coincide, and here is why. Differentiate W=y1y2′−y1′y2W = y_1y_2' - y_1'y_2 with the product rule:

W′=y1′y2′+y1y2′′−y1′′y2−y1′y2′=y1y2′′−y1′′y2.W' = y_1'y_2' + y_1y_2'' - y_1''y_2 - y_1'y_2' = y_1y_2'' - y_1''y_2 .

The terms with two first derivatives cancel. Now use the equation to replace the second derivatives, yi′′=−pyi′−qyiy_i'' = -py_i' - qy_i:

W′=y1(−py2′−qy2)−(−py1′−qy1) y2=−p (y1y2′−y1′y2)−q (y1y2−y1y2)=−p W.W' = y_1(-py_2' - qy_2) - (-py_1' - qy_1)\,y_2 = -p\,(y_1y_2' - y_1'y_2) - q\,(y_1y_2 - y_1y_2) = -p\,W .

The qq terms cancel, so the result does not depend on qq at all. The equation W′=−pWW' = -pW is separable (3.3 Separable Equations) with solution

 W(t)=W(t0) exp⁡ ⁣(−∫t0tp(s) ds) \boxed{\,W(t) = W(t_0)\,\exp\!\Bigl(-\int_{t_0}^{t}p(s)\,ds\Bigr)\,}

Abel’s theorem. An exponential is never zero, so either W(t0)=0W(t_0) = 0 and then W≡0W \equiv 0 on the whole interval, or W(t0)≠0W(t_0) \ne 0 and WW is never zero there. One look at one point settles independence everywhere. The first-derivative coefficient pp is the whole story: it is the rate at which the parallelogram of the previous section grows or shrinks, an area-expansion rate of −p-p. With p=0p = 0 the area is constant, the property of 4.7 Energy & Symplectic Integrators in Hamiltonian systems. With positive pp (friction, as in 5.3 Mechanical Vibrations: Spring–Mass–Damper) the area decays.

Three checks, all in the lab and the sim:

  • y′′+y=0y'' + y = 0 with cos⁡t,sin⁡t\cos t, \sin t: p=0p = 0, so WW is constant, and the playground prints 1.01.0 at t=1,2,3t = 1, 2, 3. For et,e−te^t, e^{-t} it prints −2.0-2.0 at each time.
  • y′′+2y′+5y=0y'' + 2y' + 5y = 0 has y1=e−tcos⁡2ty_1 = e^{-t}\cos 2t and y2=e−tsin⁡2ty_2 = e^{-t}\sin 2t (you can check them by substitution; 5.2 Constant Coefficients & the Characteristic Equation derives them). At t=0t = 0 the vectors are (1,−1)(1, -1) and (0,2)(0, 2) and W(0)=2W(0) = 2. Abel with p=2p = 2 predicts W(t)=2e−2tW(t) = 2e^{-2t}, and the playground prints 0.2706710.270671 at t=1t = 1 and 0.0366310.036631 at t=2t = 2 from the product-rule formula, the same as 2e−2t2e^{-2t}. In the sim’s y′′+2y′+5y=0y'' + 2y' + 5y = 0 option the readout shows, at t=6t = 6, both the direct value and the Abel value as 1.229×10−51.229\times10^{-5}.
  • t2y′′−2ty′+2y=0t^2y'' - 2ty' + 2y = 0 on t>0t > 0 has y1=ty_1 = t, y2=t2y_2 = t^2 (substitute: 0−2t+2t=00 - 2t + 2t = 0 and 2t2−4t2+2t2=02t^2 - 4t^2 + 2t^2 = 0). Here p=−2/tp = -2/t, so exp⁡(∫2/t)=t2\exp(\int 2/t) = t^2 and W(t)=W(1) t2W(t) = W(1)\,t^2. Directly W=t⋅2t−1⋅t2=t2W = t\cdot 2t - 1\cdot t^2 = t^2, which is 1,4,91, 4, 9 at t=1,2,3t = 1, 2, 3 in the playground and 99 at t=3t = 3 in the sim’s t2y′′−2ty′+2y=0t^2y'' - 2ty' + 2y = 0 option. Note the pair is independent on t>0t > 0 but W(0)=0W(0) = 0. Abel does not forbid this: the equation divided by t2t^2 has p=−2/tp = -2/t, which is not continuous at 00, so 00 is not in the interval.

Reduction of order

Suppose you know one solution y1y_1 with no zeros and want a second. Look for it as y2=v(t) y1(t)y_2 = v(t)\,y_1(t) with a function vv to find. Then y2′=v′y1+vy1′y_2' = v'y_1 + vy_1' and y2′′=v′′y1+2v′y1′+vy1′′y_2'' = v''y_1 + 2v'y_1' + vy_1''. Substitute into LL:

L[vy1]=v (y1′′+py1′+qy1)+y1v′′+(2y1′+py1)v′=y1v′′+(2y1′+py1)v′,L[vy_1] = v\,(y_1'' + py_1' + qy_1) + y_1v'' + (2y_1' + py_1)v' = y_1v'' + (2y_1' + py_1)v' ,

because the bracket multiplying vv is L[y1]=0L[y_1] = 0. The unknown vv itself has vanished from the equation; only v′v' and v′′v'' remain. Let w=v′w = v' and the condition L[vy1]=0L[vy_1] = 0 becomes the first-order equation y1w′+(2y1′+py1)w=0y_1w' + (2y_1' + py_1)w = 0, which is separable:

w′w=−2y1′y1−p⟹w=C e−∫py12.\frac{w'}{w} = -\frac{2y_1'}{y_1} - p \quad\Longrightarrow\quad w = \frac{C\,e^{-\int p}}{y_1^2}.

That is the mechanism: a second-order problem whose lower-order piece is already solved collapses to two first-order integrations. (Compare Abel: W(y1,vy1)=y1(v′y1+vy1′)−y1′vy1=y12v′W(y_1, vy_1) = y_1(v'y_1 + vy_1') - y_1'vy_1 = y_1^2v', so W=Ce−∫pW = Ce^{-\int p}, consistent.)

Worked example. y′′−2y′+y=0y'' - 2y' + y = 0 has the obvious solution y1=ety_1 = e^t (every derivative is ete^t, and 1−2+1=01 - 2 + 1 = 0). Here p=−2p = -2 and 2y1′+py1=2et−2et=02y_1' + py_1 = 2e^t - 2e^t = 0, so the reduced equation is etv′′=0e^tv'' = 0, hence v′′=0v'' = 0 and v=c1+c2tv = c_1 + c_2t. Taking c1=0c_1 = 0, c2=1c_2 = 1 gives y2=tety_2 = te^t. Check: y2′=(1+t)ety_2' = (1 + t)e^t, y2′′=(2+t)ety_2'' = (2 + t)e^t, and (2+t)−2(1+t)+t=0(2 + t) - 2(1 + t) + t = 0. The Wronskian is et⋅(1+t)et−et⋅tet=e2te^t\cdot(1 + t)e^t - e^t\cdot te^t = e^{2t}, and Abel’s exp⁡(−∫(−2))=e2t\exp(-\int(-2)) = e^{2t} agrees. This is the repeated-root case that 5.2 Constant Coefficients & the Characteristic Equation will need: the factor tt is not a lucky guess; it is what the algebra produces.

✅ Concept check

y1 and y2 both solve y'' + p y' + q y = 0 on an interval where p and q are continuous. You find W(y1, y2) = 0 at a single time t1. What follows?

✅ Concept check

Two solutions of y'' + 4y' + 3y = 0 have W = 3 at t = 0. What is W at t = 0.5? Give a decimal.

From one second-order equation to a first-order system

You have been given a numerical-methods toolbox that eats first-order systems, so convert. Let the state be x⃗=(x1,x2)=(y,y′)\vec x = (x_1, x_2) = (y, y'). Then x1′=y′=x2x_1' = y' = x_2 and x2′=y′′=−py′−qy=−q x1−p x2x_2' = y'' = -py' - qy = -q\,x_1 - p\,x_2:

(yy′)′=(01−q(t)−p(t))⏟A(t)(yy′).\begin{pmatrix} y\\ y'\end{pmatrix}' = \underbrace{\begin{pmatrix} 0 & 1\\ -q(t) & -p(t)\end{pmatrix}}_{A(t)}\begin{pmatrix} y\\ y'\end{pmatrix}.

This is the form 4.2 The Euler Family: Forward, Backward, Heun & Midpoint, 4.3 Runge–Kutta Methods & Butcher Tableaux and 4.4 Adaptive Step Size & RK45 are written for. To feed it to RK4, f(t, x) returns [x[1], -p(t)*x[1] - q(t)*x[0]] and the rest is the stepper you already have. There is no second-order RK4, because the state of a second-order equation is a pair.

Two solutions give two columns x⃗1=(y1,y1′)\vec x_1 = (y_1, y_1') and x⃗2=(y2,y2′)\vec x_2 = (y_2, y_2'), and putting them side by side gives a matrix X(t)X(t) with X′=A(t)XX' = A(t)X. Its determinant is the Wronskian. For a matrix ODE, (det⁡X)′=tr⁡A⋅det⁡X(\det X)' = \operatorname{tr}A\cdot\det X (a standard identity, Liouville’s formula, from memory), and tr⁡A=0+(−p)=−p\operatorname{tr}A = 0 + (-p) = -p: Abel’s theorem is the trace formula. For p=0p = 0 the trace vanishes, the area is preserved, and the flow is the Hamiltonian flow of 4.7 Energy & Symplectic Integrators (with qq constant, H=12y′2+12qy2H = \tfrac12 y'^2 + \tfrac12 qy^2).

Block D of the playground integrates the system for y′′+2y′+5y=0y'' + 2y' + 5y = 0 with y(0)=1y(0) = 1, y′(0)=0y'(0) = 0, whose exact solution is y=e−t(cos⁡2t+12sin⁡2t)y = e^{-t}(\cos 2t + \tfrac12\sin 2t) (match with the damped pair: y(0)=1y(0) = 1 gives c1=1c_1 = 1, then −c1+2c2=0-c_1 + 2c_2 = 0 gives c2=1/2c_2 = 1/2). At t=3t = 3 the exact value is 0.040848420.04084842 and RK4 with h=0.2,0.1,0.05h = 0.2, 0.1, 0.05 has errors 1.389×10−41.389\times10^{-4}, 8.337×10−68.337\times10^{-6}, 5.051×10−75.051\times10^{-7}. The ratios are 16.6616.66 and 16.5016.50, close to the 24=162^4 = 16 of a fourth-order method (4.1 Local Error, Global Error & Order). Integrating X′=AXX' = AX from X(0)=IX(0) = I and taking the determinant, RK4 returns 0.135335930.13533593 at t=1t = 1 against Abel’s e−2=0.13533528e^{-2} = 0.13533528; for y′′+y=0y'' + y = 0 up to t=10t = 10 with h=0.1h = 0.1 it returns 0.999998610.99999861 against 11, a small RK4 area loss of the kind seen in 4.7 Energy & Symplectic Integrators; and for t2y′′−2ty′+2y=0t^2y'' - 2ty' + 2y = 0 from t=1t = 1 to 33 it returns 9.000001139.00000113 against 99.

Where this stops: nonlinear, inhomogeneous, not solutions

The structure above used three facts: LL is linear, the right-hand side is 00, and y1,y2y_1, y_2 solve the same equation. Dropping each one breaks something.

Nonlinear. Take y′′=y2y'' = y^2. The function y=6/t2y = 6/t^2 solves it for t>0t > 0: y′′=36/t4y'' = 36/t^4 and y2=36/t4y^2 = 36/t^4. But 2y=12/t22y = 12/t^2 gives (2y)′′=72/t4(2y)'' = 72/t^4 while (2y)2=144/t4(2y)^2 = 144/t^4: at t=1t = 1 the playground prints 7272 against 144144. Doubling a solution does not give a solution. The flow shows the same thing: block E starts RK4 at (a,b)=(0.8,−0.6)(a, b) = (0.8, -0.6) and compares with a flow(1,0)+b flow(0,1)a\,\mathrm{flow}(1, 0) + b\,\mathrm{flow}(0, 1). For y′′+2y′+5y=0y'' + 2y' + 5y = 0 the gap at T=1T = 1 is 00 in both components; for y′′=y2y'' = y^2 it is (−0.21683431,−0.58533315)(-0.21683431, -0.58533315). And the solution 6/t26/t^2 blows up at t=0t = 0 even though nothing in the equation looks singular there, which is why the nonlinear theory only promises solutions near the start.

Inhomogeneous. For y′′+y=1y'' + y = 1 the function y=1y = 1 is a solution, but 2y=22y = 2 gives y′′+y=2y'' + y = 2. The sum of two solutions of L[y]=gL[y] = g solves L[y]=2gL[y] = 2g, not gg. What does survive: the difference of two solutions solves the homogeneous equation, so everything is “one particular solution plus the kernel of LL”, the structure used in 5.4 Nonhomogeneous Equations: Undetermined Coefficients.

Functions that are not solutions of one linear equation. The functions t2t^2 and t∣t∣t|t| are differentiable with derivatives 2t2t and 2∣t∣2|t|, and the playground prints W=0W = 0 at t=−2,−1,1,2t = -2, -1, 1, 2 (it is zero for all tt). Yet they are not multiples of each other: the ratio y2/y1y_2/y_1 is −1-1 at t=−1t = -1 and +1+1 at t=1t = 1. No linear equation with continuous pp and qq has both as solutions, so the uniqueness step of the independence argument is unavailable, and W≡0W \equiv 0 means nothing. The Wronskian test is a statement about solutions, not about arbitrary pairs of functions.

Lab

Block A computes Wronskians, B matches initial conditions, C checks the counterexamples, D integrates the system with RK4 and compares det⁡X\det X with Abel, and E tests superposition on the flow. The code runs in the browser in a few seconds.

🐍 PythonLab: Wronskians, matching, nonlinear counterexamples, RK4 on the system form, superposition (blocks A to E)
⌘/Ctrl + Enter
✏️ Pen & paperMatch and test●○○

Show that y1=cos⁡2ty_1 = \cos 2t and y2=sin⁡2ty_2 = \sin 2t solve y′′+4y=0y'' + 4y = 0, compute their Wronskian, and find the solution with y(0)=3y(0) = 3, y′(0)=−4y'(0) = -4.

Show worked solution

y1′′=−4cos⁡2t=−4y1y_1'' = -4\cos 2t = -4y_1 and y2′′=−4sin⁡2t=−4y2y_2'' = -4\sin 2t = -4y_2, so both satisfy y′′+4y=0y'' + 4y = 0. W=cos⁡2t⋅2cos⁡2t−(−2sin⁡2t)sin⁡2t=2cos⁡22t+2sin⁡22t=2W = \cos 2t\cdot 2\cos 2t - (-2\sin 2t)\sin 2t = 2\cos^22t + 2\sin^22t = 2. Since W=2≠0W = 2 \neq 0 they are a fundamental set. At t0=0t_0 = 0: y1=1y_1 = 1, y1′=0y_1' = 0, y2=0y_2 = 0, y2′=2y_2' = 2, so c1=3c_1 = 3 from the first condition and 2c2=−42c_2 = -4 from the second, c2=−2c_2 = -2. The solution is y=3cos⁡2t−2sin⁡2ty = 3\cos 2t - 2\sin 2t. Check: y(0)=3y(0) = 3 and y′(0)=−6sin⁡0−4cos⁡0=−4y'(0) = -6\sin 0 - 4\cos 0 = -4. Abel agrees with WW constant because p=0p = 0.

✏️ Pen & paperReduction of order, Euler type●●○

y1=ty_1 = t solves t2y′′+2ty′−2y=0t^2y'' + 2ty' - 2y = 0 on t>0t > 0. Use reduction of order to find a second solution, and confirm your Wronskian with Abel’s theorem.

Show worked solution

Put y=vty = vt. Then y′=v′t+vy' = v't + v and y′′=v′′t+2v′y'' = v''t + 2v'. Substitute:

t2(v′′t+2v′)+2t(v′t+v)−2vt=t3v′′+2t2v′+2t2v′+2tv−2tv=t3v′′+4t2v′=0.t^2(v''t + 2v') + 2t(v't + v) - 2vt = t^3v'' + 2t^2v' + 2t^2v' + 2tv - 2tv = t^3v'' + 4t^2v' = 0 .

The terms in vv cancel as they must. Divide by t2t^2 and set w=v′w = v': t w′+4w=0t\,w' + 4w = 0, so w′/w=−4/tw'/w = -4/t, w=Ct−4w = Ct^{-4} and v=−C3t−3+c2v = -\tfrac{C}{3}t^{-3} + c_2. Taking C=−3C = -3 and c2=0c_2 = 0 gives v=t−3v = t^{-3} and y2=t−2y_2 = t^{-2}. Check: y2′=−2t−3y_2' = -2t^{-3}, y2′′=6t−4y_2'' = 6t^{-4}, and t2⋅6t−4+2t(−2t−3)−2t−2=6t−2−4t−2−2t−2=0t^2\cdot 6t^{-4} + 2t(-2t^{-3}) - 2t^{-2} = 6t^{-2} - 4t^{-2} - 2t^{-2} = 0. Wronskian: W=t⋅(−2t−3)−1⋅t−2=−3t−2W = t\cdot(-2t^{-3}) - 1\cdot t^{-2} = -3t^{-2}. Abel: p=2/tp = 2/t, so exp⁡(−∫2/t)=t−2\exp(-\int 2/t) = t^{-2}, and W(1)=−3W(1) = -3 gives W=−3t−2W = -3t^{-2}. They agree.

✏️ Pen & paperA Wronskian without solving●●●

On t>0t > 0 the equation y′′+2ty′+q(t) y=0y'' + \tfrac{2}{t}y' + q(t)\,y = 0 has a fundamental set with W(1)=5W(1) = 5, where qq is continuous. (a) Find W(t)W(t) and W(2)W(2). (b) Write the equation as x⃗′=A(t)x⃗\vec x' = A(t)\vec x and give tr⁡A\operatorname{tr}A. (c) A student claims two solutions of this equation have W(0.5)=0W(0.5) = 0. Can that be true if they are independent?

Show worked solution

(a) p=2/tp = 2/t gives exp⁡(−∫1t2/s ds)=exp⁡(−2ln⁡t)=t−2\exp(-\int_1^t 2/s\,ds) = \exp(-2\ln t) = t^{-2}, so W(t)=5t−2W(t) = 5t^{-2} and W(2)=5/4=1.25W(2) = 5/4 = 1.25. The unknown qq never appeared.

(b) A=(01−q−2/t)A = \begin{pmatrix}0 & 1\\ -q & -2/t\end{pmatrix} and tr⁡A=−2/t\operatorname{tr}A = -2/t, so (det⁡X)′=−(2/t)det⁡X(\det X)' = -(2/t)\det X, the same equation as Abel’s.

(c) No. W(t)=5t−2W(t) = 5t^{-2} is positive on all of t>0t > 0, including t=0.5t = 0.5 where it is 2020. If two solutions had W(0.5)=0W(0.5) = 0, Abel would force W≡0W \equiv 0 on (0,∞)(0, \infty), so they would be dependent. The singular point t=0t = 0 is outside the interval, where p=2/tp = 2/t is continuous.

✅ Concept checkselect all that apply

y1 and y2 solve y'' + p y' + q y = 0 with q not identically zero. Select every function that must also be a solution.

Exercise: the system form, RK4 and a numerical Wronskian

Build the pipeline of this lesson. Implement an RK4 step for a vector state, turn (p,q)(p, q) into the system function for (y,y′)(y, y'), integrate, and finally compute the Wronskian at time TT from two numerically integrated solutions started at (1,0)(1, 0) and (0,1)(0, 1) at t0t_0. Abel says the answer is exp⁡(−∫t0Tp)\exp(-\int_{t_0}^T p) whatever qq is.

🧪 Coding exerciseExercise: RK4 on (y, y'), and the Wronskian at T
⌘/Ctrl + Enter

Key Takeaways

  • L[y]=y′′+py′+qyL[y] = y'' + py' + qy is a linear operator, so L[c1y1+c2y2]=c1L[y1]+c2L[y2]L[c_1y_1 + c_2y_2] = c_1L[y_1] + c_2L[y_2]: combinations of solutions of L[y]=0L[y] = 0 are solutions (superposition).
  • The solution set is the kernel of LL. Existence and uniqueness make y↦(y(t0),y′(t0))y \mapsto (y(t_0), y'(t_0)) a one-to-one onto linear map, so the kernel is 2-dimensional and a fundamental set is a basis of it.
  • The Wronskian W=y1y2′−y1′y2W = y_1y_2' - y_1'y_2 is the determinant of the matrix with columns (yi,yi′)(y_i, y_i'): the area of the parallelogram they span in the (y,y′)(y, y') plane. W(t0)≠0W(t_0) \neq 0 is exactly what lets you match any (y(t0),y′(t0))(y(t_0), y'(t_0)) by solving a 2×22\times2 system.
  • Abel’s theorem, W′=−pWW' = -pW, gives W(t)=W(t0)exp⁡(−∫p)W(t) = W(t_0)\exp(-\int p): the Wronskian of solutions is zero everywhere or nowhere, and it does not depend on qq.
  • Reduction of order: writing y2=vy1y_2 = vy_1 removes vv and leaves a first-order equation for v′v'; for y′′−2y′+y=0y'' - 2y' + y = 0 and y1=ety_1 = e^t it yields tette^t.
  • With state (y,y′)(y, y') the equation is x⃗′=A(t)x⃗\vec x' = A(t)\vec x and tr⁡A=−p\operatorname{tr}A = -p; any first-order solver, including RK4, applies, and det⁡X\det X should follow Abel’s formula.
  • Superposition and the Wronskian test need linearity, a zero right-hand side, and solutions of the same equation; y′′=y2y'' = y^2, y′′+y=1y'' + y = 1 and the pair t2,t∣t∣t^2, t|t| show each failure.
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: