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

Differential equations and separation of variables

A differential equation links a function to its rate of change. When dy/dx is a function of x times a function of y, put all the y's on one side and all the x's on the other, take antiderivatives, and you get an implicit formula for the solution. The arbitrary constant gives a whole family of solutions; a starting value picks one. Watch for solutions lost by dividing, and for places where the equation is undefined.

You need this first

Full reading path (13 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)
On this page · 7 sections
  1. The simplest kind
  2. A first real example
  3. The general method
  4. Remarks on constants and lost solutions
  5. A geometric example
  6. Curves at right angles
  7. Summary

The lecture first corrects a sign from last time: the two constants in the sin⁡xcos⁡x\sin x\cos x example satisfy c2−c1=12c_2 - c_1 = \tfrac12, as on the antiderivatives page (transcript, p. 1). Then it ends the unit on applications of differentiation with a first taste of differential equations, a whole course of their own (18.03), and one method that fits the differentials of the last lecture exactly.

The simplest kind#

The simplest differential equation is dy/dx=f(x)dy/dx = f(x). Its solution is the antiderivative, y=∫f(x) dxy = \int f(x)\,dx, and for this lecture that counts as solved (transcript, p. 1; notes, p. 1). Written with differentials it is dy=f(x) dxdy = f(x)\,dx, and integrating both sides gives the same thing (p. 5).

A first real example#

Now the rate of change depends on yy as well as xx (transcript, pp. 1–3; notes, pp. 1–2):

Example 2
dydx+xy=0,that isdydx=−xy\frac{dy}{dx} + xy = 0, \quad\text{that is}\quad \frac{dy}{dx} = -xy
In words

d y over d x plus x y equals 0, that is d y over d x equals minus x y

Source: 18.01 Lecture 16 transcript, pp. 1–2

(The operator ddx+x\frac{d}{dx} + x is called the annihilation operator in quantum mechanics, where this equation describes the ground state of the harmonic oscillator, pp. 1–2.) The trick is to separate the variables: divide by yy and multiply by dxdx, so all the yy's are on the left and all the xx's on the right. Then take antiderivatives of both sides (p. 2; notes, p. 1):

Separate and integrate
dyy=−x dx  ⇒  ln⁡∣y∣=−x22+c  ⇒  y=a e−x2/2\frac{dy}{y} = -x\,dx \;\Rightarrow\; \ln|y| = -\frac{x^2}{2} + c \;\Rightarrow\; y = a\,e^{-x^2/2}
In words

d y over y equals minus x d x which gives log the absolute value of y equals minus x squared over 2 plus c which gives y equals a e to the power minus x squared over 2, end of power

Exponentiating gives ∣y∣=ece−x2/2|y| = e^c e^{-x^2/2}, so y=±ece−x2/2y = \pm e^c e^{-x^2/2}; together with y=0y = 0 (below), that is every constant aa, positive, negative or zero (transcript, pp. 2–4). Check by differentiating: ddx(ae−x2/2)=a(−x)e−x2/2=−xy\frac{d}{dx}\big(ae^{-x^2/2}\big) = a(-x)e^{-x^2/2} = -xy (p. 3). This bell-shaped function is also the normal distribution of probability (p. 3).

Four members of the family y=ae−x2/2y = a e^{-x^2/2}, the solutions of dy/dx=−xydy/dx = -xy, drawn from the formula. A starting value y(0)y(0) picks the member: y(0)=ay(0) = a.

The general method#

The method works whenever the equation has the form (transcript, p. 3; notes, p. 2)

Separable equation
dydx=f(x) g(y)  ⇒  dyg(y)=f(x) dx  ⇒  H(y)=F(x)+c\frac{dy}{dx} = f(x)\,g(y) \;\Rightarrow\; \frac{dy}{g(y)} = f(x)\,dx \;\Rightarrow\; H(y) = F(x) + c
In words

d y over d x equals f(x) g(y) which gives d y over g(y) equals f(x) d x which gives H(y) equals capital F (x) plus c

