Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Differential Equations

Turn a law of change into an equation and solve it: first and second order, oscillation and damping, and what a solution says about the system it describes.

Equations for a function

Almost every quantitative law in science says something about a rate of change rather than about a value, so the thing it pins down is a function and not a number.

Ernest Rutherford and Frederick Soddy found in 1902 that a radioactive sample loses atoms at a rate proportional to how many it still has. That sentence is not a formula for the number of atoms. It is a constraint linking the unknown function N(t) to its own derivative, dNdt=-kN, and the work of extracting N(t) from it is what this course is about. Newton's second law is the same kind of statement, one derivative further along: force is mass times acceleration, and acceleration is the second derivative of position, so every mechanical problem arrives as a constraint on x(t) and x′′(t) rather than as a recipe for x.

This lesson assumes the derivative rules and definite integration from the previous course, and nothing else. It sets up the vocabulary, then shows the one thing that can always be done to a differential equation even when it cannot be solved.

A law of change is an equation for a curve

A differential equation is an equation relating an unknown function to one or more of its derivatives. A solution is a function that satisfies it on some interval, and the word "some" is doing real work there, as the end of the lesson shows.

The distinction from ordinary algebra is worth making slowly, because it is where beginners lose their footing. Solving x2-5x+6=0 produces two numbers, 2 and 3, and checking them is arithmetic. Solving y=2y produces a family of functions, y=Ce2t for every constant C, and checking one is differentiation. The unknown lives in a space of functions, so the answer is a curve, or rather infinitely many curves, one through every point of the plane.

We restrict to ordinary differential equations, where the unknown depends on one variable, almost always time. If the unknown depends on several variables, the derivatives are partial and the equation is a partial differential equation: the heat equation and the wave equation are the standard examples, and they need machinery beyond this course. Everything here is one independent variable, which is enough for mechanics, circuits, chemical kinetics and population models.

Order, linearity, and why the labels stick

Two labels decide which method will work, so they are worth fixing before any method exists.

The order is the highest derivative that appears. dNdt=-kN is first order. The spring equation mx′′+cx+kx=0 is second order. Order is not a matter of taste: it counts how much information you must supply to select one solution out of the family, and it is why a projectile needs both a launch position and a launch velocity while a decaying sample needs only its starting mass.

An equation is linear if the unknown and its derivatives appear only to the first power, never multiplied together, and never inside a function like sin or a square root. The general linear equation of second order is

a2(t)y′′+a1(t)y+a0(t)y=g(t)

where the coefficients may be any functions of t at all. Linearity is a statement about how y enters, not about how t enters: y+t2y=cost is linear, and y=y2 is not. If g(t) is zero the linear equation is called homogeneous, and if not, the term g is the forcing.

Linear equations are the ones with a complete theory, because solutions can be added: if y1 and y2 both solve a homogeneous linear equation, so does y1+y2. Try that on y=y2. With y1=-1/t and y2=-1/(t+1), both genuine solutions, the sum satisfies nothing at all. Nonlinear equations lose superposition, and with it most of the algebra, which is why the second half of this course spends its effort on reading nonlinear solutions rather than writing them.

Verifying a solution

Checking a candidate needs no theory: differentiate it, substitute, and see whether the two sides agree for every t in the interval, not just at one point.

Example. Show that y=3e2t-2e-t solves y′′-y-2y=0, and find y(0) and y(0).

Differentiating, y=6e2t+2e-t and y′′=12e2t-2e-t. Substituting,

(12e2t-2e-t)-(6e2t+2e-t)-2(3e2t-2e-t)

The e2t terms give 12-6-6=0 and the e-t terms give -2-2+4=0, so the left side is identically zero and the candidate is a solution. At t=0, y(0)=3-2=1 and y(0)=6+2=8.

Now you. Show that y=C1e3t+C2e-2t solves y′′-y-6y=0 for every pair of constants, and find y(0) and y(0) in terms of C1 and C2.

Answer

y=3C1e3t-2C2e-2t and y′′=9C1e3t+4C2e-2t. The e3t coefficient is 9-3-6=0 and the e-2t coefficient is 4+2-6=0, so the equation holds for any C1 and C2. At t=0, y(0)=C1+C2 and y(0)=3C1-2C2.

Verification is cheap and solving is expensive, which is a lopsidedness worth exploiting. Guessing a form, substituting it, and letting the equation fix the constants is a legitimate and heavily used method, and it is exactly how the constant-coefficient theory later in this course is built.

Why solutions come in families

The simplest differential equation is y=f(t), whose solution is an antiderivative of f. There is never exactly one: antiderivatives differ by a constant, so the answer is a family y=F(t)+C, and that single arbitrary constant is the residue of everything the equation does not know. The equation constrains the slope at every instant and says nothing about where the curve starts.

That generalises. An equation of order n has a general solution carrying n arbitrary constants, and a particular solution is one member of the family with the constants fixed. The count matches the order because integrating n times introduces n constants, and it is the reason order is the first thing to identify.

To select a member you supply extra data. An initial value problem gives the value of the function and of its first n-1 derivatives at one instant t0. For a second order equation that is a position and a velocity, which is precisely the state Newtonian mechanics says determines a trajectory. Supplying data at two different instants instead, such as y(0)=0 and y(1)=0, makes it a boundary value problem, which behaves quite differently: such problems can have no solution or infinitely many, and this course stays with initial conditions.

Example. The general solution of y′′+4y=0 is y=Acos2t+Bsin2t, which you can check by substituting. Solve the initial value problem with y(0)=3 and y(0)=8, and give the amplitude of the resulting oscillation.

Setting t=0 in y gives y(0)=A=3. Differentiating, y=-2Asin2t+2Bcos2t, so y(0)=2B=8 and B=4. The particular solution is y=3cos2t+4sin2t. Combining the two terms into a single sinusoid gives amplitude A2+B2=9+16=5, so the motion runs between -5 and 5.

Now you. For the same equation, solve the initial value problem with y(0)=-2 and y(0)=12, and give the amplitude.

Answer

A=-2, and y(0)=2B=12 gives B=6. So y=-2cos2t+6sin2t, with amplitude 4+36=40=6.32.

Building the equation from the words

Most of the difficulty in applying this subject is not solving the equation but writing it down, and writing it down is always the same move: express the rate of change of the quantity as the sum of everything adding to it minus everything removing it.

Take the decay law. In one year a radiocarbon sample loses a fixed fraction of whatever it has, so dNdt=-kN, and the constant is fixed by the measured half-life of 5730 years for carbon-14. Setting N=N0/2 in the solution N=N0e-kt gives k=ln2/5730=1.210×10-4 per year. That number then dates anything organic: a sample holding 78 per cent of its original carbon-14 has been dead for ln(1/0.78)/k=2054 years.

Take a falling body with air resistance. Gravity pulls down with force mg, drag opposes motion with a force that at everyday speeds is close to proportional to v2, and Newton's law assembles them into

mdvdt=mg-bv2

first order, nonlinear because of the square, and already interesting before it is solved: whenever bv2 reaches mg the derivative vanishes and the speed stops changing. That terminal speed is mg/b, read off the equation itself without any solving. A skydiver in a spread posture has m/b near 300 m, giving 300×9.81=54 m s⁻¹, or about 195 km h⁻¹, which is the figure the sport quotes.

Take a mixing tank. Brine at cin kilograms per cubic metre enters at q cubic metres per minute, the tank holds V cubic metres and is stirred so its concentration is uniform, and the outflow matches the inflow. The salt mass S changes at the rate it enters minus the rate it leaves, dSdt=qcin-qVS: first order and linear, and the model for every stirred reservoir from a chemical reactor to a lake.

Direction fields: the family without the formula

Here is the move that makes an unsolvable equation useful. A first order equation y=f(t,y) hands you the slope of the solution at every point of the plane before you know any solution. Draw a short segment of that slope at each of a grid of points and you have a direction field: solutions are exactly the curves that stay tangent to it everywhere, and the eye assembles them from the picture.

Consider y=t-y. At the point t=1, y=2 the slope is 1-2=-1. On the line y=t every slope is zero, so solutions crossing that line do so horizontally. Above it slopes are negative and below it positive, so every solution is pushed towards the line from both sides. The line itself is nearly a solution: trying y=t-1 gives y=1 and t-y=1, so it is a solution exactly. The picture says that whatever a solution does early on, it ends up hugging y=t-1, and this is right: the general solution turns out to be y=t-1+Ce-t, and the Ce-t term dies.

A curve on which the slope takes one fixed value is an isocline, and sketching a few is the fast way to draw a field by hand. For y=t-y the isoclines are the straight lines t-y=m, one per slope m.

Example. For y=y(1-y), find the slope at y=0.5, at y=2 and at y=1, and say what a solution starting at y(0)=0.5 does.

The slopes are 0.5×0.5=0.25, then 2×(1-2)=-2, then exactly 0. Since f does not involve t, the slope depends only on the height, so each horizontal line carries a single slope. The lines y=0 and y=1 carry slope zero and are constant solutions. Between them the slope is positive, so a solution starting at 0.5 rises, and since it can never cross the constant solution at y=1, it approaches 1 from below without reaching it. Above y=1 slopes are negative, so those solutions fall to 1 as well.

Now you. For y=2-y, give the slope at y=0, y=2 and y=5, and say what happens to a solution starting at y(0)=5.

Answer

The slopes are 2, 0 and -3. The constant solution is y=2, and a solution starting at 5 has negative slope, so it falls, slowing as it goes, and approaches 2 from above without crossing it.

What is actually solvable

An honest course says early what its methods will not reach. Almost every differential equation you can write down has no solution expressible in elementary functions. y=t2+y2 is about as simple as an equation gets, and its solutions require Bessel functions; y=e-t2+y pulls in the error function immediately. This is not a gap in the textbooks. It is the same fact as most integrals having no elementary antiderivative, since integration is the special case y=f(t).

So the subject has three tools rather than one, and they will be used throughout. Exact solution, where a formula exists and is worth having. Qualitative analysis, which reads the long-term behaviour off the equation itself, as the terminal speed and the direction field did above. Numerical solution, which produces a table of values to whatever accuracy is paid for. A good answer often uses all three: the numerics give the curve, the qualitative argument says the curve is believable, and the exact solution of a simplified version says what controls it.

Solutions also have limited lifetimes. y=y2 with y(0)=1 has the solution y=1/(1-t), which is perfectly well behaved near t=0 and infinite at t=1, even though the equation itself shows no sign of trouble there. A differential equation is a local statement, and asking where its solutions stop existing is a real question, taken up in a later lesson.

The next step is the first class of equations that yields completely. When the right side factors into a function of t times a function of y, the variables can be separated and both sides integrated, which turns the decay law, the cooling law and the logistic curve into three lines of calculus each.

Separable equations

The previous lesson could draw the family of solutions to a first order equation without solving it, and this one solves a genuine class of them outright.

The class is narrow but it contains most of the standard models: radioactive decay, drug clearance, cooling, dissolution, and population growth against a limit. What they share is that the rate of change factors, with everything depending on time in one bracket and everything depending on the unknown in another. When that happens, calculus alone finishes the job.

The factoring that makes integration possible

An equation is separable if it can be written

dydt=g(t)h(y)

The method is to divide by h(y), multiply by dt, and integrate both sides. That description is a mnemonic rather than an argument, since dt is not a quantity to be multiplied by, so here is the argument. Divide by h(y) to get

1h(y)dydt=g(t)

and integrate both sides with respect to t. On the right that gives g(t)dt. On the left, the integrand is exactly of the form F(y)y with F an antiderivative of 1/h, so the chain rule identifies it as the derivative of F(y(t)), and by substitution 1h(y)dydtdt=dyh(y). So

dyh(y)=g(t)dt+C

which is the mnemonic, now justified. Only one constant is needed, since the two would merge. What comes out is a relation between y and t, not necessarily a formula for y, and that distinction matters below.

Example. Solve dydt=ty with y(0)=3.

Separating, dyy=tdt, so ln|y|=12t2+C and |y|=eCet2/2. Absorbing the sign and the exponential of the constant into one constant A, the general solution is y=Aet2/2. The initial condition gives A=3, so y=3et2/2. Checking: y=3tet2/2=ty, as required.

Now you. Solve dydt=ycost with y(0)=2.

Answer

dyy=costdt gives ln|y|=sint+C, so y=Aesint and A=2. The solution is y=2esint, which oscillates between 2e-1=0.736 and 2e=5.44.

The solutions that division destroys

Dividing by h(y) is only legal where h(y) is not zero, and every root of h is a constant solution that the method throws away. If h(y0)=0 then the constant function yy0 has zero derivative and satisfies the equation exactly, yet it can never appear in the family produced by separating, because the very first step divided by zero to get there.

For y=y(1-y) the roots are y=0 and y=1, and both are genuine solutions that must be added back by hand. Sometimes the lost solution reappears as a limiting case of the constant: for y=ky the family y=Aekt includes y0 at A=0, even though the derivation assumed y0. Sometimes it does not, and then the general solution is genuinely incomplete without it. Check the roots of h every time; it costs one line and it is the standard way to lose half an answer.

Decay, growth and half-lives

The equation dydt=ky says the rate of change is proportional to the amount present, and separating gives y=y0ekt. Negative k is decay, positive is unconstrained growth. What makes the model useful is that k is rarely quoted directly: what is measured is a half-life t1/2, the time for the amount to halve, and setting y=y0/2 gives ekt1/2=12, so k=-ln2/t1/2.

Caffeine leaves the bloodstream by first order kinetics with a half-life near 5 hours in a typical adult. So k=-ln2/5=-0.1386 per hour, and a 200 mg dose falls to 95 mg after t=ln(200/95)/0.1386=5.4 hours. The same arithmetic dates a bone from its carbon-14, sizes a shielding delay from a reactor isotope, and sets the dosing interval of a drug. The characteristic quantity is 1/|k|, the time constant, after which the amount has fallen by a factor of e; a half-life is ln2=0.693 time constants.

The honest limit is that pure exponential growth is a statement about a system with unlimited resources, and no real population has those. It is the first term of a better model, not the model.

