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.

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?