where H(y)=∫dy/g(y)H(y) = \int dy/g(y) and F(x)=∫f(x) dxF(x) = \int f(x)\,dx, functions of different variables. The separation step is the only clever one, and it works because Leibniz's notation lets you treat differentials like ordinary numbers (p. 3). H(y)=F(x)+cH(y) = F(x) + c is an implicit equation for yy. To make it explicit, invert: y=H−1(F(x)+c)y = H^{-1}(F(x) + c). The inverse is often messy, so the implicit form is sometimes left as it is (p. 3). In Example 2, f(x)=−xf(x) = -x, g(y)=yg(y) = y, H(y)=ln⁡∣y∣H(y) = \ln|y| and F(x)=−x2/2F(x) = -x^2/2 (transcript, p. 3; the notes, p. 2, print f(x)=xf(x) = x, dropping the minus sign).

Remarks on constants and lost solutions#

The lecture adds three remarks, and then redoes dy/dx=f(x)dy/dx = f(x) by separation, as in the first section (transcript, pp. 4–6):

  • Lost solutions. Dividing by yy assumed y≠0y \ne 0, so the method misses the boring but genuine solution y=0y = 0. Whenever you divide by something, check what happens if it is zero.
  • One constant is enough. Writing ln⁡∣y∣+c1=−x2/2+c2\ln|y| + c_1 = -x^2/2 + c_2 gives nothing new: c2−c1c_2 - c_1 is just one constant.
  • The constant changes shape. It is additive right after integrating, but after a nonlinear step such as exponentiating it becomes a multiplying constant, and in general it can end up anywhere in the formula.

The family y=ae−x2/2y = ae^{-x^2/2} is the general solution. Extra information about the values, not the rate of change, picks out one member: if y(0)=3y(0) = 3, then ae0=3a e^0 = 3, so y=3e−x2/2y = 3e^{-x^2/2} (pp. 5–6). Differential equations in applications usually express a balance, for example between the acceleration and the air resistance of a falling object (p. 6).

Worked example

Half-lives

The amount NN of a radioactive isotope obeys dN/dt=−λNdN/dt = -\lambda N, and it halves every 8.0 days. Find N(t)N(t), λ\lambda, and the fraction left after 24 days.

Separate

dN/N=−λ dtdN/N = -\lambda\,dt, so ln⁡N=−λt+c\ln N = -\lambda t + c and N=N0e−λtN = N_0 e^{-\lambda t}, where N0=N(0)N_0 = N(0).

Rate

e−λ⋅8.0=12e^{-\lambda \cdot 8.0} = \tfrac12 gives λ=ln⁡2/8.0≈0.0866\lambda = \ln 2/8.0 \approx 0.0866 per day.

After 24 days

24 days is three half-lives: N/N0=e−3ln⁡2=(12)3=18N/N_0 = e^{-3\ln 2} = (\tfrac12)^3 = \tfrac18.

A geometric example#

Find curves whose tangent line, at every point, is twice as steep as the ray from the origin to that point (transcript, pp. 7–8; notes, p. 3). The ray to (x,y)(x, y) has slope y/xy/x, so

Example 3
dydx=2yx  ⇒  dyy=2 dxx  ⇒  ln⁡∣y∣=2ln⁡∣x∣+c  ⇒  y=ax2\frac{dy}{dx} = \frac{2y}{x} \;\Rightarrow\; \frac{dy}{y} = \frac{2\,dx}{x} \;\Rightarrow\; \ln|y| = 2\ln|x| + c \;\Rightarrow\; y = a x^2
In words

d y over d x equals 2 y over x which gives d y over y equals 2 d x over x which gives log the absolute value of y equals 2 log the absolute value of x plus c which gives y equals a x squared

Source: 18.01 Lecture 16 transcript, pp. 7–8