Newton's law of cooling, fitted to a real mug

A body at temperature T in surroundings at Ts loses heat at a rate roughly proportional to the excess temperature, which gives

dTdt=-k(T-Ts)

Separating with u=T-Ts, which has the same derivative as T since Ts is constant, gives u=u0e-kt, so

T(t)=Ts+(T0-Ts)e-kt

Every cooling curve is the same shape: the excess over ambient decays exponentially, and the temperature approaches the room's, never crossing it.

Example. Coffee at 90 °C stands in a room at 20 °C. After 5 minutes it reads 70 °C. When will it reach 45 °C?

The excess starts at 70 degrees and is 50 degrees after five minutes, so 50=70e-5k and k=15ln(70/50)=0.0673 per minute. Drinking temperature at 45 °C is an excess of 25 degrees, so 25=70e-kt and t=ln(70/25)/0.0673=15.3 minutes. As a check, the prediction at ten minutes is 20+70e-0.673=55.7 °C, which is the same fall of 70 to 50 per cent applied twice.

Now you. Soup at 95 °C sits in a room at 22 °C and is at 65 °C after 10 minutes. When does it reach 40 °C?

Answer

The excess falls from 73 to 43 in ten minutes, so k=110ln(73/43)=0.0529 per minute. For an excess of 18 degrees, t=ln(73/18)/0.0529=26.5 minutes.

The law is an approximation, valid when the excess temperature is small enough that radiation, which goes as the fourth power of absolute temperature, is not dominant, and when the body is well stirred or thin enough to have one temperature at all. For a mug of coffee at kitchen temperatures both hold well enough that the fit above is good to a degree or so over half an hour.

Implicit solutions and the interval they live on

Separation produces a relation, and there is no guarantee that the relation can be solved for y. Take dydt=-ty with y(0)=3. Separating gives ydy=-tdt, so 12y2=-12t2+C and

t2+y2=9

a circle. That is a perfectly good implicit solution, and it says more clearly than any formula what the solutions look like. Made explicit, y=9-t2, taking the positive root because y(0)=3, and now the trouble is visible: the solution exists only for -3<t<3. At the ends the circle has a vertical tangent, the derivative is infinite, and the solution simply stops. Nothing in the original equation announced the number 3; it came from the initial condition. The interval of existence of a solution can depend on where the solution starts, which never happens for the linear equations of the next lesson.

Some separable equations lead to integrals that need the techniques of the previous course. dydt=y2-12 separates to 2dy(y-1)(y+1)=dt, a partial fractions problem, and others lead to integrals with no elementary form at all, at which point separation has converted a differential equation into a definite integral to be done numerically. That is still progress.

The logistic equation

Exponential growth fails because it ignores the resource limit. Model the limit in the crudest way that could work: let the per-capita growth rate fall linearly to zero as the population P approaches a carrying capacity K. The per-capita rate is 1PdPdt, so the assumption is 1PdPdt=r(1-PK), giving the logistic equation

dPdt=rP(1-PK)

published by Pierre-François Verhulst in 1838. It is separable and nonlinear. Separating and using partial fractions on 1P(1-P/K)=1P+1/K1-P/K gives lnP-ln(1-P/K)=rt+C, so P1-P/K=Aert, and solving for P,

P(t)=K1+(KP0-1)e-rt

The behaviour is the S-curve: growth is nearly exponential at rate r while PK, slows as the bracket shrinks, and levels off at K. The steepest point is where dPdt is largest, and since that is a downward parabola in P with roots at 0 and K, the maximum is at P=K/2, exactly half the capacity, at which the growth rate is rK/4.

Example. A lake is stocked with 100 fish. The population grows logistically with r=0.03 per year and K=1000. When does it reach 500?

Half capacity is reached when the denominator is 2, that is when (1000100-1)e-rt=1, so 9e-0.03t=1 and t=ln9/0.03=73.2 years. That is also the moment of fastest growth, at rK/4=7.5 fish per year.

Now you. A population starts at 50 with r=0.05 per year and K=800. When does it reach 400?

Answer

(80050-1)e-0.05t=1 gives 15e-0.05t=1 and t=ln15/0.05=54.2 years.

Raymond Pearl and Lowell Reed fitted a logistic to the United States census in 1920 and obtained K=197.3 million, r=0.0313 per year, and half capacity in 1914. Against the census the fit is remarkable: it predicts 77.3 million for 1900 against a measured 76.2, and 107.9 million for 1920 against 106.0. It is also wrong in the way models of this sort are always wrong. The United States passed 197 million in 1967 and kept going, because immigration and changing fertility are not in the model, and by 2020 the fit predicts 190 million against an actual 331. A logistic fit measures the growth pattern of the period it was fitted to, and its extrapolated K is a summary of that period rather than a property of the country.

Where separation runs out

Separation needs the right side to factor, and most equations do not. Consider a stirred tank whose inflow concentration varies during the day, or a capacitor charged from a mains supply. Both give equations of the shape

dydt+p(t)y=g(t)

with g not constant, and there is no way to write g(t)-p(t)y as a product of a function of t and a function of y. Even the simplest instance, y=t+y, resists. Yet these equations are linear, which the logistic equation is not, and linear equations are supposed to be the easy ones.

They are, once the right trick is found. The next lesson finds it by asking what could be multiplied through the equation to make the left side the derivative of a single product, and the answer solves every first order linear equation there is.

Linear equations and the integrating factor

Separation failed on equations as simple as y=t+y, and those are exactly the equations that describe a system being driven from outside.

A first order linear equation is one where the unknown and its derivative appear only to the first power and never multiplied together, so it can always be arranged as

dydt+p(t)y=g(t)

with p the coefficient and g the forcing. Separation needs the right side to factor as a function of t times a function of y, and g(t)-p(t)y does not factor unless g is constant or zero. This lesson finds the method that does work, and it works for every equation of this shape, whatever p and g are.

What we would like the left side to be

The whole difficulty is that y+py is a sum of two unrelated-looking things. If instead the left side were the derivative of a single product, the equation could be integrated on sight, because the fundamental theorem would undo it in one step.

So demand it. Multiply the whole equation by an as-yet-unknown positive function μ(t):

μy+μpy=μg

and ask what μ would make the left side exactly (μy). By the product rule (μy)=μy+μy, so the two agree for all y precisely when

μ=pμ

That is a separable equation for μ, and we can already solve it: μ=epdt. No constant of integration is needed, since any constant multiple of μ works equally well and would cancel later. This μ is the integrating factor, and it exists for every p that can be integrated at all.

With it, the equation reads (μy)=μg, so integrating both sides,

y=1μ(t)(μ(t)g(t)dt+C)

That formula solves the entire class. It is worth remembering the derivation rather than the formula, because in practice you compute μ, write the left side as a derivative, and integrate, which is less error-prone than substituting into a memorised expression.

Notice what has happened structurally. The single constant C enters the answer multiplied by 1/μ=e-pdt, and everything else comes from the forcing. Every first order linear equation therefore has a solution of the form "one particular response to the forcing, plus a constant times a decaying (or growing) function that remembers the initial condition". That split runs through the rest of the course.

Example. Solve ty+2y=4t2 with y(1)=2, for t>0.

First put it in standard form by dividing by t: y+2ty=4t. Then pdt=2tdt=2lnt, so μ=e2lnt=t2. Multiplying through,

t2y+2ty=4t3,that is(t2y)=4t3

Integrating, t2y=t4+C, so y=t2+C/t2. The condition y(1)=2 gives 1+C=2, so C=1 and y=t2+1/t2. At t=2 that is 4.25. Checking the original equation at any t is a two-line differentiation, and it holds.

Now you. Solve y-yt=t with y(1)=3, for t>0.

Answer

Here p=-1/t, so pdt=-lnt and μ=1/t. The equation becomes (y/t)=1, so y/t=t+C and y=t2+Ct. Then y(1)=1+C=3 gives C=2, so y=t2+2t.

Transient and steady state

Take the commonest case, constant p=1/τ and constant forcing g. The integrating factor is et/τ, and the solution is

y=gτ+(y0-gτ)e-t/τ

Two pieces, with quite different characters. The constant gτ is the steady state: it is what the equation settles to, and it depends only on the forcing and the coefficient, not on where the system started. The exponential is the transient: it carries the whole memory of the initial condition and decays with time constant τ, reaching 1/e of its starting size after τ, and under one per cent after 5τ.

This is why identical devices with different histories end up behaving identically, and why the time constant, rather than the initial condition, is what an engineer quotes. It also explains the earlier direction field for y=t-y, whose solutions all approached the line y=t-1: that line is the response to the forcing g(t)=t, and the Ce-t that distinguishes one solution from another is the transient.

Charging a capacitor

A resistor R in series with a capacitor C across a source V obeys Kirchhoff's voltage law: the source equals the drop across the resistor plus the voltage on the capacitor. With i=Cdvdt the current through both,

RCdvdt+v=V

which is the standard form with τ=RC. Its solution from v(0)=0 is v=V(1-e-t/τ).

Example. A 10 kΩ resistor charges a 100 μF capacitor from a 12 V supply. How long until the capacitor reads 10 V, and what is its voltage after one time constant?

The time constant is τ=104×10-4=1.0 s. Setting v=10, 1-e-t/τ=10/12, so e-t/τ=1/6 and t=τln6=1.79 s. After one time constant the capacitor holds 12(1-e-1)=12×0.632=7.58 V, which is the origin of the 63 per cent rule quoted in electronics.

Now you. A 4.7 kΩ resistor charges a 220 μF capacitor from a 9 V supply. Find the time constant and the time to reach 5 V.

Answer

τ=4700×2.2×10-4=1.034 s. Then e-t/τ=1-5/9=4/9, so t=1.034ln(9/4)=0.84 s.

The stirred tank

The same equation with different names governs any well-mixed reservoir. A tank holds V litres, brine of concentration cin enters at q litres per minute, and the mixture leaves at the same rate, so the volume stays fixed. The salt mass S obeys

dSdt=qcin-qVS

The removal term is the crucial modelling step: the outflow carries the tank's own concentration S/V, which is what makes the equation linear in S rather than merely an accounting identity. The time constant is V/q, the time to pass one tankful through, and the steady state is S=Vcin, at which the tank has simply reached the inflow concentration.

Example. A 1000 litre tank starts full of pure water. Brine at 0.03 kg per litre enters at 20 litres per minute and the mixture leaves at 20 litres per minute. When does the tank hold 20 kg of salt?

The time constant is 1000/20=50 minutes and the steady state is 1000×0.03=30 kg, so S=30(1-e-t/50). Setting S=20 gives e-t/50=1/3 and t=50ln3=54.9 minutes. The tank never actually reaches 30 kg, and asking for 30 would give an infinite answer, which is the correct answer to a badly posed question.

Now you. A 500 litre tank starts with 5 kg of salt dissolved in it. Brine at 0.04 kg per litre enters at 10 litres per minute and leaves at the same rate. When does the tank hold 12 kg?

Answer

The time constant is 500/10=50 minutes and the steady state is 500×0.04=20 kg, so S=20-15e-t/50. Setting S=12 gives e-t/50=8/15 and t=50ln(15/8)=31.4 minutes.

If the outflow rate differs from the inflow, the volume changes with time, V(t)=V0+(qin-qout)t, and the coefficient qout/V(t) becomes a function of t. The equation is still linear, the integrating factor still exists, and it is now a power of V(t) rather than an exponential. Nothing about the method changes, which is the advantage of having derived it in general.

Forcing that does not settle

Steady state was easy because the forcing was constant. Drive the same circuit with a sinusoid, RCv+v=V0sinωt, and the integrating factor still works: multiply by et/τ, integrate et/τsinωtdt by parts twice, and after the transient dies the surviving part of the answer is

v=V01+(ωτ)2sin(ωt-φ),tanφ=ωτ

The output is a sinusoid at the same frequency, smaller and late. How much smaller depends on ωτ: with τ=1 s and a 0.5 Hz drive, ωτ=π, the amplitude is cut to 1/1+π2=0.303 of the input, and the lag is arctanπ=72.3 degrees. Slow signals pass and fast ones are attenuated, which is what makes this circuit a low-pass filter, and the frequency at which the amplitude falls to 1/2 is exactly ω=1/τ.

Nothing about that calculation is specific to circuits. Any linear system driven at one frequency responds at that frequency, with an amplitude and a phase that depend on the frequency, and the whole content of the system's behaviour under periodic driving is those two functions. That is the frequency response, and it returns in force when the equations become second order and the amplitude curve grows a peak.

Equations that become linear

Some nonlinear equations are linear in disguise. A Bernoulli equation has the form y+p(t)y=q(t)yn, and substituting v=y1-n turns it linear: v=(1-n)y-ny, and multiplying the original equation by (1-n)y-n gives v+(1-n)pv=(1-n)q.

The logistic equation is the case n=2. Written as P-rP=-rKP2, the substitution v=1/P gives v+rv=r/K, whose integrating factor is ert and whose solution is v=1K+Ae-rt. Inverting recovers the logistic curve of the previous lesson without any partial fractions. This is a real technique rather than a curiosity: recognising that a change of variable linearises an equation is often the difference between a closed form and a numerical solution.

What is now settled, and what is not

Every first order linear equation is solved, at least down to an integral. That is a complete theory for a class that includes charging circuits, stirred tanks, first order chemical kinetics, and linear drag. Solutions of linear equations also exist as long as p and g do, with none of the sudden endings that the circle solution had in the previous lesson.

Nonlinear first order equations have no such theory. The logistic yielded to a substitution, and y=t2+y2 yields to nothing. So two questions are now pressing, and the next lesson takes both. Does a solution exist at all when no method applies, and is it unique? And if it exists but has no formula, how do you get numbers out of it?

Existence, uniqueness and stepping forward

Two lessons of methods have solved every separable and every first order linear equation, and almost nothing else, so the natural next question is what can be said about an equation that no method touches.

There are two questions, and they are independent. Does the initial value problem y=f(t,y), y(t0)=y0 have a solution at all? And if it has one, does it have only one? Both matter practically. If a model has two solutions from the same starting state, the model is not determining the future, whatever the physics claimed. If a solution stops existing at some finite time, a computer will happily keep printing numbers past that point, and they will be nonsense.

