What Is a Differential Equation?
Learn what differential equations are, classify them by order and linearity, check proposed solutions, and use initial conditions to pick one solution.
Welcome back!
Step 1 of 13Learn
Laws written as rates
Most laws of nature don't tell you a quantity directly. They tell you how it changes.
- A population with plenty of food grows at a rate proportional to its size: dP/dt = kP.
- A hot drink cools at a rate proportional to how much hotter it is than the room: dT/dt = −k(T − T_room).
- Newton's second law says force equals mass times acceleration, and acceleration is the second derivative of position. For a mass on a spring, m·x″ = −k·x.
Each of these is a differential equation: an equation that relates an unknown function to its derivatives. Solving it means finding the function itself, the population, temperature or position over time, from the rule about its rate of change.
This idea is enormously powerful because rules about change are often simple and local even when the behavior they produce is complex. A planet's orbit, a vibrating guitar string, the spread of an epidemic and the price of a stock option all come from short equations like these.
An ordinary differential equation (ODE) has one independent variable, usually time t. When several independent variables appear, such as time and position, the equation involves partial derivatives and is a partial differential equation (PDE), like the heat equation. This course deals with ODEs, which are the foundation for everything else.
Step 2 of 13Diagram
From a law of change to a prediction
Every model in this course follows the same path. Tap each stage.
Tap a shape with to see more.
- Law about a rate
For example: a population grows at a rate proportional to its size.
- Differential equation
Translate the law into symbols: dP/dt = kP.
- General solution (a family)
P = C·e^(kt): one curve for every value of C.
- Initial condition
A measured starting value, such as P(0) = 500.
- Particular solution
P = 500·e^(kt): a single curve you can use to predict.
Step 3 of 13Learn
Order and linearity
Two classifications decide which solution methods apply.
Order is the highest derivative in the equation.
- y′ = 3y is first order.
- m·x″ + c·x′ + k·x = 0 is second order.
- y‴ + y = sin t is third order.
Linearity. An equation is linear if the unknown y and its derivatives appear only to the first power, are not multiplied by each other, and are not inside other functions like sin y or ey. The coefficients may depend on t in any way. The general linear second-order equation looks like
a(t)·y″ + b(t)·y′ + c(t)·y = g(t)
Examples:
- t2·y″ + et·y′ − y = cos t is linear (the t-dependence of the coefficients is fine).
- y′ = y2 is nonlinear (y is squared).
- y″ + sin y = 0, the exact pendulum equation, is nonlinear (y is inside sine).
- y·y′ = 1 is nonlinear (y times its own derivative).
A linear equation is homogeneous if g(t) = 0, so that y = 0 is a solution.
Linear equations have a beautiful theory: their solutions can be added and scaled, and there are general methods that always work. Nonlinear equations can show behaviors linear ones never do, such as solutions that blow up in finite time, multiple equilibria and chaos.
Step 4 of 13Practice · Sort into groups
Classify each equation as linear or nonlinear.
Tap an item, then tap its group (or drag it there).
Step 5 of 13Diagram
Sorting differential equations
The labels you just practiced decide which methods apply. Tap a branch for an example.
Tap a shape with to see more.
- Differential equations
- Ordinary (ODE)
One independent variable, usually time t. This course.
- Partial (PDE)
Several independent variables, such as the heat equation in space and time.
- By order
- By linearity
- First order
Highest derivative y′, e.g. y′ = 3y.
- Second order
Highest derivative y″, e.g. a spring m·x″ + k·x = 0.
- Linear
y and its derivatives appear only to the first power, never multiplied together or inside functions.
- Nonlinear
Terms like y2, y·y′ or sin y: the logistic and pendulum equations.
Step 6 of 13Learn
Checking a solution
You don't need to know how to solve an equation to check a proposed solution. Substitute it in and see whether both sides agree for all t.
Example 1. Is y = 5e^(−2t) a solution of y′ + 2y = 0?
y′ = −10e^(−2t), so y′ + 2y = −10e^(−2t) + 10e^(−2t) = 0. Yes.
In fact y = Ce^(−2t) works for any constant C. A formula with arbitrary constants that captures all solutions is called the general solution. A first-order equation typically has one constant, a second-order equation two.
Example 2. Is y = cos(3t) a solution of y″ + 9y = 0?
y′ = −3 sin(3t), y″ = −9 cos(3t). Then y″ + 9y = −9 cos 3t + 9 cos 3t = 0. Yes. So is sin(3t), and so is any combination C₁ cos 3t + C₂ sin 3t.
Example 3. Is y = t2 a solution of y′ = 2y/t? y′ = 2t, and 2y/t = 2t2/t = 2t. Yes, for t ≠ 0.
Common mistake: checking at only one point. A solution must satisfy the equation for every t in an interval. y = t satisfies y′ = y at t = 1 (both sides equal 1) but not anywhere else, so it is not a solution.
Step 7 of 13Practice · Choose one
Which function is a solution of y″ − y = 0?
Step 8 of 13Learn
Initial value problems
A general solution is a whole family of curves. To single out one, you need extra information, typically the state at a starting time. An equation together with such conditions is an initial value problem (IVP).
First order. Solve y′ = −2y with y(0) = 7. The general solution is y = Ce^(−2t). Setting t = 0: y(0) = C = 7. So y = 7e^(−2t).
Second order. Solve y″ + 9y = 0 with y(0) = 2 and y′(0) = 6. The general solution is y = C₁ cos 3t + C₂ sin 3t. At t = 0: y(0) = C₁ = 2. And y′ = −3C₁ sin 3t + 3C₂ cos 3t, so y′(0) = 3C₂ = 6, giving C₂ = 2. The solution is y = 2 cos 3t + 2 sin 3t.
Notice the pattern: a second-order equation needs two conditions, usually position and velocity at the start. Physically that makes sense. Knowing where a mass on a spring starts isn't enough; you also need to know how fast it's moving.
Initial conditions are not always at t = 0. If y(1) = 4 for y = Ce^(−2t), then 4 = Ce^(−2), so C = 4e2 and y = 4e^(2 − 2t).
Under mild conditions, which you'll meet later, an IVP has exactly one solution. That's what makes differential equations useful for prediction: the present state and the law of change determine the future.
Step 9 of 13Explore
One equation, a family of solutions
Every curve y = C·e^(kt) solves y′ = k·y. The initial value C = y(0) picks out one member of the family. Slide C to move between solutions, and change k to switch between growth and decay.
- y(1)
- 1.649
- y(3)
- 4.482
Step 10 of 13Practice · Work it out
Solve y′ = 3y with y(0) = 4. What is y(1)? Give your answer to one decimal place.
Step 11 of 13Note
Step 12 of 13Practice · Work it out
The general solution of y″ + 4y = 0 is y = C₁ cos 2t + C₂ sin 2t. If y(0) = 1 and y′(0) = 6, what is C₂?
Step 13 of 13Practice · True or false
A second-order differential equation generally needs two initial conditions to determine a unique solution.
Lesson complete!