The solutions are parabolas, opening up or down, plus y=0y = 0. Check: dy/dx=2ax=2ax2/x=2y/xdy/dx = 2ax = 2ax^2/x = 2y/x for every aa (p. 8). (The notes' list of examples includes "y=−2y2y = -2y^2" where they mean y=−2x2y = -2x^2, notes, p. 3.)

A subtlety: the equation is undefined at x=0x = 0 (we divided by xx). The equation gives no slope there, so the value at x=0x = 0 does not fix the solution: a curve can come in along one half-parabola and leave along a different one. Think of the solutions as half-parabolas leaving the origin (pp. 8–9).

Curves at right angles#

Now find the curves that cross all those parabolas at right angles (transcript, pp. 9–10; notes, p. 4). Their slope is the negative reciprocal of the parabola's slope 2y/x2y/x:

Example 4
dydx=−x2y  ⇒  2y dy=−x dx  ⇒  y2=−x22+c  ⇒  x22+y2=a2\frac{dy}{dx} = -\frac{x}{2y} \;\Rightarrow\; 2y\,dy = -x\,dx \;\Rightarrow\; y^2 = -\frac{x^2}{2} + c \;\Rightarrow\; \frac{x^2}{2} + y^2 = a^2
In words

d y over d x equals minus x over the quantity 2 y, which gives 2 y d y equals minus x d x which gives y squared equals minus x squared over 2 plus c which gives x squared over 2 plus y squared equals a squared

This time not every constant works: cc must be positive, so write it as a2a^2. The curves are ellipses, with horizontal semi-axis 2 a\sqrt2\,a and vertical semi-axis aa: a little wider than they are high (p. 9). (The notes say the ratio of the axes is 2; it is 2\sqrt2, notes, p. 4.)

Solved explicitly, y=±a2−x2/2y = \pm\sqrt{a^2 - x^2/2}: an ellipse is not a function, so each solution is a top half or a bottom half. Each one stops at y=0y = 0, where x=±2 ax = \pm\sqrt2\,a and the slope −x/(2y)-x/(2y) is infinite: the equation itself predicts a vertical tangent there (p. 10). Before, we had to add solutions back; here some constants give none at all.

Worked example

A solution that runs out

Solve dy/dx=y2dy/dx = y^2 with y(0)=1y(0) = 1. For which xx does the solution make sense?

Separate

dy/y2=dxdy/y^2 = dx, so −1/y=x+c-1/y = x + c. At x=0x = 0, y=1y = 1 gives c=−1c = -1, so y=11−xy = \dfrac{1}{1 - x}.

Check and interpret

dy/dx=1(1−x)2=y2dy/dx = \dfrac{1}{(1 - x)^2} = y^2. The solution grows faster and faster and becomes infinite at x=1x = 1, although the equation itself looks harmless everywhere. So the solution makes sense only for x<1x < 1, the interval around the starting point where it stays finite. Separation finds such solutions, but you have to read off where they live.

The lecture ends with a short review for the second exam, of six topics: linear and quadratic approximations, sketching y=f(x)y = f(x), maximum and minimum problems, related rates, antiderivatives and separation of variables, and the mean value theorem (transcript, p. 10; notes, p. 4). It sums up the unit with its main theme: information about the derivative, and sometimes the second derivative, tells you about the function itself, from approximations at the start of the unit to differential equations at its end (transcript, p. 10).

Summary#

  • dy/dx=f(x)dy/dx = f(x) is solved by an antiderivative. For dy/dx=f(x) g(y)dy/dx = f(x)\,g(y), separate: dy/g(y)=f(x) dxdy/g(y) = f(x)\,dx, integrate to H(y)=F(x)+cH(y) = F(x) + c, and invert if you can.
  • Example: dy/dx=−xydy/dx = -xy gives y=ae−x2/2y = ae^{-x^2/2} for every constant aa; y(0)y(0) fixes aa.
  • One constant is enough, and after exponentiating it multiplies instead of adding.
  • Dividing can lose solutions (y=0y = 0); points where the equation is undefined (x=0x = 0, y=0y = 0) can make solutions branch or stop; and sometimes not every constant gives a solution.
  • Geometry: curves whose tangent is twice as steep as the ray from the origin are the parabolas y=ax2y = ax^2; the curves at right angles to them are the ellipses x2/2+y2=a2x^2/2 + y^2 = a^2.

Symbols on this page

Show the 29 symbols used here
λ\lambda lambda.
The decay rate in dN/dt = −λN; λ = ln 2 divided by the half-life. Unit: 1/s (here per day). Say it: “lambda”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
⇒\Rightarrow implies.
Implies: what follows is a consequence of what came before. Say it: “which gives”.
±\pm plus or minus.
Plus or minus: both signs, or an uncertainty (67.3 ± 1.2). Say it: “plus or minus”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot 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 constant that labels a solution in a family (y = a e^(−x²/2), y = ax², or a² in the ellipses); in the cosmology note, a(t) is the scale factor of the universe. Say it: “a”.
HH H.
An antiderivative of 1/g(y), so H(y) = F(x) + c; H⁻¹ is its inverse. In the cosmology note, H is instead the Hubble rate ȧ/a. Say it: “H”.
cc c.
An arbitrary constant from taking antiderivatives. Say it: “c”.
xx x.
The independent variable. Say it: “x”.
yy y.
The unknown function of x that the differential equation describes. Say it: “y”.
tt t.
Time: in days in the half-life example; in the cosmology note, cosmic time. Say it: “t”.
dd d.
As in dy, dx and dt: a differential, an infinitesimally small change; dy/dx is the derivative. Say it: “d”.
ee e.
Euler's number, e ≈ 2.718, the base of the exponential. Say it: “e”.
ff f.
The function of x in a separable equation dy/dx = f(x) g(y). Say it: “f”.
gg g.
The function of y in a separable equation dy/dx = f(x) g(y). Say it: “g”.
FF F.
An antiderivative of f(x). Say it: “capital F”.
NN N.
The amount (number of nuclei) of a radioactive isotope. Say it: “N”.
a0a_{0} a nought.
The scale factor at t = 0. Say it: “a nought”.
a˙\dot{a} a dot.
The rate of change of a with time, ȧ = da/dt: how fast the scale factor grows. Say it: “a dot”.
F′F' F prime.
The derivative of F, equal to f. Say it: “capital F prime”.
c1c_{1} c one.
A constant on the y side of the integrated equation (or, at the start, the constant of ½ sin²x + c₁ from the last lecture). Say it: “c one”.
c2c_{2} c two.
A constant on the x side of the integrated equation (or, at the start, the constant of −½ cos²x + c₂ from the last lecture). Say it: “c two”.
N0N_{0} N nought.
The amount of the isotope at t = 0. Say it: “N nought”.
H′H' H prime.
The derivative of H, equal to 1/g(y). Say it: “H prime”.

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

Words on this page

Show the 44 words used here

New here

normal distribution.
The bell-shaped probability curve, highest at the average and falling off equally on both sides; it describes many sums of random effects.
general solution.
The whole family of solutions of a differential equation, written with free constants that starting values or boundary conditions then fix.

Also used

antiderivative.
A function whose derivative is the given function; any two antiderivatives differ only by a constant. Explained in Differentials and antiderivatives.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
differentiation.
Finding a derivative: working out how fast a function changes. Explained in The derivative: slope of the tangent line and rate of change.
differential equation.
An equation that links an unknown function to its derivatives; solving it means finding the function. Explained in Circular motion dynamics: worked problems.
differential.
A tiny change in a variable, such as dx, or the matching change in a function along its tangent line, dy = f′(x) dx. Explained in Differentials and antiderivatives.
integration.
Finding an integral: adding up very many small pieces, or finding an antiderivative. Explained in Differentials and antiderivatives.
rate of change.
How fast one quantity changes compared with another, often time: the change in the first divided by the change in the second. Explained in Rates of change and area under a graph.
operator.
A rule that acts on a function, vector or state and turns it into another one, such as 'take the derivative'. Explained in The chain rule and higher derivatives.
annihilation operator.
In quantum physics, an operator that removes one quantum of energy, or one particle, from a state. Explained in The harmonic oscillator with creation and annihilation operators.
ground state.
The state of a system with the lowest possible energy. Explained in The Bohr atom and spectral lines.
harmonic oscillator.
Anything that swings back and forth about a balance point with a restoring force proportional to how far it is pulled away, like a spring. Explained in The harmonic oscillator.
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.
inverse.
The thing that undoes another: a matrix times its inverse gives the identity matrix, as a function followed by its inverse gives back the start. Explained in Planes through three points, and matrices.
nonlinear.
Not linear: containing squares, products or other functions of the unknowns, so effects do not simply add. Explained in Resistive forces: drag and terminal velocity.
acceleration.
How fast velocity changes: the change in velocity in each unit of time. Explained in Rates of change and area under a graph.
tangent.
A straight line that touches a curve at a point and runs in the same direction as the curve there. Explained in Angles, radians and trigonometry.
parabola.
The U-shaped curve of y = ax² + bx + c, also the path of a thrown ball when air resistance is ignored. Explained in Quadratics and power laws.
ellipse.
An oval curve: the set of points whose distances from two fixed points, the foci, add up to the same total. Explained in Kepler's laws and orbits.
interval.
A stretch between two values or two moments; in maths, all the numbers between two end points. Explained in Time dilation, length contraction and the interval.
linear.
Of a relation or equation: using only first powers of the unknowns, so doubling the cause doubles the effect and effects simply add. Explained in Solving and rearranging formulas.
quadratic approximation.
Replacing a function near a point by the best-matching expression with squares and products of the small changes, using first and second derivatives. Explained in Linear and quadratic approximations.
related rates.
Problems in which several quantities change together, and differentiating the equation that links them links their rates of change. Explained in More max–min, and related rates.
mean value theorem.
If a function is smooth between two points, somewhere between them its slope equals its average slope over the whole interval. Explained in The mean value theorem and inequalities.
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.
second derivative.
The derivative of a derivative: how fast a rate of change itself is changing. Explained in Acceleration in one dimension.
Hubble rate.
How fast the universe expands: the rate at which distances between galaxies grow, as a fraction of their size, per unit of time. Explained in Towards the universe: will an expanding ball of matter stop?.
vacuum energy.
Energy that empty space itself carries, the same everywhere and unchanged as the universe expands. Explained in Dark energy and the accelerating universe.
inflation.
A proposed burst of enormously fast expansion in the first tiny fraction of a second, which made the universe smooth and flat. Explained in Inflation.
dark energy.
The unknown cause of the speeding up of the universe's expansion, acting like an energy of empty space that does not thin out. Explained in Dark energy and the accelerating universe.
cosmological constant.
A constant term Einstein added to his equations of gravity, equivalent to an energy density of empty space that never changes. Explained in Dark energy and the accelerating universe.
flat universe.
A universe with exactly the critical density, whose space has no curvature and which expands forever, ever more slowly. Explained in Open, closed and flat universes.

Academic

satisfy.
To make an equation or condition true.
transcript.
A written record of exactly what was said in a recorded lecture, word for word.
notation.
A system of symbols used to write ideas down briefly, such as dy/dx for a derivative.
implicit.
Of a function: given by an equation linking x and y, such as x² + y² = 1, not by a formula y = f(x).
explicit.
Of a function or equation: solved for the unknown, written as a formula y = f(x) that gives y directly.
messy.
In calculations, long and complicated, with many terms, though not hard in principle.
assumption.
Something accepted as true, without proof, so that an argument or calculation can proceed; to assume is to accept it so.
subtle.
Hard to notice or understand, though it matters; needing care.
read off.
To take a value directly from a graph, table or formula, without further calculation.
approximation.
Close to, but not exactly, the true value; an approximation is such a value or formula, chosen because it is simpler.
dominate.
To be the largest contribution, so that the others hardly matter.

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

39 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. Which equation can be solved by separating variables?
  2. The general solution of dy/dx=−xydy/dx = -xy is y=ae−x2/2y = a e^{-x^2/2}. Which aa gives y(0)=3y(0) = 3?
  3. Solving dy/dx=−xydy/dx = -xy by dividing by yy misses which solution?
  4. An isotope's amount obeys dN/dt=−λNdN/dt = -\lambda N and halves every 8.0 days. What fraction is left after 24 days?
0 of 4 answered

Flashcards

1 / 3