Picard's theorem

The result is due to Émile Picard and Ernst Lindelöf in the 1890s, and its statement is short. Suppose f(t,y) is continuous in a rectangle around the point (t0,y0), and suppose f/y is continuous there too. Then the initial value problem has exactly one solution, defined on some interval around t0.

Three things about that statement are worth pressing on.

Continuity of f alone gives existence. That is Peano's theorem, and it is genuinely weaker: it gives a solution but permits several.

Uniqueness needs the extra condition on f/y, and what is really required is a Lipschitz condition, that |f(t,y1)-f(t,y2)|L|y1-y2| for some constant L. A bounded f/y supplies one by the mean value theorem, which is why the derivative version is the one quoted. The condition says the equation's right side cannot respond infinitely fast to a change in y.

The conclusion is local. There is an interval, and the theorem does not say how long it is. That is not slackness in the proof; solutions really do end, as the third section shows.

Example. Does y=y2+t2 with y(0)=1 have exactly one solution near t=0?

Here f=y2+t2 is continuous everywhere and f/y=2y is continuous everywhere, so both hypotheses hold in any rectangle around (0,1). There is exactly one solution on some interval around zero. The theorem promises nothing beyond that interval, and in this case the promise would be false if it did: this solution blows up before t=1.

Now you. Consider y=y with y(0)=0, restricted to y0. Which hypothesis holds and which fails?

Answer

f=y is continuous, so a solution exists. But f/y=1/(2y) is unbounded as y0, so the Lipschitz condition fails exactly at the initial point and uniqueness is not guaranteed.

The bucket that cannot say when it started draining

That second example is not a technicality. Solve it: separating, y-1/2dy=dt gives 2y=t+C, so y=(t+C)2/4. With y(0)=0 that is y=t2/4. But y0 is also a solution, the constant one that separation discarded. And so is every function that sits at zero until some time a and then leaves along y=(t-a)2/4: it is differentiable at the join, since both pieces have slope zero there, and it satisfies the equation on both sides. There are infinitely many solutions through the origin.

The physical version is a leaking tank. Torricelli's law says water drains from a hole at a rate proportional to the square root of the depth, so h=-ch, which is the same equation with the sign reversed. Run it forwards and the tank empties at a definite time and stays empty. Run the film backwards and ask when a currently empty tank was full: the equation cannot say. Every emptying time is consistent with what you see now. Non-uniqueness here is a real property of the model, and it happens precisely because the rate becomes insensitive to the state, with infinite slope in h, as the depth reaches zero.

Linear equations never do this. For y+p(t)y=g(t) the right side is g-py, whose y-derivative is -p(t), continuous wherever the coefficients are. So a linear initial value problem has exactly one solution on the whole interval where p and g are continuous, with no local hedge. That is the real reward for linearity.

Blow-up in finite time

The other failure is more common in practice. Take y=y2 with y(0)=y0>0. Separating, -1/y=t+C, so

y=y01-y0t

which is finite and smooth up to t=1/y0 and infinite there. Nothing in the equation is singular at that time; the coefficient functions are polynomials. The solution manufactures its own catastrophe by growing fast enough to feed its own growth, and where the catastrophe happens depends on the initial condition.

Example. For y=y2 with y(0)=0.5, when does the solution cease to exist, and what is y at t=1?

The formula gives y=0.5/(1-0.5t)=1/(2-t), which is infinite at t=2. At t=1, y=1. Halving the starting value doubled the survival time.

Now you. For y=y2 with y(0)=4, when does the solution cease to exist, and what is y at t=0.2?

Answer

y=4/(1-4t)=1/(0.25-t), so it blows up at t=0.25. At t=0.2, y=1/0.05=20.

The same happens without separability. y=1+y2 with y(0)=0 has solution y=tant, which ends at t=π/2=1.571. A superlinear right side is the warning sign, and physical models that produce one, such as thermal runaway or an autocatalytic reaction, are describing systems that genuinely go somewhere the model stops being valid.

Picard's iteration, which is also the proof

The theorem is proved constructively, and the construction is worth seeing because it turns the differential equation into something a computer could run. Integrate both sides of y=f(t,y) from t0 and use the initial condition:

y(t)=y0+t0tf(s,y(s))ds

This integral equation is equivalent to the initial value problem, and it has y on both sides, which invites iteration. Start with the constant guess y0(t)=y0 and define each next approximation by substituting the previous one into the right side.

For y=y with y(0)=1 the iterates are immediate. From y0=1, the first is 1+0t1ds=1+t. The next is 1+0t(1+s)ds=1+t+t2/2. The next adds t3/6. The iterates are the partial sums of the Taylor series of et, converging to it, which is the right answer. The Lipschitz condition is exactly what makes each iteration shrink the error by a fixed factor, so the sequence converges, and it is what fails for y.

Picard iteration is rarely used for computation, since each step needs a symbolic integral. What is used is a cruder relative of the same idea.

Euler's method

Leonhard Euler's method, from 1768, is the tangent line taken seriously. At (tn,yn) the equation gives the slope f(tn,yn) directly, so follow it for a small step h:

yn+1=yn+hf(tn,yn),tn+1=tn+h

and repeat. No solving is involved at any point, and the method needs nothing from f except the ability to evaluate it.

Example. Take y=t+y with y(0)=1 and h=0.1. Do two steps, and compare with the exact solution y=2et-t-1.

The first step uses the slope at (0,1), which is 0+1=1, giving y1=1+0.1×1=1.1 at t=0.1. The second uses the slope at (0.1,1.1), which is 1.2, giving y2=1.1+0.1×1.2=1.22 at t=0.2. The exact value is 2e0.2-1.2=1.2428, so two steps have accumulated an error of 0.023, about 1.8 per cent, and it is an underestimate because the solution is convex and the tangent lines all lie below it.

Now you. Take y=y-t2 with y(0)=1 and h=0.1, and do two steps. The exact value at t=0.2 is 1.2186.

Answer

Slope at (0,1) is 1, so y1=1.1. Slope at (0.1,1.1) is 1.1-0.01=1.09, so y2=1.1+0.109=1.209. The error is 0.0096.

How wrong is it in general? One step's error is the remainder of a Taylor expansion truncated after the linear term, so it is proportional to h2. But reaching a fixed time takes 1/h steps, so the errors accumulate to something proportional to h. Euler's method is first order: halve the step and you halve the error.

That is easy to see numerically. Integrating y=y from y(0)=1 to t=1, where the exact answer is e=2.71828, Euler with h=0.25 gives 1.254=2.4414, an error of 0.277. With h=0.125 it gives 2.5658, error 0.153. With h=0.0625, error 0.080. Each halving of the step cuts the error by a factor approaching two, exactly as the analysis says. To get three decimal places this way needs tens of thousands of steps.

Runge-Kutta, and why it is worth the extra evaluations

Euler uses the slope at the start of the interval to cross the whole interval, which is systematically wrong whenever the slope changes. The improvements all sample the slope more than once.

The improved Euler or Heun method takes a trial Euler step, evaluates the slope at the far end, and steps with the average of the two slopes. The trial step costs one extra evaluation of f and buys an order: the error goes as h2. On the same test problem it gives 2.6949 at h=0.25, error 0.0234, and 2.7118 at h=0.125, error 0.0064. The ratio is close to four, as second order predicts.

The classical fourth order Runge-Kutta method, published by Wilhelm Kutta in 1901, samples four slopes per step: one at the start, two at the midpoint, one at the end, and combines them with weights 1,2,2,1 over 6. Its error goes as h4. On the same problem with h=0.25, four steps and sixteen evaluations of f give 2.718210, an error of 7×10-5; at h=0.125 the error is 5×10-6. Euler would need around twenty thousand steps to match the first of those. This is why almost every general purpose solver is a Runge-Kutta method or a relative, usually with the step size adjusted automatically by comparing two estimates of different order.

Where the numbers lie

A numerical solution is a sequence of numbers, and numbers always appear, whether or not a solution exists.

Run a solver on y=y2 with y(0)=1 past t=1 and it will keep producing values. They are meaningless: the solution ceased to exist at t=1. A solver that suddenly needs tiny steps to keep its error estimate down is usually reporting a blow-up rather than a difficulty of its own, and the correct response is to ask what the model is doing, not to lower the tolerance.

The second trap is stiffness. Consider y=-1000(y-cost). Its solution settles onto something close to cost within about three milliseconds and then varies on a timescale of seconds, so a step size of a hundredth of a second should be ample for accuracy. It is catastrophic for stability: Euler's method applied to y=λy multiplies the error by |1+hλ| each step, which exceeds one unless h<2/1000. Take a larger step and the computed solution oscillates with growing amplitude and diverges, while the true solution sits quietly on a cosine. Stiff problems, which are the norm in chemical kinetics and circuit simulation, need implicit methods that solve for yn+1 rather than stepping to it.

The third is more mundane: halving the step doubles the number of arithmetic operations, so rounding error accumulates as the truncation error falls, and below some step size the total error starts to rise again.

None of this means numerics is second best. It means a number from a solver is a claim that needs the same scepticism as any other measurement, and the way to check it is to halve the step and see whether the answer moves by what the method's order predicts.

The tools so far give a formula when one exists and a table when it does not. Neither says anything about a solution's shape without computing it. The next lesson shows that for a large class of equations, the long-term behaviour can be read straight off the right side, with no solving and no stepping at all.

Autonomous equations and stability

An equation can be worth understanding even when its solution formula would be useless, and a large class can be understood without producing one at all.

The class is the autonomous equations, those of the form y=f(y) with no explicit t on the right. The logistic equation is autonomous, Newton's cooling law is autonomous, a falling body with drag is autonomous. What they share is that the rule for how the system changes is the same at every instant: only the current state matters, which is what a law of nature usually looks like once the external drivers are absent.

That single property is enough to determine every solution's long-term behaviour from the graph of f, with no integration.

Slopes that depend only on height

In the direction field of y=f(y), the slope at a point depends on y alone, so every horizontal line carries one slope repeated across the page. Two consequences follow immediately.

Solutions are translates of one another. If y(t) solves the equation then so does y(t-a) for any a, because shifting the graph sideways does not change which height sits above which slope. So the whole family is one curve slid along the time axis, and the initial condition chooses the slide, not the shape.

Solutions are monotone. Between two consecutive roots of f the sign of f cannot change, since f is continuous, so y keeps its sign and y moves steadily one way. An autonomous first order equation cannot oscillate. That is a strong structural statement, and it is the reason this lesson ends by needing second order equations.

The phase line

Collapse the picture. Draw the y axis alone, mark the roots of f, and on each interval between them put an arrow pointing up where f>0 and down where f<0. That is the phase line, and it contains everything about the long-run behaviour.

The roots are the equilibria, also called critical points or fixed points: if f(y*)=0 then the constant function yy* is a solution, and the system placed exactly there never moves. Every other solution moves along the arrow it starts on and either approaches the equilibrium at the far end or leaves towards infinity. It cannot pass an equilibrium, because that would require two solutions to cross at a point, which uniqueness forbids.

Three kinds of equilibrium exist. An equilibrium with arrows pointing towards it from both sides is stable, or a sink: small disturbances die. With arrows pointing away on both sides it is unstable, or a source: any disturbance grows. With one arrow in and one out it is semi-stable, attracting from one side and repelling on the other.

For the logistic equation P=rP(1-P/K) the roots are P=0 and P=K. Between them f>0 and above K it is negative, so 0 is unstable and K is stable. That is the S-curve of the earlier lesson, read off in two lines instead of derived by partial fractions, and it also says what the formula did not make obvious: a population starting above K falls to it, and no population ever crosses K.

Example. Sketch the phase line for y=y2-4 and describe the fate of solutions starting at y=-3, y=0 and y=3.

The roots are y=±2. For y<-2, f=y2-4>0, so the arrow points up. For -2<y<2 it is negative, arrow down. For y>2 it is positive again, arrow up. So y=-2 has arrows pointing in from both sides and is stable, while y=2 has arrows pointing away and is unstable. A solution from y=-3 rises to -2. One from y=0 falls to -2. One from y=3 increases without bound, and in fact blows up in finite time, since the growth is quadratic.

Now you. Do the same for y=y3-y, classifying each of the three equilibria.

Answer

The roots are y=-1,0,1. The sign of y(y-1)(y+1) is negative below -1, positive on (-1,0), negative on (0,1) and positive above 1. So the arrows point away from -1 and away from 1, making both unstable, and towards 0 from both sides, making it stable.

The linearisation test

Reading signs off a graph is reliable but slow, and there is a one-line test. Put u=y-y*, the displacement from an equilibrium, and expand f in a Taylor series about y*. Since f(y*)=0,

u=f(y*+u)=f(y*)u+12f′′(y*)u2+

For small u the first term dominates, so uf(y*)u, whose solution is u=u0ef(y*)t. The conclusion writes itself. If f(y*)<0 the disturbance decays and the equilibrium is stable. If f(y*)>0 it grows and the equilibrium is unstable. If f(y*)=0 the linear term is absent and the test says nothing: y=y2 has a semi-stable equilibrium at zero, y=-y3 a stable one, y=y3 an unstable one, and all three have f=0 there.

The number f(y*) is more than a sign. Its reciprocal is the time constant of the approach: near a stable equilibrium the gap closes by a factor of e every 1/|f(y*)| units of time. For the logistic near P=K, f(P)=r-2rP/K, so f(K)=-r and a population settles towards its capacity with time constant 1/r, whatever the capacity is. With r=0.03 per year that is 33 years to close 63 per cent of the gap and ln(10)/0.03=77 years to close 90 per cent of it. Recovery is slow in a way the carrying capacity alone never tells you.

Terminal velocity read off the equation

A body falling with quadratic drag obeys v=g-bmv2, autonomous and nonlinear. The equilibrium is where drag balances weight, vT=mg/b, and it is stable because f(v)=-2(b/m)v is negative there. No solving is needed to know that every skydiver approaches the same speed regardless of how they left the aircraft.

