BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

First-order linear equations and integrating factors

A first-order linear equation is linear in y and y′: a(x)y′ + b(x)y = c(x), homogeneous if the right side is zero. Its standard linear form is y′ + p(x)y = q(x), and the sign of p matters. Such equations model conduction (Newton's law of cooling, dT/dt = k(T_e − T)), diffusion, mixing, radioactive decay and bank interest. They can always be solved: multiply both sides by the integrating factor u = e^(∫p dx), which turns the left side into (uy)′, then integrate. With constant k the temperature is T = e^(−kt)∫k T_e e^(kt) dt + Ce^(−kt): a steady-state part plus a transient that dies away because k > 0, so in the long run the initial condition does not matter.

You need this first

Full reading path (16 pages)
  1. The derivative: slope of the tangent line and rate of change (18.01)
  2. Limits and continuity (18.01)
  3. Derivatives of sine and cosine, and the product and quotient rules (18.01)
  4. The chain rule and higher derivatives (18.01)
  5. Implicit differentiation and the derivatives of inverse functions (18.01)
  6. Exponentials and logarithms: the number e and its derivatives (18.01)
  7. Linear and quadratic approximations (18.01)
  8. Curve sketching with the first and second derivative (18.01)
  9. Sketching strategy and maximum–minimum problems (18.01)
  10. More max–min, and related rates (18.01)
  11. A ring on a string, and Newton's method (18.01)
  12. The mean value theorem and inequalities (18.01)
  13. Differentials and antiderivatives (18.01)
  14. Differential equations and separation of variables (18.01)
  15. Direction fields, isoclines and integral curves (18.03)
  16. Euler's method and better numerical methods (18.03)
On this page · 5 sections
  1. Linear equations and the standard form
  2. Models
  3. The integrating factor
  4. Constant coefficients: steady state and transient
  5. Summary

After two lectures without solving a single equation, 18.03 now solves one of the most important kinds: the first-order linear equation, important because it can always be solved and because it turns up in many models (transcript, p. 1). With separation of variables it is one of the two basic methods.

Linear equations and the standard form#

A first-order equation is linear when it is linear in yy and y′y'; xx may appear in any way (transcript, pp. 1–2):

First-order linear equation
a(x) y′+b(x) y=c(x)a(x)\,y' + b(x)\,y = c(x)
In words

a(x) y prime plus b(x) y equals c(x)

like a linear equation a1y1+a2y2=ca_1y_1 + a_2y_2 = c in two variables. If the right side is zero it is homogeneous (p. 2). Dividing by a(x)a(x) gives the standard linear form (p. 2):

Standard linear form
y′+p(x) y=q(x)y' + p(x)\,y = q(x)
In words

y prime plus p(x) y equals q(x)

The equation could also be written in the general first-order form y′=−p(x)y+q(x)y' = -p(x)y + q(x), but this course always uses the linear form: getting the sign of pp wrong gives disastrously wrong answers (pp. 2–3).

Models#

Linear equations model temperature and concentration (conduction and diffusion), mixing, radioactive decay, bank interest, and some motion problems such as a rocket (transcript, pp. 3–4).

Conduction. A metal box with partly insulated walls sits in a water bath at temperature TeT_e; its inside has temperature TT. Heat flows in by conduction at a rate proportional to the temperature difference, Newton's law of cooling (pp. 4–6):

Newton's law of cooling
dTdt=k (Te−T)\frac{dT}{dt} = k\,(T_e - T)
In words

d capital T over d t equals k the quantity capital T sub e minus capital T

Write the difference this way round so that the conductivity kk is positive: if the outside is warmer, TT must rise (p. 6). An initial condition T(0)=T0T(0) = T_0 completes the problem (p. 6).

Diffusion. The same equation with concentrations: a salt solution of concentration CC inside a semi-permeable membrane, in a bath of concentration CeC_e, gives dC/dt=k1(Ce−C)dC/dt = k_1(C_e - C) (pp. 6–7). One equation handles both situations: that is the power of the method (pp. 7–8). In standard linear form the cooling law is dT/dt+kT=kTedT/dt + kT = kT_e, and if both kk and TeT_e are allowed to vary with time it is a general linear equation (p. 8).

The integrating factor#

To solve y′+py=qy' + py = q, multiply both sides by a function u(x)u(x) chosen so that the left side becomes the derivative of a product (transcript, pp. 9–10):

Choosing the integrating factor
uy′+puy=(uy)′ifu′=puuy' + puy = (uy)' \quad\text{if}\quad u' = pu
In words

u y prime plus p u y equals (u y) prime if u prime equals p u

Separating variables, du/u=p dxdu/u = p\,dx, so ln⁡u=∫p dx\ln u = \int p\,dx, and (pp. 10–11)

Integrating factor
u=e∫p(x) dxu = e^{\int p(x)\,dx}
In words

u equals e to the power the integral of p(x) d x

No arbitrary constant is needed: one integrating factor is enough (p. 11). The method (pp. 11–12): put the equation in standard linear form; find uu; multiply both sides by uu; then integrate, uy=∫uq dx+Cuy = \int uq\,dx + C. The common mistakes: not using the standard form, and forgetting to multiply the right side qq by uu (pp. 13–14).

Example 1. xy′−y=x3xy' - y = x^3. In standard form y′−1xy=x2y' - \frac1x y = x^2, so u=e−ln⁡x=1/xu = e^{-\ln x} = 1/x (pp. 12–13). Multiplying both sides, 1xy′−1x2y=x\frac1x y' - \frac{1}{x^2}y = x, and the left side is (yx)′\left(\frac{y}{x}\right)', which is worth checking with the product rule (pp. 12–13). Integrating, y/x=x22+Cy/x = \frac{x^2}{2} + C, so (p. 13)

Example 1
y=x32+Cxy = \frac{x^3}{2} + Cx
In words

y equals x cubed over 2 plus capital C x

(On x>0x > 0, where ln⁡x\ln x is defined. Mattuck hesitates between x3x^3 and x2x^2 on the right of the original equation; his working, with x2x^2 in the standard form, belongs to x3x^3, used here.)

Example 2. (1+cos⁡x) y′−(sin⁡x) y=2x(1 + \cos x)\,y' - (\sin x)\,y = 2x. In standard form p=−sin⁡x/(1+cos⁡x)p = -\sin x/(1 + \cos x), whose integral is ln⁡(1+cos⁡x)\ln(1 + \cos x), so u=1+cos⁡xu = 1 + \cos x, and multiplying by uu gives back the original equation (pp. 13–14). That is not wasted work: the left side is now known to be ((1+cos⁡x) y)′\big((1 + \cos x)\,y\big)' (p. 15). So (1+cos⁡x) y=x2+C(1 + \cos x)\,y = x^2 + C, and with y(0)=1y(0) = 1, C=2C = 2 (p. 15):

Example 2
y=x2+21+cos⁡xy = \frac{x^2 + 2}{1 + \cos x}
In words

y equals the quantity x squared plus 2, all over the quantity 1 plus cos x

valid on −π<x<π-\pi < x < \pi: the solution blows up at x=±πx = \pm\pi, where 1+cos⁡x=01 + \cos x = 0.

Constant coefficients: steady state and transient#

For the cooling law with constant kk, T′+kT=kTeT' + kT = kT_e; note the kk on the right, which units demand (transcript, p. 16). The integrating factor is ekte^{kt}, so (ektT)′=kTeekt(e^{kt}T)' = kT_e e^{kt} and (pp. 16–17)

Solution of the cooling law
T=e−kt∫k Te(t) ekt dt+C e−ktT = e^{-kt}\int k\,T_e(t)\,e^{kt}\,dt + C\,e^{-kt}
In words

capital T equals e to the power minus k t the integral of k capital T sub e (t) e to the power k t d t plus capital C e to the power minus k t

With an initial value it is cleaner to use a definite integral from 0 to tt, so that C=T0C = T_0 (p. 17). Because k>0k > 0, the term Ce−ktCe^{-kt} dies away as t→∞t \to \infty: it is the transient. What remains is the steady-state solution, the same whatever the initial temperature: in the long run the initial condition makes no difference (pp. 17–18).

Newton's law of cooling with Te=20T_e = 20 °C and k=0.05k = 0.05 per minute, computed from T=20+(T0−20)e−ktT = 20 + (T_0 - 20)e^{-kt}: whatever the starting temperature, the transient (T0−20)e−kt(T_0 - 20)e^{-kt} dies away and TT approaches the steady state 20 °C.
Worked example

A cooling cup of coffee

Coffee at 90 °C stands in a room at 20 °C and obeys Newton's law with k=0.05k = 0.05 per minute. Find T(t)T(t), the temperature after 20 minutes, and when it reaches 40 °C.

Solve

T′+0.05 T=0.05×20T' + 0.05\,T = 0.05 \times 20. With u=e0.05tu = e^{0.05t}: (e0.05tT)′=e0.05t(e^{0.05t}T)' = e^{0.05t}, so e0.05tT=20e0.05t+Ce^{0.05t}T = 20e^{0.05t} + C and T=20+Ce−0.05tT = 20 + Ce^{-0.05t}. T(0)=90T(0) = 90 gives C=70C = 70.

Numbers

T(20)=20+70e−1≈45.8T(20) = 20 + 70e^{-1} \approx 45.8 °C. T=40T = 40 when e−0.05t=2/7e^{-0.05t} = 2/7, t=ln⁡(3.5)/0.05≈25.1t = \ln(3.5)/0.05 \approx 25.1 minutes.

Summary#

Symbols on this page

Show the 35 symbols used here
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
±\pm plus or minus.
Plus or minus: both signs, or an uncertainty (67.3 ± 1.2). Say it: “plus or minus”.
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
∫\int integral.
Integral: the sum of infinitely many small pieces, such as the area under a curve. Say it: “the integral of”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
ln⁡\ln natural logarithm.
Natural logarithm (base e ≈ 2.718). Say it: “log”.
aa a.
The coefficient of y′ in a(x)y′ + b(x)y = c(x). Say it: “a”.
cc c.
The right-hand side c(x); also a constant. Say it: “c”.
kk k.
The conductivity: a positive rate constant. Say it: “k”.
TT T.
The temperature inside the box (or of the coffee). Unit: °C. Say it: “capital T”.
T0T_{0} temperature today.
The initial temperature. Unit: °C. Say it: “capital T nought”.
xx x.
The independent variable. Say it: “x”.
yy y.
The unknown function. Say it: “y”.
tt t.
Time. Say it: “t”.
dd d.
The d of dy, dx, dT/dt. Say it: “d”.
ee e.
Euler's number, 2.718…, the base of the exponential. Say it: “e”.
CC C.
An arbitrary constant; in the diffusion model, the salt concentration inside. Say it: “capital C”.
bb b.
The coefficient of y. Say it: “b”.
qq q.
The right-hand side in standard linear form. Say it: “q”.
pp p.
The coefficient of y in standard linear form. Say it: “p”.
y′y' y prime.
The derivative dy/dx. Say it: “y prime”.
a1a_{1} a one.
A coefficient in an ordinary linear equation. Say it: “a one”.
a2a_{2} a two.
A second coefficient in an ordinary linear equation. Say it: “a two”.
uu u.
The integrating factor e^(∫p dx). Say it: “u”.
y1y_{1} y 1.
A variable in an ordinary linear equation. Say it: “y one”.
y2y_{2} y 2.
A second variable in an ordinary linear equation. Say it: “y two”.
k1k_{1} first wavevector component.
The rate constant of diffusion. Say it: “k sub 1”.
u′u' u prime.
The derivative of the integrating factor. Say it: “u prime”.
T′T' T prime.
The derivative dT/dt. Say it: “capital T prime”.
TeT_{e} T sub e.
The external temperature (of the bath or the room). Unit: °C. Say it: “capital T sub e”.
CeC_{e} C sub e.
The salt concentration outside the membrane. Say it: “capital C sub e”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 25 words used here

New here

first-order linear equation.
A differential equation with only the first derivative, in which the unknown and its derivative appear only to the first power, never multiplied together.
linear.
The property that sums and multiples of solutions are again solutions, so the responses to separate inputs simply add.
standard linear form.
A first-order linear equation written as y′ + p(x)y = q(x), with the number in front of y′ divided out.
Newton's law of cooling.
The rule that a body's temperature changes at a rate proportional to the difference between it and its surroundings.
integrating factor.
A function an equation is multiplied by so that one side becomes an exact derivative; for a first-order linear equation, of a single product.

Also used

p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
separation of variables.
A way to solve a differential equation by putting everything with one variable on one side, the rest on the other, and integrating both sides. Explained in The rocket equation.
diffusion.
The slow spreading of a substance or of heat through a still medium, by random motion, from where there is more to less. Explained in The divergence theorem, its proof and the diffusion equation.
heat.
Energy that passes between bodies because their temperatures differ, rather than by one doing mechanical work on the other. Explained in Temperature and thermal energy.
proportional.
Of two quantities: always in the same ratio, so that doubling one doubles the other. Explained in Graphs, straight lines and slope.
conductivity.
How easily something flows through a material: electric current, for electrical conductivity, or heat, for thermal conductivity. Explained in Current, resistance and DC circuits.
initial condition.
The state of a system at the starting time, such as its position and speed, which picks out one solution of its equation. Explained in Introduction to first-order systems.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
integration.
Finding an integral: adding up very many small pieces, or finding an antiderivative. Explained in Differentials and antiderivatives.
product rule.
The rule for the derivative of a product of two functions: (fg)′ = f′g + fg′. Explained in Circular motion: tangential acceleration and angular acceleration.
integral.
A sum of very many very small pieces, such as the area under a graph; it undoes taking a derivative. Explained in Rates of change and area under a graph.
definite integral.
The integral of a function between two limits, a single number: the area under the graph between them, with parts below the axis counted negative. Explained in Definite integrals and Riemann sums.
transient.
The part of a system's response that dies away with time, leaving only the steady state. Explained in Driven oscillators and resonance.
steady state.
A condition that no longer changes with time, or for a driven system the lasting motion left once start-up effects die away. Explained in Driven oscillators and resonance.

Academic

model.
A simplified description of a real system, usually in equations, that keeps what matters and leaves out the rest.
transcript.
A written record of exactly what was said in a recorded lecture, word for word.
homogeneous.
Of a linear equation: with zero on the right-hand side, so that zero is a solution; its solutions form the homogeneous solution.
arbitrary.
Free to be chosen as one likes; any choice gives a correct result.
valid.
True or correctly applicable under the stated conditions.
blow up.
In maths, to grow without limit; to become infinite.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

31 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. Which is the standard linear form of xy′−y=x3xy' - y = x^3?
  2. The integrating factor for y′+p(x)y=q(x)y' + p(x)y = q(x) is…
  3. In Newton's law of cooling, dT/dt=k(Te−T)dT/dt = k(T_e - T) with k>0k > 0, what happens to the transient part of the solution?
0 of 3 answered

Flashcards

1 / 3