Example. A skydiver in a spread posture has m/b=300 m. Find the terminal speed and the time constant of the approach to it.

The terminal speed is 300×9.81=54.2 m s⁻¹. The derivative there is f(vT)=-2vT/300=-0.362 s⁻¹, so the time constant is 1/0.362=2.8 s. A useful way to remember it is vT/2g, which is the time gravity alone would take to reach half the terminal speed. The time constant describes the final approach rather than the whole fall: the exact solution from rest is v=vTtanh(gt/vT), which reaches 95 per cent of terminal after 10.1 s and about 350 m, longer than three linearised time constants because early on the drag is far from balancing the weight.

Now you. In a head-down posture the same diver has m/b=800 m. Find the terminal speed and the time constant.

Answer

vT=800×9.81=88.6 m s⁻¹, about 319 km h⁻¹. The time constant is vT/2g=88.6/19.62=4.5 s, so the approach is slower as well as faster.

A landscape picture

Since f depends on y alone, define V(y)=-f(y)dy, so that y=-V(y). Then along any solution

dVdt=V(y)y=-(y)20

so V never increases. The system slides downhill on the graph of V and stops at the bottom of a valley. Stable equilibria are the minima of V, unstable ones the maxima, and the depth of a valley says nothing about the rate: the curvature V′′(y*)=-f(y*) does. This is the one dimensional case of the potential energy picture in mechanics, and it makes stability visual: a marble in a bowl returns, a marble on a dome does not.

A fishery that collapses without warning

Now put the theory to work on a model that is deliberately simple and still says something. Harvest a logistic population at a constant rate H, meaning a fixed catch per year rather than a fixed effort:

dPdt=rP(1-PK)-H

The equilibria solve a quadratic, and

P±=K2(1±1-4HrK)

Take r=0.4 per year and K=1000 tonnes. With H=80 tonnes per year the square root is 0.2=0.447, giving equilibria at 724 and 276 tonnes. The upper one is stable, since f=r-2rP/K is -0.179 there, and the lower is unstable, with f=+0.179. So a stock above 276 tonnes settles at 724 and is fished indefinitely, and a stock below 276 is driven to extinction by the harvest. There is a threshold, and it is not at zero.

Raise the catch and the two equilibria move towards each other. At H=90 they are at 658 and 342. At H=rK/4=100 they meet at P=K/2=500, and above that the square root is imaginary: there are no equilibria at all, P<0 everywhere, and the population goes to zero from any starting size. The maximum sustainable catch is rK/4, exactly the peak growth rate found earlier.

Example. With r=0.4 per year and K=1000 tonnes, a fishery is harvested at H=90 tonnes per year and the stock currently stands at 400 tonnes. What happens, and what would happen at 500 tonnes?

The equilibria are at 658 and 342 tonnes. A stock of 400 lies between them, where f>0, so it grows to 658 and stays. A stock of 500 does the same. Both recover, but the margin above the unstable threshold is only 58 tonnes in the first case, so a bad year could push the stock below 342, after which the same harvest drives it to zero.

Now you. The same fishery is harvested at H=96 tonnes per year. Find the two equilibria, and say what happens to a stock of 400 tonnes.

Answer

The square root is 1-384/400=0.04=0.2, so the equilibria are at 500(1±0.2), that is 600 and 400 tonnes. A stock of exactly 400 sits on the unstable equilibrium and stays there in principle, but any downward fluctuation sends it to zero.

Two features of this deserve naming. The first is that the collapse is not gradual. As H rises from 90 to 100 the stable stock falls only from 658 to 500, a modest decline that looks like a fishery under control, and then at H=100 the stable state disappears entirely and the stock crashes. A qualitative change of this kind, where equilibria collide and annihilate as a parameter passes a critical value, is a bifurcation, and this one is the fold, the commonest of them all.

The second is that the safe margin shrinks as the catch rises: the unstable threshold climbs from 276 to 342 to 500 while the stable state falls. A population sitting on a high yield is close to the boundary of its own basin of attraction, so ordinary environmental noise can push it across even before the bifurcation is reached. The Newfoundland cod fishery, closed by moratorium in 1992 after the northern stock fell to about one per cent of its historic biomass, is the standard illustration, and thirty years later the stock has not returned. The model does not explain that collapse, but it does explain why a fishery can look stable and be about to fail, which is more than a formula for P(t) would have told anyone.

What one variable cannot do

Everything in this lesson rested on solutions being monotone, and that is also the limit. An autonomous first order equation cannot oscillate, cannot overshoot, and cannot return to a state it has left. Yet a plucked string, a swinging pendulum, an RLC circuit and a predator with its prey all do exactly those things.

The escape is to add a second dimension to the state. Position with velocity, or predator with prey, gives a plane to move in, and in a plane a trajectory can circle. Mechanics forces this on us anyway: Newton's second law involves acceleration, so the natural equation is second order. That is where the next lesson starts, and the theory has to be rebuilt for it, because an initial position no longer picks out a single solution.

Second order equations and superposition

An initial position no longer determines a trajectory once the equation involves acceleration, and everything built for first order equations has to be redone.

Mechanics forces the change. Newton's second law relates force to the second derivative of position, so the equation for a mass on a spring is mx′′=-kx, and knowing where the mass is says nothing about where it goes next: it might be moving either way at any speed. Two numbers are needed, a position and a velocity, and that count is the visible signature of second order.

This lesson builds the structure that makes second order linear equations tractable. It produces no solutions at all, which is deliberate: the structure says how many solutions to look for and what to do once one is found, and the next lesson does the finding.

The operator and its linearity

Write the general second order linear equation in standard form, having divided by the coefficient of y′′:

y′′+p(t)y+q(t)y=g(t)

It is convenient to name the left side. Define L[y]=y′′+py+qy, a rule that takes a twice differentiable function and returns another function. The equation is then L[y]=g, homogeneous when g=0 and otherwise driven by the forcing g.

The one property that matters is that L is linear:

L[c1y1+c2y2]=c1L[y1]+c2L[y2]

which follows immediately from the derivative of a sum being the sum of derivatives, and from constants passing through derivatives. Everything in this lesson is a consequence of that identity, and nothing in it survives if the equation contains y2 or siny.

The first consequence is the principle of superposition: if y1 and y2 both solve L[y]=0, then so does c1y1+c2y2 for any constants, since L of that combination is c10+c20. Solutions of the homogeneous equation can be added and scaled freely, which in the language of the linear algebra course makes them a vector space. The question that then decides everything is what its dimension is.

Existence and uniqueness, and what it buys

The relevant theorem is stronger than Picard's, precisely because linearity removes the possibility of blow-up. If p, q and g are continuous on an open interval I containing t0, then for any numbers y0 and v0 there is exactly one solution of L[y]=g on the whole of I with y(t0)=y0 and y(t0)=v0.

Three points. The interval is the whole of I, not some unknown piece of it. Two numbers are required, matching the order. And uniqueness has an immediately useful corollary: a solution whose value and derivative both vanish at one point is identically zero, because the zero function is one solution with that data and there is only one.

The solution space has dimension exactly two

Take any two solutions y1, y2 of the homogeneous equation, and ask when every solution can be written as c1y1+c2y2.

Let y be any solution, with y(t0)=y0 and y(t0)=v0. We want constants making the combination match those two numbers:

c1y1(t0)+c2y2(t0)=y0,c1y1(t0)+c2y2(t0)=v0

Two linear equations in two unknowns. They have a solution for every right hand side exactly when the determinant of the coefficients is not zero, and that determinant is

W(t0)=y1(t0)y2(t0)-y1(t0)y2(t0)

called the Wronskian. If W(t0)0 the constants exist, the combination c1y1+c2y2 agrees with y in value and derivative at t0, and uniqueness forces the two functions to be the same everywhere. So every solution is a combination of the two, the pair is a fundamental set, and c1y1+c2y2 deserves the name general solution.

The dimension is therefore two, no more and no less: two because two constants are needed to meet arbitrary initial data, and no more because those two suffice. This is why a second order equation is solved once two independent solutions are found, and why finding a third is a sign of an algebra error rather than a discovery.

Abel's identity sharpens the test. Differentiating W=y1y2-y1y2 and using the equation to replace both second derivatives gives W=-p(t)W, a separable equation, so W=Ce-pdt. The exponential is never zero, so either C=0 and the Wronskian vanishes identically, or it is never zero at all. Checking independence at one convenient point, usually t=0, settles it for the whole interval.

Example. Show that y1=cos2t and y2=sin2t form a fundamental set for y′′+4y=0.

Both are solutions: differentiating twice multiplies each by -4, and the equation holds. The Wronskian is

W=cos2t2cos2t-(-2sin2t)sin2t=2cos22t+2sin22t=2

which is never zero, so the pair is independent and y=c1cos2t+c2sin2t is the general solution. Note that p=0 here, so Abel's identity predicts a constant Wronskian, which is what appeared.

Now you. Show that y1=e3t and y2=e-2t form a fundamental set for y′′-y-6y=0, and compute the Wronskian.

Answer

Substituting e3t gives 9-3-6=0 and e-2t gives 4+2-6=0, so both solve it. The Wronskian is e3t(-2e-2t)-3e3te-2t=-5et, never zero. Abel's identity agrees: p=-1, so W is a constant times et.

Fitting the initial conditions

With a fundamental set in hand, solving an initial value problem is two linear equations in two unknowns, every time.

Example. The general solution of y′′-y-6y=0 is y=c1e3t+c2e-2t. Solve it with y(0)=1 and y(0)=8.

Setting t=0: c1+c2=1. Differentiating, y=3c1e3t-2c2e-2t, so 3c1-2c2=8. Substituting c2=1-c1 into the second gives 5c1=10, so c1=2 and c2=-1. The solution is y=2e3t-e-2t.

Now you. Same equation, with y(0)=4 and y(0)=-3.

Answer

c1+c2=4 and 3c1-2c2=-3. Substituting gives 5c1=5, so c1=1 and c2=3, and y=e3t+3e-2t.

Reduction of order

Suppose one solution y1 is known, by guesswork or from the physics. There is a systematic way to manufacture the second, due to d'Alembert: look for a solution of the form y=v(t)y1(t), with v a function rather than a constant.

Substituting is a short calculation. With y=vy1, y=vy1+vy1 and y′′=v′′y1+2vy1+vy1′′, so

L[y]=v′′y1+v(2y1+py1)+v(y1′′+py1+qy1)

The last bracket is L[y1], which is zero because y1 solves the equation. That is the point of the method: the term in v disappears, leaving an equation containing only v′′ and v, which is a first order linear equation in the unknown v and therefore already solvable by the integrating factor.

Example. Verify that y1=t2 solves t2y′′-3ty+4y=0 for t>0, and find a second independent solution.

Substituting y1=t2 gives 2t2-6t2+4t2=0, so it is a solution. Put y=vt2. Then y=vt2+2tv and y′′=v′′t2+4tv+2v, and the equation becomes

t4v′′+4t3v+2t2v-3t3v-6t2v+4t2v=t4v′′+t3v=0

The terms in v cancel, as promised. Dividing by t4 leaves v′′+v/t=0, so v=C/t and v=Clnt. Taking C=1, the second solution is y2=t2lnt, and the general solution is y=c1t2+c2t2lnt. Their Wronskian is t3, nonzero for t>0.

Now you. Verify that y1=e2t solves y′′-4y+4y=0, and find a second independent solution by reduction of order.

Answer

Substituting gives 4-8+4=0. With y=ve2t, y=(v+2v)e2t and y′′=(v′′+4v+4v)e2t, so the equation becomes (v′′+4v+4v-4v-8v+4v)e2t=v′′e2t=0. Hence v′′=0, v=A+Bt, and the new solution is y2=te2t.

That last result is worth holding on to. An equation whose characteristic algebra will turn out to have a repeated root produces a second solution with an extra factor of t, and reduction of order is where that factor comes from rather than being pulled out of a hat.

Adding forcing

Now let g be present. Suppose yp is any single solution of L[y]=g, called a particular solution, and let y be any other. Then by linearity

L[y-yp]=L[y]-L[yp]=g-g=0

so the difference solves the homogeneous equation. Therefore every solution of the driven equation is

y=yp+c1y1+c2y2

one particular response plus the general homogeneous solution, which is called the complementary function. This is the same split that appeared for first order equations as steady state plus transient, and it is now a theorem rather than an observation about one formula.

The practical consequences are two. The initial conditions must be applied to the whole expression, never to the complementary function alone, which is the single commonest error in this subject. And superposition extends to forcing: if L[y1]=g1 and L[y2]=g2, then L[y1+y2]=g1+g2, so a complicated forcing can be split into pieces, each handled separately and the results added. A circuit driven by a battery and a sinusoid can be analysed twice and the answers summed, which is the whole basis of frequency domain engineering.

What is still missing

Nothing so far produces a single solution. The theory says that two independent ones exist, that the Wronskian recognises them, that a third would be redundant, and that reduction of order gets the second from the first. It does not say how to get the first.

For general p(t) and q(t) there is no method, and even innocuous cases have no elementary solutions: y′′+ty=0, the Airy equation, needs power series and defines new functions. But one case covers most of physics and all of elementary circuit theory, the case of constant coefficients, and there a single guess turns the differential equation into a quadratic. That is the next lesson.

Constant coefficients

The previous lesson proved that a second order linear equation has exactly two independent solutions and gave no way to find even one, and this lesson closes that gap for the case that covers most of physics.

The case is constant coefficients:

ay′′+by+cy=0

with a, b and c numbers rather than functions of t. Every mass on a spring, every RLC circuit, every small oscillation about equilibrium in a system whose parts do not change with time is of this form, and the whole problem reduces to solving a quadratic.

The guess

Look at what the equation asks. A solution must be a function that reproduces itself, up to a constant, when differentiated once and again, so that the three terms can cancel. Exponentials do exactly that, so try y=ert with r unknown.

Then y=rert and y′′=r2ert, and substituting gives

(ar2+br+c)ert=0

The exponential is never zero, so the trial function solves the equation precisely when

ar2+br+c=0

the characteristic equation. A calculus problem has become an algebra problem, and this substitution is the entire method. The quadratic has two roots, and the three cases of the discriminant b2-4ac give the three behaviours that the rest of the course keeps meeting.

Two real roots

If b2-4ac>0 the roots r1r2 are real, and er1t and er2t are two solutions. They are independent: their Wronskian is (r2-r1)e(r1+r2)t, which is nonzero exactly because the roots differ. So the general solution is

y=c1er1t+c2er2t

and no other solutions exist, by the dimension argument of the previous lesson.

Example. Solve y′′+5y+6y=0 with y(0)=2 and y(0)=-1.

The characteristic equation is r2+5r+6=(r+2)(r+3)=0, so r=-2 and r=-3 and y=c1e-2t+c2e-3t. The conditions give c1+c2=2 and -2c1-3c2=-1. Substituting c2=2-c1 into the second gives c1-6=-1, so c1=5 and c2=-3, and

y=5e-2t-3e-3t

At t=1 this is 5(0.1353)-3(0.0498)=0.527. Both terms decay, so y0, and after a short time the e-3t term is negligible and the decay is governed by the root nearer zero. That root is the one that matters in any real system: the slowest decaying mode dominates everything eventually.

Now you. Solve y′′+y-12y=0 with y(0)=1 and y(0)=10.

Answer

r2+r-12=(r-3)(r+4)=0, so y=c1e3t+c2e-4t. Then c1+c2=1 and 3c1-4c2=10, giving 7c1=14, so c1=2 and c2=-1, and y=2e3t-e-4t. The positive root means this solution grows without bound.

Complex roots and Euler's formula

If b2-4ac<0 the roots are a complex conjugate pair r=α±iβ, with α=-b/2a and β=4ac-b2/2a. The algebra does not care: e(α+iβ)t is a perfectly good solution once the exponential of a complex number is defined. But the equation has real coefficients and describes a real system, so a real answer is wanted.

Euler's formula, eiθ=cosθ+isinθ, supplies it. Writing

e(α+iβ)t=eαt(cosβt+isinβt)

and using superposition, the sum of the two complex solutions is 2eαtcosβt and their difference is 2ieαtsinβt. Both are combinations of solutions, so both are solutions, and dividing by the constants leaves two real ones. Their Wronskian is βe2αt, nonzero since β0, so the general solution is

y=eαt(c1cosβt+c2sinβt)

This is the most important formula in the subject. The real part of the root sets the envelope, growing if α>0 and decaying if α<0, and the imaginary part sets the frequency of oscillation inside it. A single complex number carries both facts, which is why engineers work with complex roots and read off the physics at the end.

Example. Solve y′′+2y+5y=0 with y(0)=1 and y(0)=3, and give the amplitude of the oscillation at t=0.

The characteristic equation is r2+2r+5=0, with roots r=-2±4-202=-1±2i. So y=e-t(c1cos2t+c2sin2t). At t=0, y=c1=1. Differentiating with the product rule,

y=-e-t(c1cos2t+c2sin2t)+e-t(-2c1sin2t+2c2cos2t)

so y(0)=-c1+2c2=3, giving c2=2. The solution is y=e-t(cos2t+2sin2t). Combining the trigonometric pair, its initial amplitude is 1+4=2.236, so the motion is an oscillation of period π inside an envelope ±2.236e-t. At t=1 the value is 0.516.

Now you. Solve y′′+4y+13y=0 with y(0)=2 and y(0)=-1.

Answer

The roots are r=-4±16-522=-2±3i, so y=e-2t(c1cos3t+c2sin3t). Then c1=2, and y(0)=-2c1+3c2=-1 gives c2=1. So y=e-2t(2cos3t+sin3t).

Writing the answer as a single sinusoid is often clearer. Since c1cosβt+c2sinβt=Rcos(βt-δ) with R=c12+c22 and tanδ=c2/c1, the example above is y=2.236e-tcos(2t-1.107), with the phase in radians. The amplitude-and-phase form is what an oscilloscope shows; the sine-and-cosine form is what the initial conditions fit easily. Both are used, and converting between them is worth doing until it is automatic.

The repeated root

If b2-4ac=0 there is only one root, r=-b/2a, and only one solution ert. The theory demands two, so the second must be found another way, and reduction of order supplies it exactly as in the previous lesson: putting y=vert into the equation makes the terms in v and v both vanish, leaving v′′=0, so v=A+Bt and the new solution is tert. The general solution is

y=(c1+c2t)ert

The factor of t is not a patch. It is what the double root means: the two exponentials of the nearby non-repeated case, er1t and er2t, have a difference which, divided by r2-r1 and taken to the limit as the roots merge, is precisely tert. The pair does not degenerate into one solution; it degenerates into a solution and a derivative.

Example. Solve y′′+6y+9y=0 with y(0)=1 and y(0)=-1.

The characteristic equation is r2+6r+9=(r+3)2, so r=-3 twice and y=(c1+c2t)e-3t. Then c1=1, and differentiating, y=c2e-3t-3(c1+c2t)e-3t, so y(0)=c2-3c1=-1 and c2=2. Hence y=(1+2t)e-3t, which rises briefly before decaying, since the linear factor beats the exponential at first. At t=1 it is 3e-3=0.149.

Now you. Solve y′′-4y+4y=0 with y(0)=3 and y(0)=4.

Answer

r2-4r+4=(r-2)2, so y=(c1+c2t)e2t. Then c1=3 and y(0)=c2+2c1=4, so c2=-2 and y=(3-2t)e2t.

Reading the roots

Before any initial conditions are applied, the roots already say what the system does, and this is the habit worth acquiring.

Both roots negative and real: the solution decays without oscillating, and the slower root sets the timescale. Roots complex with negative real part: a decaying oscillation, frequency β, envelope time constant 1/|α|. Purely imaginary roots, meaning b=0: undamped oscillation at frequency β forever. Any root with a positive real part: growth, and the system is unstable, oscillating or not. A zero root, meaning c=0: a constant solution, so the system has no restoring force and drifts.

That classification is the whole qualitative theory of a linear second order system, and the next lesson does nothing but attach physical names to its cases.

Higher order, and one other solvable family

The method does not care about the order. For any(n)++a0y=0, substituting ert gives a polynomial of degree n, and each root contributes a solution: real roots give exponentials, complex conjugate pairs give eαtcosβt and eαtsinβt, and a root repeated k times contributes its exponential multiplied by 1,t,,tk-1. Together they give n independent solutions, and the solution space of an n-th order linear equation has dimension n.

For example y′′′-y′′-4y+4y=0 has characteristic polynomial r3-r2-4r+4=(r-1)(r-2)(r+2), so the general solution is c1et+c2e2t+c3e-2t. The honest limit is that polynomials of degree five and above have no formula for their roots, so beyond the quartic the characteristic equation itself has to be solved numerically. That is not a serious obstacle, since a numerical root is as good as an exact one for computing a response, but it does mean the method stops being a closed form procedure.

One other family yields to a substitution of the same spirit. The Cauchy-Euler equation t2y′′+αty+βy=0 has coefficients that are not constant, but each derivative comes multiplied by exactly the matching power of t, so trying y=tr works: it gives r(r-1)+αr+β=0. The equation t2y′′-3ty+4y=0 from the previous lesson gives r2-4r+4=0, a repeated root at r=2, and the second solution acquires a factor of lnt rather than t, which is what reduction of order produced there.

What still cannot be done

Everything here is homogeneous: no forcing, no external driving. All these solutions decay, grow or oscillate on their own terms and then, if stable, sit at zero. A system that is being pushed needs a particular solution, which is a different problem.

It is also worth being clear about the reach of constant coefficients. They describe a system whose properties do not change with time and whose response is proportional to the disturbance. A spring stretched too far, a circuit driven into saturation, a pendulum swung through a large angle: none of these is covered, and the last of them is the subject of the final lesson.

Next, though, comes the physics. The equation mx′′+cx+kx=0 is one equation with three regimes, and the same three roots that came out of the algebra above turn out to be the difference between a car that rides well and one that bounces down the road.

Free oscillation and damping

The three root cases of a constant coefficient quadratic are not an algebraic curiosity: they are the difference between a car that rides well, one that bounces down the road, and one that wallows.

This lesson attaches physics to the algebra of the previous one. The equation is the same throughout, and the whole of its behaviour is controlled by two numbers that can be read off the coefficients before anything is solved.

Building the equation

Hooke's law says a spring stretched by x from its natural length pulls back with force -kx, the sign saying that the force opposes the displacement, and the constant k measured in newtons per metre. Resistance to motion, from a dashpot or from air, is modelled at low speeds as proportional to velocity and opposing it, giving -cx. Newton's second law then assembles

mx′′=-kx-cxthat ismx′′+cx+kx=0

Divide by m and give the two resulting numbers names:

x′′+2ζω0x+ω02x=0,ω0=km,ζ=c2mk

The natural frequency ω0 is in radians per second and the damping ratio ζ is dimensionless. Every free linear oscillator in existence is described by that pair of numbers, and nothing else about the system matters to its motion.

The characteristic equation is r2+2ζω0r+ω02=0, whose roots are

r=ω0(-ζ±ζ2-1)

so the sign of ζ-1 decides everything.

No damping at all

With ζ=0 the roots are ±iω0 and the solution is x=Acosω0t+Bsinω0t, or equivalently x=Rcos(ω0t-δ) with R=A2+B2. This is simple harmonic motion: a pure sinusoid of period T=2π/ω0, running forever.

Two features deserve attention. The frequency depends on the spring and the mass, not on how hard the system was started: a large oscillation and a small one take the same time, which is isochronism and is the property that made the pendulum clock possible. And energy is conserved, sloshing between kinetic 12m(x)2 and potential 12kx2 with a constant sum 12kR2, which you can verify by differentiating that sum and using the equation.

Example. A 0.50 kg mass hangs on a spring of stiffness 200 N m⁻¹. Find the natural frequency in radians per second and in hertz, and the period.

ω0=200/0.50=400=20 rad s⁻¹. In hertz that is 20/2π=3.18 Hz, and the period is 2π/20=0.314 s. Hanging the mass also stretches the spring by mg/k=0.5×9.81/200=24.5 mm at rest, but that only shifts the equilibrium: measuring x from the new rest position gives back the same equation, with gravity absorbed.

Now you. A 2.0 kg mass sits on a spring of stiffness 50 N m⁻¹. Find ω0, the frequency in hertz, and the period.

Answer

ω0=50/2=5 rad s⁻¹, which is 5/2π=0.796 Hz, and the period is 2π/5=1.26 s.

The three regimes

Turn the damping on. Since the roots depend only on ζ and ω0, the classification is complete and has three cases.

Underdamped, ζ<1. The roots are complex, r=-ζω0±iωd with ωd=ω01-ζ2, and

x=Re-ζω0tcos(ωdt-δ)

an oscillation inside a decaying envelope. The damped frequency ωd is always below the natural one, though only slightly for light damping: at ζ=0.1 it is lower by half a per cent. The envelope has time constant 1/ζω0.

Critically damped, ζ=1. The root -ω0 is repeated, so x=(c1+c2t)e-ω0t. There is no oscillation, and this is the fastest possible return to equilibrium without overshoot, since any smaller ζ overshoots and any larger one is slower.

Overdamped, ζ>1. Two negative real roots, and x=c1er1t+c2er2t. The system creeps back, dominated eventually by the slower root, the one nearer zero. Increasing the damping further makes it slower still, which is the counterintuitive fact of the subject: too much damping does not stop motion faster, it drags it out.

Example. A 2.0 kg mass on a spring with k=20 N m⁻¹ has a dashpot with c=6.0 N s m⁻¹. Classify the motion, and find the damped period.

ω0=20/2=3.162 rad s⁻¹ and ζ=6/(22×20)=6/12.65=0.474, so the system is underdamped. Then ωd=3.1621-0.225=2.784 rad s⁻¹, giving a damped period of 2π/2.784=2.26 s, against 1.99 s undamped. The envelope decays with time constant 1/(ζω0)=1/1.5=0.667 s, so the oscillation is essentially over in a few seconds.

Now you. A 1.0 kg mass on a spring with k=16 N m⁻¹ has c=10 N s m⁻¹. Classify the motion and find the two roots.

Answer

ω0=4 rad s⁻¹ and ζ=10/(216)=1.25>1, so it is overdamped. The roots solve r2+10r+16=0, giving r=-2 and r=-8. The return is governed by the slow root, so the decay time constant is 0.5 s.

Which regime a designer wants

The choice of ζ is a design decision, and different machines want different answers.

A car suspension is a spring and damper carrying about a quarter of the car's mass. Take m=300 kg and k=30000 N m⁻¹, giving ω0=10 rad s⁻¹, or 1.59 Hz, which is close to the frequency of a walking human and is chosen deliberately: ride comfort is poor at much higher frequencies and motion sickness sets in below about 0.5 Hz. Critical damping would need c=2mk=6000 N s m⁻¹. Real dampers are set nearer ζ=0.3, so c=1800 N s m⁻¹, because a critically damped suspension transmits too much of a sharp bump into the cabin. The price is a single small overshoot, which is what the body of a car does after a speed bump.

A door closer is deliberately overdamped: an overshoot would slam the door. A moving-coil galvanometer, and the analogue meters that descend from it, is critically damped so the needle reaches its reading in the least time without swinging past it, and instrument makers specify the coil circuit resistance that achieves it. A bell or a tuning fork is as lightly damped as the material allows, since the whole point is that the oscillation persists.

Measuring the damping

None of these numbers is usually known in advance. What can be measured is a decaying trace, and two consecutive peaks are enough.

Successive maxima are one damped period apart, so their ratio is the envelope's decay over that period:

xnxn+1=eζω0Td,Td=2πωd

Taking the logarithm defines the logarithmic decrement δ=ln(xn/xn+1)=2πζ/1-ζ2, which inverts to

ζ=δ4π2+δ2

Example. A trace shows successive peaks of 12.0 mm and 9.2 mm. Find the logarithmic decrement, the damping ratio, and the quality factor Q=1/2ζ.

δ=ln(12.0/9.2)=0.2657. Then ζ=0.2657/39.48+0.071=0.0423, light damping, and Q=1/(2×0.0423)=11.8. Since ζ is small, the correction from ωd to ω0 is under a tenth of a per cent and can be ignored.

Now you. Successive peaks are 8.0 mm and 5.0 mm. Find δ, ζ and Q.

Answer

δ=ln(8/5)=0.470, so ζ=0.470/39.48+0.221=0.0746 and Q=6.7.

The quality factor Q is the standard way to quote light damping, and it has a physical reading. Energy goes as amplitude squared, so it decays as e-2ζω0t, and Q is 2π times the energy stored divided by the energy lost per cycle. It also counts oscillations: the amplitude falls by a factor of e in about Q/π cycles. A car suspension has Q near 1.7, a guitar string a few thousand, a quartz watch crystal 105, and the mirror suspensions of the LIGO gravitational wave detectors exceed 107, which is why they ring for hours.

The same equation in a circuit

An inductor, resistor and capacitor in series obey Kirchhoff's voltage law: Ldidt+Ri+qC=0, and since i=q this is

Lq′′+Rq+qC=0

Term by term this is the mechanical equation, with inductance playing the part of mass, resistance the part of the dashpot, and the reciprocal capacitance the part of the spring constant. So

ω0=1LC,ζ=R2CL

Take L=10 mH and C=100 nF. Then ω0=1/10-2×10-7=31623 rad s⁻¹, or 5.03 kHz. Critical damping needs R=2L/C=632 Ω, and a real coil with 50 Ω of resistance gives ζ=0.079 and Q=6.3: a ringing circuit, which is what a tuned radio stage is for and what a designer of a digital signal path works to avoid.

The correspondence is exact rather than an analogy, and it is why oscillation is studied once rather than once per discipline. The same three regimes appear in a thermostat's temperature swing, in the response of a servo motor, and in the pitch of a ship in a swell.

Where the model stops

Two assumptions are doing real work here, and both fail eventually.

Viscous damping, force proportional to velocity, is a good model for a fluid dashpot at low speed and for a resistor exactly. It is a poor model for dry friction, whose magnitude is roughly constant and whose direction flips with the velocity. That difference is qualitative rather than a matter of accuracy: a viscously damped oscillator approaches equilibrium exponentially and never quite reaches it, while a dry-friction oscillator loses a fixed amount of amplitude per cycle, so the peaks fall on a straight line and the motion stops dead in finite time, generally not at the equilibrium position.

Linearity is the other. Hooke's law is the first term of a Taylor expansion of a real restoring force, and stretching a spring far enough introduces x3 terms that make the frequency depend on amplitude. A pendulum has sinθ in place of θ and is only harmonic for small swings, which the final lesson quantifies.

So far, though, nothing has pushed on the system. Every solution here decays to nothing, and a machine that only ever rings down is not doing any work. The next lesson adds a driving force and finds that the response depends violently on the frequency at which it is applied.

Driving, resonance and the frequency response

Every solution in the previous lesson decayed to nothing, because nothing was pushing, and a system that is being pushed periodically behaves in a way that depends violently on how fast.

The equation is now driven:

mx′′+cx+kx=F0cosωt

Its general solution, by the structure theorem, is a particular solution plus the complementary function. The complementary function is the free motion of the previous lesson, which decays whenever there is any damping at all, so after a few time constants nothing is left of it. What survives is the particular solution, and that is what a driven system settles into regardless of how it started. It is called the steady state, and finding it is the business of this lesson.

Undetermined coefficients

For a constant coefficient equation with a well-behaved forcing there is a direct method: guess a form with unknown coefficients, substitute, and match. It works because the derivatives of an exponential, a sinusoid or a polynomial stay within the same family.

The guess mirrors the forcing. For g=eat try Aeat. For a polynomial of degree n try a general polynomial of degree n, all coefficients unknown, including those the forcing lacks. For cosωt or sinωt, try Acosωt+Bsinωt, both terms, because differentiating once produces the other. Products multiply the guesses together.

There is one exception, and it is the interesting case. If the guess already solves the homogeneous equation, substituting it gives zero and cannot match the forcing. Multiply the guess by t, and again by t if it still solves the homogeneous equation. That rule is where resonance comes from.

Example. Find a particular solution of y′′+4y=5cos3t.

The homogeneous solutions are cos2t and sin2t, and cos3t is not among them, so try yp=Acos3t+Bsin3t. Then yp′′=-9Acos3t-9Bsin3t, and the left side is -5Acos3t-5Bsin3t. Matching gives -5A=5 and -5B=0, so A=-1 and B=0, and yp=-cos3t. The minus sign is not an accident: the drive is above the natural frequency, and the response is in antiphase with it, which the general formula below explains.

Now you. Find a particular solution of y′′-y-6y=4et.

Answer

The homogeneous roots are 3 and -2, so et is not a homogeneous solution and the guess Aet is safe. Substituting gives A(1-1-6)et=-6Aet=4et, so A=-2/3 and yp=-23et.

The steady state of a driven oscillator

Now do the general case. Substituting xp=A1cosωt+A2sinωt into mx′′+cx+kx=F0cosωt and matching the cosine and sine terms gives two linear equations, and the tidy way to present the answer is as a single sinusoid xp=Acos(ωt-φ) with

A=F0/k(1-ρ2)2+(2ζρ)2,tanφ=2ζρ1-ρ2

where ρ=ω/ω0 is the drive frequency measured in units of the natural one. The quantity F0/k is the static deflection, what the force would produce if applied steadily, and the fraction multiplying it is the dimensionless amplification factor.

Three regimes are visible in that formula without any plotting.

Drive slowly, ρ1: the amplification is 1 and φ0. The mass follows the force exactly, as if the spring alone were present. Stiffness controls the response.

Drive quickly, ρ1: the amplification falls as 1/ρ2, so AF0/mω2, and φ180 degrees. The mass barely moves and does the opposite of what the force asks. Inertia controls the response.

Drive near ρ=1: the first bracket vanishes and only the damping term is left, so AF0/(k2ζ)=QF0/k. The response is Q times the static deflection, and the phase passes through exactly 90 degrees, whatever the damping. That phase quadrature is the sharpest experimental signature of resonance, because the amplitude peak is broad and the phase crossing is not.

Where the peak actually is

Maximising A means minimising (1-ρ2)2+(2ζρ)2. Differentiating with respect to ρ2 and setting the result to zero gives ρr=1-2ζ2, with maximum amplification

AmaxF0/k=12ζ1-ζ2

So the resonant peak sits slightly below the natural frequency, and below the damped frequency ωd too. For light damping the shift is negligible: at ζ=0.05 the peak is at ρ=0.9975 and the amplification is 10.01, against 1/2ζ=10. At ζ=0.3 it is at ρ=0.906 with amplification 1.75. And for ζ>1/2=0.707 there is no peak at all: the response falls monotonically from the static value, which is why heavily damped instruments have no preferred frequency.

Example. A 500 kg machine sits on mounts with total stiffness 2×105 N m⁻¹ and damping ratio ζ=0.05. A rotating imbalance applies a force of amplitude 1000 N at 3.0 Hz. Find the steady state amplitude and the phase lag.

First ω0=2×105/500=20 rad s⁻¹, which is 3.18 Hz, so the machine is running just below its own resonance: ω=2π(3.0)=18.85 rad s⁻¹ and ρ=0.9425. The static deflection is 1000/2×105=5.0 mm. The bracket is (1-0.8883)2+(2×0.05×0.9425)2=0.01248+0.00888=0.02136, whose square root is 0.1462, so the amplification is 6.84 and the amplitude is 34 mm. The phase lag is arctan(0.0943/0.1117)=40 degrees. Thirty-four millimetres of shake from a five millimetre static deflection is a machine that will destroy its mounts, and the fix is to move the operating speed or the mount stiffness, not to add damping, which at ζ=0.05 would have to be increased manyfold to help.

Now you. The same machine runs at 1.5 Hz instead. Find ρ, the amplification, and the amplitude.

Answer

ω=9.42 rad s⁻¹, so ρ=0.471 and ρ2=0.222. The bracket is (0.778)2+(0.0471)2=0.6076, whose square root is 0.7795, so the amplification is 1.28 and the amplitude is 6.4 mm. Halving the speed has removed nearly all of the trouble.

Resonance without damping

Set c=0 and drive exactly at the natural frequency. The formula above divides by zero, which is the algebra reporting that the guess has failed: cosω0t now solves the homogeneous equation. Following the rule, multiply by t and try xp=Atsinω0t. Then

xp′′=2Aω0cosω0t-Aω02tsinω0t

so xp′′+ω02xp=2Aω0cosω0t, and matching F0/m gives

xp=F02mω0tsinω0t

an oscillation whose amplitude grows linearly and without bound. That is undamped resonance, and it is the reason the word carries the connotation it does. Real systems always have some damping, so the growth stops at Q times the static deflection, but the approach is worth seeing because it shows what damping is holding back.

Drive slightly off the natural frequency with no damping and something different happens. Starting from rest, the solution is the difference of two cosines at ω and ω0, and the product formula turns it into

x=2F0m(ω02-ω2)sin(ω0-ω)t2sin(ω0+ω)t2

a fast oscillation at the average frequency inside a slow envelope at half the difference. These are beats, the wobble heard when two instruments are nearly in tune, and the energy is being handed to the oscillator and taken back again. As ωω0 the envelope's period lengthens and the amplitude prefactor grows, and in the limit the taking back never happens, which is resonance again.

What resonance does and does not explain

The Tacoma Narrows bridge, which twisted itself apart on 7 November 1940 in a wind of about 19 m s⁻¹, is the illustration in every textbook, and the usual caption is wrong. Wind that steady contains no periodic force at the bridge's 0.2 Hz torsional frequency. What happened was aeroelastic flutter: the deck's own twisting changed the airflow so as to feed energy back into the twisting, in phase with the velocity. In the equation that is a negative c, not a forcing term, and the growth is exponential rather than linear. The distinction matters practically, because flutter is not cured by adding damping in the usual amounts or by avoiding a frequency; it is cured by changing the shape of the deck so the feedback loses its sign.

The London Millennium Bridge, closed two days after opening in June 2000, is a second cautionary case. Pedestrians on a slightly swaying deck adjust their gait to stay balanced, which pushes sideways in time with the sway. Again the input is created by the response, and once the crowd exceeded a critical size the lateral mode grew. The cure was a retrofit of several dozen viscous dampers and tuned mass absorbers, which is to say: raise ζ until the feedback cannot beat it.

Straightforward resonance is real, though, and older than either. Bridges have collapsed under troops marching in step, at Broughton near Manchester in 1831 and at Angers in 1850, where 226 soldiers died. Marching in step supplies a genuine periodic force at around 2 Hz, close to the frequency of a light suspension span, which is why troops are ordered to break step on a bridge to this day.

The same formula underlies the useful side. Radio tuning selects one station because a circuit with Q of a hundred amplifies its own resonant frequency by that factor and neighbours by far less. Magnetic resonance imaging drives nuclear spins at their precession frequency. A microwave oven does not, contrary to the popular account, drive a resonance of the water molecule; it heats by dielectric loss over a broad band, which is why it works on a wide range of foods rather than only at one frequency.

Vibration isolation

One more reading of the same curve settles a practical question: how do you keep a vibrating floor from shaking an instrument? Mount the instrument on springs, and the fraction of the floor's motion that reaches it, the transmissibility, is

T=1+(2ζρ)2(1-ρ2)2+(2ζρ)2

which equals one at ρ=2 regardless of damping, and falls below one only above it. So isolation requires the mounts to be soft enough that the natural frequency is well below the disturbance, by a factor of at least 2 and in practice three or more. That is why a sensitive balance sits on a slack, heavy table rather than a stiff one, and why the isolation stages of a gravitational wave detector are a stack of pendulums with periods of seconds.

Example. An instrument is mounted with ρ=2 and ζ=0.1. What fraction of the floor's motion reaches it?

The numerator is 1+(0.4)2=1.077. The denominator is (1-4)2+(0.4)2=9.16=3.027. So T=0.356: about a third gets through.

Now you. The same mounts are used at ρ=4. What is the transmissibility?

Answer

The numerator is 1+(0.8)2=1.281 and the denominator is 225+0.64=15.02, so T=0.085. Doubling the frequency ratio has cut the transmitted motion fourfold, roughly as 1/ρ2.

Note that damping hurts here. At high ρ the numerator grows with ζ while the denominator does not, so a stiff damper carries vibration across the mount. Damping is wanted only near resonance, which is the tension every real isolator has to resolve, usually by making the damping frequency dependent.

What is still missing

All of this assumed the forcing was a single sinusoid. Real disturbances are not: a hammer blow, a switch closing, a road surface, an earthquake record. Undetermined coefficients has nothing to say about any of them, since none has a guessable form.

Two things rescue the situation, and the next lesson takes both. There is a method, variation of parameters, that produces a particular solution for any forcing at all in the form of an integral. And there is a structural fact: because the system is linear, its response to a complicated input is the sum of its responses to simple pieces, so the frequency response computed here turns out to answer far more than the question it was asked.

Arbitrary forcing

Undetermined coefficients needs a forcing whose derivatives stay in a small family, and most real disturbances are nothing of the kind.

A hammer blow, a switch closing, a road profile, an earthquake accelerogram: none of these is a sum of exponentials, polynomials and sinusoids that anyone can write down in advance. Even textbook functions defeat the method, since there is no finite family containing sect or 1/t. This lesson gives the general method, and then shows that the general method has more structure in it than a formula for one answer.

Variation of parameters

The idea is due to Lagrange, and its name says it: take the general homogeneous solution c1y1+c2y2 and let the constants vary. Look for a particular solution of y′′+py+qy=g in the form

yp=u1(t)y1(t)+u2(t)y2(t)

Two unknown functions where one equation is available, so we are free to impose one extra condition, and the right choice makes the algebra collapse. Differentiating,

yp=u1y1+u2y2+(u1y1+u2y2)

Impose that the bracket vanishes:

u1y1+u2y2=0

This is not a restriction on the answer; it is a choice of how to split the work between the two unknowns, and it keeps second derivatives of u out of the calculation. Differentiating again and substituting into the equation, all the terms containing u1 and u2 undifferentiated collect into u1L[y1]+u2L[y2], which is zero, and what remains is

u1y1+u2y2=g

Two linear equations for u1 and u2, whose determinant is the Wronskian W=y1y2-y1y2, nonzero because the pair is independent. Solving,

u1=-y2gW,u2=y1gW

and integrating gives the particular solution

yp=-y1y2gWdt+y2y1gWdt

This works for any g and for variable coefficients too, provided a fundamental set is known. That proviso is the catch: variation of parameters solves the forcing problem completely and says nothing about how to find y1 and y2 in the first place.

Example. Solve y′′+y=sect on the interval -π/2<t<π/2.

The homogeneous solutions are y1=cost and y2=sint, with W=cos2t+sin2t=1. Then

u1=-sintsect=-tant,u2=costsect=1

so u1=ln|cost| and u2=t. The particular solution is

yp=costln|cost|+tsint

Differentiating twice confirms it. Notice the tsint: the forcing sect contains, in a sense made precise below, some content at the natural frequency, and the response grows accordingly, running off to infinity as tπ/2 where the forcing itself does.

Now you. Solve y′′+y=csct on 0<t<π.

Answer

With the same y1, y2 and W=1, u1=-sintcsct=-1 and u2=costcsct=cott. So u1=-t and u2=ln|sint|, giving yp=-tcost+sintln|sint|.

The same formula as one integral

Write the two integrals as definite ones from 0 to t, which fixes the constants and makes yp and yp both vanish at t=0. Then the terms can be gathered under a single integral sign:

yp(t)=0ty1(s)y2(t)-y1(t)y2(s)W(s)g(s)ds

Read that carefully, because it says something the derivation did not. The response at time t is a sum over all earlier times s of the forcing then, g(s), multiplied by a kernel depending on both times. The kernel is a property of the system alone: it contains no reference to the forcing. So the system's entire behaviour under any forcing whatever is encoded in one function of two variables, and for constant coefficients that reduces to a function of one, since only the elapsed time t-s can matter to a system whose properties do not change.

Call that function h. Then

yp(t)=0th(t-s)g(s)ds

which is a convolution. For the damped oscillator mx′′+cx+kx=F(t), taking y1 and y2 as the decaying sine and cosine gives

h(t)=1mωde-ζω0tsinωdt

Impulse and step

That h has a direct physical meaning. Apply a very short, very hard blow: a force lasting Δ with magnitude I/Δ, so that its integral, the impulse, is I however small Δ is. The convolution then gives yp(t)Ih(t) for t beyond the blow, so h is the response to a unit impulse, the impulse response. Mechanically the blow delivers momentum I to a mass that has not yet moved, leaving it at x=0 with velocity I/m, and solving the free equation from that state gives exactly the h above. The convolution formula is then obvious in hindsight: an arbitrary forcing is a succession of small impulses g(s)ds, each producing its own decaying ring, and the system's linearity lets them be added.

The response to a suddenly applied constant force, the step response, is the integral of the impulse response, since a step is the accumulation of impulses. For the damped oscillator, starting at rest,

x(t)=F0k[1-e-ζω0t(cosωdt+ζω0ωdsinωdt)]

It rises to the static deflection F0/k, overshoots, and rings down. The overshoot is worth a formula, since it is what a control engineer is usually paid to reduce: the first peak occurs at tp=π/ωd and exceeds the final value by the fraction

exp(-πζ1-ζ2)

which depends only on the damping ratio.

Example. A system has ω0=4 rad s⁻¹ and ζ=0.25. A constant force is applied suddenly. By what percentage does the response overshoot its final value, and when?

The damped frequency is ωd=41-0.0625=3.873 rad s⁻¹, so the first peak is at π/3.873=0.811 s. The overshoot is exp(-π×0.25/0.9375)=exp(-0.811)=0.444, so the response reaches 144 per cent of its final value before settling.

Now you. The same system is redesigned with ζ=0.5. Find the new overshoot and peak time.

Answer

ωd=40.75=3.464 rad s⁻¹, so the peak is at π/3.464=0.907 s. The overshoot is exp(-π×0.5/0.75)=exp(-1.814)=0.163, that is 16.3 per cent. Doubling the damping cut the overshoot to about a third, at the cost of a slightly later peak.

Why the frequency response answered more than it was asked

There is a second route to the same generality, and in engineering it is the dominant one.

A periodic forcing of period T, however jagged, can be written as a sum of sinusoids at the frequencies ωn=2πn/T, which is the Fourier series developed for the heat equation in 1822 and treated properly in courses on that subject. Take that fact on loan. Linearity does the rest: the response to the sum is the sum of the responses, and the response to each sinusoid is known from the previous lesson, scaled by the amplification A(ωn) and delayed by the phase φ(ωn).

So the amplitude and phase curves are not a special-case answer for sinusoidal driving. They are a complete description of the system, and applying them component by component is what "filtering" means.

The consequences can be startling, because the amplification varies so sharply near resonance.

Example. A square wave of frequency f contains only odd harmonics, with amplitudes proportional to 1,1/3,1/5,1/7 at f,3f,5f,7f. It drives a lightly damped system with ζ=0.05 whose natural frequency is 5f. What comes out?

The gains at ρ=0.2,0.6,1.0,1.4 are 1.04, 1.56, 10.0 and 1.03. Multiplying by the input amplitudes 1.273, 0.424, 0.255 and 0.182 gives output amplitudes 1.33, 0.66, 2.55 and 0.19. The fifth harmonic entered at one fifth the size of the fundamental and leaves nearly twice as large: the output is dominated by a component that was almost invisible in the input, and it oscillates at five times the driving frequency. A structure fed a rough periodic load can therefore ring at a frequency that appears nowhere obvious in the load.

Now you. The same square wave drives a system tuned instead to 3f, with the same damping. The gains at ρ=1/3, 1 and 5/3 are 1.12, 10.0 and 0.56. Which component dominates the output, and by how much over the fundamental?

Answer

Output amplitudes are 1.273×1.12=1.43 for the fundamental, 0.424×10=4.24 for the third harmonic, and 0.255×0.56=0.14 for the fifth. The third harmonic dominates, about three times the fundamental.

Three descriptions of one thing

Gather what has appeared. The impulse response h(t) says what the system does after a tap. The step response is its integral. The frequency response is its amplitude and phase against driving frequency. For a linear system with constant coefficients these are three encodings of the same information, each recoverable from the others: the frequency response is the Fourier transform of the impulse response, and the impulse response is the derivative of the step response.

That is why a shaker test, a hammer test and a step test on the same structure are alternatives rather than complements, and why a specification can be written in whichever language suits: settling time and overshoot for a servo, bandwidth and Q for a filter, ring-down for a bell. It is also the reason linear systems are so heavily used even where the physics is only approximately linear. One measured curve predicts the response to every input that will ever be applied.

The two assumptions that carry all of it

Superposition, which requires linearity, and time invariance, which requires coefficients that do not change. Remove either and the whole apparatus falls.

A system with a spring whose stiffness depends on displacement has no impulse response, because doubling the tap does not double the answer. A system whose mass changes as it burns fuel has no frequency response, because the same input applied later gives a different output. In both cases the convolution integral is simply false, not merely inaccurate, and the honest options are numerical solution and qualitative analysis.

Before reaching those, one generalisation is still missing from the linear theory. Everything so far has had a single dependent variable, and many systems have several coupled together: two tanks in series, two masses on a shared spring, a predator and its prey. The next lesson shows that such systems, and every high order equation as well, are best written as first order systems, and that the plane they live in can be read almost as easily as the phase line was.

Systems and the phase plane

Two tanks feeding each other, two masses on a shared spring, and a predator with its prey all have something the equations so far cannot express: more than one unknown function, each depending on the others.

Such a model is a system of differential equations, and the useful discovery is that systems are not a complication added to the subject but the natural home of it. Writing a second order equation as a pair of first order ones costs nothing, gains a picture, and is what every numerical solver does internally.

Everything is a first order system

Take any equation of order n, solved for the highest derivative. Name the unknown and its derivatives as separate variables: for y′′+3y+2y=cost, put x1=y and x2=y. Then

x1=x2,x2=-3x2-2x1+cost

a pair of first order equations. The first is a definition and the second is the original equation rewritten. Nothing is lost, and the initial conditions y(0), y(0) become the two starting values x1(0), x2(0), which is why they were needed.

The pair (x1,x2) is the state: the smallest collection of numbers that determines the future. For a mechanical system it is position and velocity, for a circuit it is capacitor voltage and inductor current. Once the state is identified, the equation says how it changes, and that is all a differential equation ever says.

Example. Write y′′′-2y′′+y-5y=et as a first order system.

Put x1=y, x2=y, x3=y′′. Then x1=x2, x2=x3, and solving the original for y′′′ gives x3=2x3-x2+5x1+et. Three first order equations, three initial values.

Now you. Write the driven oscillator 2y′′+6y+8y=3sint as a first order system.

Answer

Divide by 2 first: y′′+3y+4y=1.5sint. With x1=y and x2=y, the system is x1=x2 and x2=-3x2-4x1+1.5sint.

The phase plane

For a system of two equations that do not mention t explicitly,

x=f(x,y),y=g(x,y)

the state is a point in the plane and the equations give its velocity vector at every point. A solution traces a curve, its trajectory or orbit, and the plane filled with trajectories is the phase portrait. This is the two dimensional relative of the phase line, and it inherits its main property: trajectories cannot cross, since a crossing point would have two different futures, which uniqueness forbids.

What is gained by discarding t is that a whole family of behaviours becomes one picture. What is lost is the timing: a portrait shows a closed loop without saying whether the circuit takes a second or a year.

The oscillator of the last three lessons is the first example. With x the displacement and v the velocity,

x=v,v=-ω02x-2ζω0v

An undamped oscillator conserves energy, 12v2+12ω02x2, so its trajectories are the level curves of that quantity: ellipses around the origin, traversed clockwise, closed because the motion repeats. Add light damping and each loop falls slightly inside the previous one, making an inward spiral. Increase the damping past critical and the spiral straightens into a direct approach along a preferred direction. The three regimes of the eighth lesson are three shapes in one plane.

Linear systems, solved by the same guess

Take the constant coefficient linear case, which will turn out to describe every equilibrium's neighbourhood:

x=ax+by,y=cx+dy

Try the same thing that worked before, a solution where both variables share one exponential: x=peλt and y=qeλt, with the constants p and q giving the direction. Substituting and cancelling the exponential,

λp=ap+bq,λq=cp+dq

which in the language of the linear algebra course says that λ is an eigenvalue and the direction (p,q) its eigenvector. Rearranged, (a-λ)p+bq=0 and cp+(d-λ)q=0. These have a solution other than p=q=0 only when the two lines coincide, that is when (a-λ)(d-λ)-bc=0. Expanding,

λ2-τλ+Δ=0,τ=a+d,Δ=ad-bc

with τ the trace and Δ the determinant. So a two variable linear system is again governed by a quadratic, whose two roots give two exponential solutions, and the general solution is their combination with two arbitrary constants, matching the two initial values.

The direction that goes with a root follows from either equation: q/p=(λ-a)/b when b0. Along that direction the system moves purely outwards or inwards, with no turning, which makes eigenvector directions the skeleton of the portrait.

Example. Classify and solve x=x+2y, y=3x+2y.

Here τ=3 and Δ=2-6=-4, so λ2-3λ-4=0 and λ=4 or λ=-1. Real roots of opposite sign. For λ=4, q/p=(4-1)/2=1.5, so the direction is along (2,3); for λ=-1, q/p=(-1-1)/2=-1, direction (1,-1). The general solution is

x=2c1e4t+c2e-t,y=3c1e4t-c2e-t

Every trajectory not exactly on the line y=-x eventually runs off along (2,3). The origin is a saddle: attracting along one direction, repelling along another, and unstable overall.

Now you. Classify and find the eigenvalues of x=-3x+y, y=x-3y.

Answer

τ=-6 and Δ=9-1=8, so λ2+6λ+8=0 and λ=-2 or λ=-4. Both real and negative, so the origin is a stable node and every trajectory approaches it, eventually along the direction belonging to λ=-2, the slower root.

The four portraits

The discriminant τ2-4Δ and the signs of τ and Δ classify every linear system in the plane, and there are only four generic pictures.

If Δ<0 the roots are real with opposite signs, and the origin is a saddle, always unstable. If Δ>0 and τ2>4Δ the roots are real with the same sign, and the origin is a node, stable when τ<0 and unstable when τ>0. If τ2<4Δ the roots are complex, and the origin is a spiral, stable when τ<0 and unstable when τ>0. If τ=0 with Δ>0 the roots are purely imaginary and the origin is a centre, surrounded by closed loops, neither attracting nor repelling.

Two conclusions are worth stating plainly. Stability requires τ<0 and Δ>0, a two line test that needs no root finding at all. And the centre is the delicate case, because it needs τ to be exactly zero; any perturbation of the coefficients turns it into a spiral one way or the other. That fragility matters in the next lesson.

Two tanks

Systems arise most naturally when several reservoirs exchange contents. Take two tanks of 100 litres each. Fresh water enters tank A at 5 litres per minute, brine flows from A to B at 10 litres per minute, from B back to A at 5 litres per minute, and leaves B at 10 litres per minute. Every volume stays constant. With x and y the salt masses in kilograms,

x=-10100x+5100y=-0.1x+0.05y
y=10100x-10100y=0.1x-0.1y

Example. Find the eigenvalues of that system and say what the tanks do.

τ=-0.2 and Δ=0.01-0.005=0.005, so λ2+0.2λ+0.005=0 and λ=(-0.2±0.04-0.02)/2=-0.029 or -0.171 per minute. Both real and negative, so the origin is a stable node: all the salt eventually washes out, whatever the starting amounts. The slow mode has time constant 1/0.029=34 minutes and the fast one 1/0.171=5.9 minutes, so after about twenty minutes only the slow mode is left and the two tanks empty together in fixed proportion, along that mode's direction. That is a general feature of coupled linear systems: they forget everything except their slowest mode.

Now you. The same tanks are run at double all the flow rates. Find the new eigenvalues.

Answer

Every coefficient doubles: x=-0.2x+0.1y and y=0.2x-0.2y. Then τ=-0.4 and Δ=0.04-0.02=0.02, giving λ=-0.059 and -0.341 per minute, exactly twice the previous values. Doubling every flow halves every timescale and leaves the shape of the portrait unchanged.

Repeated roots and other degenerate cases

If τ2=4Δ the root is repeated. Sometimes the system still has two independent directions, in which case every direction is an eigenvector and the trajectories are straight lines through the origin, a star node, which happens only when b=c=0 and a=d. Otherwise there is one direction only, and the second solution acquires a factor of t exactly as it did for a repeated characteristic root, producing a degenerate node whose trajectories all come in tangent to the single eigenvector direction.

If Δ=0 one root is zero, and there is a whole line of equilibria rather than an isolated one. The system slides onto that line and stops somewhere along it, with the stopping point depending on the initial condition. This is what a system with no restoring force in one direction does, and it is the linear picture of a conserved quantity.

What this buys, and what it does not

Any system of two linear equations with constant coefficients is now completely solved and classified by two numbers. Since a second order equation is such a system, this includes everything in the last four lessons: the mass on a spring is a spiral when underdamped, a node when overdamped, and a centre when undamped, and the trace being -2ζω0 says immediately that stability is exactly the condition ζ>0.

The method extends to n variables, where the characteristic equation has degree n and stability requires every root to have negative real part. The classification of portraits does not extend so simply, since three dimensions permit behaviour, including chaos, that a plane cannot contain.

What is missing is the nonlinear case, and it is most of nature. Predator and prey do not interact linearly, since the rate of predation depends on the product of the two populations. A pendulum's restoring force is sinθ rather than θ. For those there are no eigenvalues and no general solution, but there is something almost as good: near any equilibrium the system looks linear, and the trace and determinant of that local approximation say what the portrait looks like there. The final lesson does that, and then asks what happens between the equilibria, where linearisation says nothing at all.

Nonlinear systems and what solutions say

Almost every equation worth writing down is nonlinear, and none of the machinery of the last six lessons applies to any of them.

Superposition is gone, so solutions cannot be added. The characteristic equation is gone, so there is no general solution to fit initial conditions to. What remains is the phase plane, and it turns out to be enough for a great deal: equilibria can be found and classified, conserved quantities constrain whole trajectories, and the questions worth asking about a physical system are usually answered without a formula at all. This lesson does that for three systems and then says where the programme ends.

Linearising at an equilibrium

For x=f(x,y) and y=g(x,y), an equilibrium is a point where both f and g vanish, so the state does not move. Near it, expand both functions in a Taylor series and keep the linear terms. With u and v the displacements from the equilibrium (x*,y*),

ufxu+fyv,vgxu+gyv

where the four partial derivatives are evaluated at the equilibrium. That is a linear system of the kind fully classified in the previous lesson, with

τ=fx+gy,Δ=fxgy-fygx

so the local portrait is a node, saddle, spiral or centre according to the same two numbers. The array of partial derivatives is the Jacobian, and the whole of local stability theory is contained in it.

The result is trustworthy with one important exception. Hartman and Grobman proved that whenever every eigenvalue has a nonzero real part, the nonlinear portrait near the equilibrium is a smooth distortion of the linear one, so saddles stay saddles and stable spirals stay stable spirals. When the linearisation gives a centre, with τ=0, the neglected quadratic terms decide, and they can make it a slow spiral either way. A centre in a linearisation is a question, not an answer.

Example. Two competing species obey x=x(3-x-2y) and y=y(2-x-y). Classify the equilibrium at (1,1).

First check it is one: 3-1-2=0 and 2-1-1=0, so both rates vanish. Expanding, f=3x-x2-2xy and g=2y-xy-y2, so fx=3-2x-2y, fy=-2x, gx=-y and gy=2-x-2y. At (1,1) these are -1, -2, -1 and -1. So τ=-2 and Δ=1-2=-1. Since Δ<0 the equilibrium is a saddle, hence unstable: coexistence at these numbers is possible in principle and destroyed by any disturbance, so one species or the other wins depending on the starting point.

Now you. Classify the equilibrium of the same system at (3,0).

Answer

There fx=3-6-0=-3, fy=-6, gx=0 and gy=2-3-0=-1. So τ=-4 and Δ=3, with τ2-4Δ=4>0: a stable node. The state where the first species holds the ground alone is stable against a small invasion by the second.

The pendulum, exactly

A rigid pendulum of length L obeys θ′′=-(g/L)sinθ, which the eighth lesson linearised to θ′′=-(g/L)θ and never revisited. Written as a system with ω=θ,

θ=ω,ω=-gLsinθ

Equilibria occur where ω=0 and sinθ=0, so at θ=0, hanging down, and at θ=π, balanced upright, repeating every 2π. Linearising at the bottom gives τ=0 and Δ=g/L>0, a centre, with the small oscillation frequency ω0=g/L recovered. Linearising at the top gives Δ=-g/L<0, a saddle, which is the mathematical statement that an inverted pendulum falls.

The centre is exactly the case linearisation cannot settle, so use energy instead. Multiplying the equation by θ and integrating gives the conserved quantity

E=12ω2-gLcosθ

which is the energy per unit moment of inertia. Every trajectory lies on a level curve of E, and that settles the global picture without any solving. Low energy gives closed loops around the bottom: genuine oscillation, so the centre is a true centre here, protected by the conservation law rather than by the linearisation. High energy gives curves that never turn back: the pendulum goes over the top repeatedly, and θ increases forever. Between them is one special level, through the saddle at the top, called the separatrix, on which the pendulum approaches the upright position and takes infinite time to arrive.

Example. A pendulum of length 1.00 m hangs at rest. What angular speed at the bottom is just enough to carry it over the top, and what is its small-swing period?

The separatrix has the energy of the upright state at rest, E=g/L. At the bottom, E=12ω2-g/L, so 12ω2=2g/L and ωc=2g/L=29.81=6.26 rad s⁻¹. At the bob that is a speed of 6.26 m s⁻¹. The small-swing frequency is 9.81/1.00=3.13 rad s⁻¹, giving a period of 2π/3.13=2.01 s.

Now you. Do the same for a pendulum of length 0.50 m.

Answer

ωc=29.81/0.5=8.86 rad s⁻¹, and the bob speed is ωcL=4.43 m s⁻¹. The small-swing frequency is 19.62=4.43 rad s⁻¹, so the period is 1.42 s, shorter by the square root of two as the length halved.

The price of the linear approximation

Isochronism, the amplitude-independent period that made pendulum clocks possible, is a property of the linearised equation only. Solving the exact equation by separating the energy relation gives the period as an elliptic integral, whose expansion in the amplitude θ0 is

T=T0(1+θ0216+11θ043072+)

with θ0 in radians. The numbers say when to worry. At 10 degrees the correction is 0.19 per cent. At 30 degrees it is 1.7 per cent, which for a 1 m pendulum means 2.041 s against 2.006 s, a clock losing twenty-five minutes a day if it were built wrong. At 90 degrees the exact ratio is 1.180, and the two-term series gives 1.176, so even the correction needs correcting. As the amplitude approaches 180 degrees the period diverges, which is the separatrix asserting itself: at 179 degrees the true period is 3.90 times the small-swing value, while the series predicts 1.95 and is simply wrong.

This is the general shape of the relationship between a nonlinear system and its linearisation. The linear answer is exact in the limit, useful over a surprisingly wide range, and qualitatively false near the interesting boundary.

Predator and prey

Vito Volterra wrote the classic nonlinear system in 1926, prompted by a question from his son-in-law Umberto D'Ancona about fish catches. Let x be prey and y predators:

x=ax-bxy,y=-cy+dxy

Prey grow exponentially when alone and are eaten at a rate proportional to encounters, which is the product xy; predators starve when alone and breed in proportion to the same product. Every term is a modelling decision and the product terms are what make the system nonlinear.

There are two equilibria. At the origin, the linearisation has fx=a>0 and gy=-c<0, so Δ=-ac<0: a saddle, and extinction of both is unstable, as it should be. The coexistence equilibrium is x*=c/d, y*=a/b, and there the partial derivatives are fx=0, fy=-bx*=-bc/d, gx=dy*=da/b, gy=0. So τ=0 and Δ=ac>0: a centre, with small oscillations of frequency ac.

Since it is a centre, the linearisation is inconclusive, and again a conserved quantity settles it. Dividing one equation by the other and separating gives

dx-clnx+by-alny=constant

whose level curves are closed loops around the equilibrium. So the oscillation is real, and predator and prey cycle indefinitely, the predator peak lagging the prey peak by a quarter of a cycle.

Example. Take a=0.6, b=0.02, c=0.4 and d=0.01, in units of per year. Find the coexistence equilibrium and the period of small oscillations about it.

The equilibrium is x*=c/d=40 prey and y*=a/b=30 predators. The frequency is ac=0.24=0.490 per year, so the period is 2π/0.490=12.8 years. That is the right order for the famous lynx and hare records from the Hudson's Bay Company, which cycle at about ten years, though those data need a better model than this one.

Now you. Take a=0.8, b=0.04, c=0.5, d=0.02. Find the equilibrium and the period.

Answer

x*=0.5/0.02=25 and y*=0.8/0.04=20. The frequency is 0.4=0.632 per year, so the period is 9.9 years.

Two results come out of this model that no amount of verbal reasoning would supply. The first is that the average of each population over one cycle equals its equilibrium value exactly, which follows from integrating x/x=a-by over a period: the left side integrates to zero because x returns to its starting value, so the average of y is a/b.

The second is Volterra's answer to D'Ancona. Harvest both species at rate h, subtracting hx and hy: the equilibrium moves to x*=(c+h)/d and y*=(a-h)/b. Fishing therefore raises the average number of prey and lowers the average number of predators, and stopping fishing does the reverse. D'Ancona's records showed exactly that: the share of predatory fish in the catch at Fiume rose from about 12 per cent before the First World War to 36 per cent in 1918, when Adriatic fishing had almost stopped, and fell back to about 11 per cent by 1923. The same logic warns that an insecticide killing both a pest and its predator can increase the pest's average population, which is a documented failure mode in agriculture.

The honest limit is severe. The centre depends on the model exactly as written. Add crowding among the prey, replacing ax by the logistic ax(1-x/K), and the centre becomes a stable spiral: the cycles damp out to a fixed point. Add a predation rate that saturates when prey are abundant, which is what real predators do, and the equilibrium can lose stability and throw off a stable cycle instead. Lotka-Volterra shows that predator-prey oscillation is possible without external forcing, and it is not evidence that any particular population cycles for that reason.

Limit cycles, and what a plane cannot do

The closed orbits above form a continuous family: each initial condition sits on its own loop, and a disturbance moves the system permanently to a neighbouring one. A real oscillator with a stable amplitude, such as a heartbeat or a clock escapement, does not behave that way: disturb it and the original amplitude comes back.

That requires a limit cycle, an isolated closed trajectory that nearby trajectories spiral onto. Van der Pol's equation, from his work on triode oscillators in the 1920s,

x′′-μ(1-x2)x+x=0

has one. Read the damping coefficient: -μ(1-x2) is negative for |x|<1, so small oscillations are pumped up, and positive for |x|>1, so large ones are damped. The system therefore settles onto one particular amplitude, near 2 for small μ, from any starting point except the origin. No linear system can do this, because scaling a solution of a linear system gives another solution, so amplitudes always come in continuous families.

There is also a strong negative result for the plane. The Poincaré-Bendixson theorem says that a trajectory of a two dimensional autonomous system that stays in a bounded region and does not approach an equilibrium must approach a closed orbit. So the plane permits equilibria and cycles and nothing more complicated. Everything wild needs at least three dimensions.

Where prediction ends

Three dimensions is where Edward Lorenz found the limit, in 1963, while truncating a convection model to three equations:

x=σ(y-x),y=x(ρ-z)-y,z=xy-βz

With σ=10, ρ=28 and β=8/3 the trajectory is bounded, never repeats, and never settles: it winds around a set of zero volume, the attractor. Every equilibrium is unstable, so the classification of the previous lesson tells you where the solution cannot go and nothing about where it does.

The consequential property is sensitivity to initial conditions. Two trajectories starting a distance ε apart separate roughly like εeλt, with λ0.9 per time unit for these parameters, so the gap doubles about every 0.77 time units. Uniqueness still holds, and the system is entirely deterministic; what fails is usefulness, since the initial state is never known exactly. Improving the initial measurement by a factor of a thousand buys only about ten more doubling times of accurate forecast. That is why weather forecasts degrade over days rather than being extended indefinitely by better computers, and why forecasting moved to ensembles: run many slightly different initial states and report the spread, which is a statement about probability rather than about trajectory.

Chaos does not make the differential equation useless. The attractor's shape, the statistics of the motion, and the parameter values where behaviour changes character are all robust and computable. It changes what a solution is for.

What a solution says

That is the end of the subject, so it is worth naming what has been extracted from equations along the way, since almost none of it was a formula.

An equilibrium is a state the system can hold, and its stability says whether the world will let it. The eigenvalues there give the timescales: how long a disturbance takes to die, and whether it oscillates on the way. A conserved quantity constrains a whole trajectory without solving anything, which is how the pendulum's separatrix and the predator-prey loops were found. A bifurcation marks a parameter value where the qualitative answer changes, which is what made the harvested fishery collapse without warning. A frequency response says which inputs a system will amplify, which is what made the machine on its mounts shake and the bridge fail. And a Lyapunov exponent says how long a prediction is worth making.

The formulas of the first half of the course are the special cases where all of this collapses into an expression, and they are worth having for exactly that reason: a system you can solve is a system whose every question is already answered. For everything else, the equation still tells you what it does, provided you ask it the questions in this list rather than demanding y(t).

Differential Equations, from libre.university