Differential Equations and Initial-Value Problems
Learning Objectives
- Define a differential equation, its order, and what it means for a function to be a solution on an interval.
- Verify a candidate solution by substituting it into the equation and into the initial condition.
- Distinguish a general solution from a particular solution, and state what an initial-value problem adds.
- State the existence and uniqueness theorem with its hypotheses, and recognize an equation where the conclusion fails.
- Read a slope field, follow it with Euler's method, and judge the error of the result.
- Solve and use it for exponential growth, decay, doubling time, and half-life.
Context & Motivation
Many laws of change are stated as rates: a population grows in proportion to its size, a hot object loses heat in proportion to the temperature gap, a parameter vector moves against the gradient of a loss. A rate is a derivative, so the law is an equation containing the unknown function and its derivative. That is a differential equation, and solving it means finding the function whose rate of change obeys the law.
The simplest case, , is solved by antiderivatives (antiderivatives-and-initial-value-problems). Here the right-hand side may depend on itself, so the answer is no longer one integral away. This lesson sets up the vocabulary, the substitution check used on every solution that follows, the theorem on when an answer exists and is unique, and the first model, exponential growth and decay. The next lesson, separable-differential-equations, solves a whole class of such equations.
Core Theory
Equations, order, and solutions
An ordinary differential equation (ODE) relates an unknown function of one variable to its derivatives. Its order is the highest derivative that appears: is first order, is second order.
A solution on an interval is a differentiable function that turns the equation into a true identity for every . The interval is part of the answer: a formula can solve the equation on one interval and be meaningless on another.
The reliable test of a solution is substitution: put the candidate and its derivatives into the equation and check that both sides agree for every in the interval, that is, that the residual simplifies to . It works however the candidate was found, so it is the last step of every problem below.
General and particular solutions, initial-value problems
For a first-order equation, solutions usually come as a family with one arbitrary constant. For , every function works: . This is a general solution. A particular solution fixes the constant. A second-order equation typically needs two constants, one per order.
An initial-value problem (IVP) pairs the equation with conditions that fix the constants: for a first-order equation, . For , gives and . The condition is part of what you must verify.
A general solution is not a guarantee that no other solution exists; Example 2 has one outside its family.
Existence and uniqueness
Consider the IVP , .
Theorem (Picard and Lindelöf). Suppose and are both continuous on an open rectangle in the plane that contains . Then there is some interval around on which the IVP has a solution, and two solutions agree on every interval containing on which both stay in the rectangle.
The theorem is local: it guarantees a solution near , not for all . And uniqueness is guaranteed by the second hypothesis (sufficient, not necessary: has no at , yet each of its IVPs has one solution). With only continuous, a solution exists but uniqueness can fail. Both failures appear below. A consequence used later: when the hypotheses hold everywhere, two different solution curves never touch, since touching would mean two solutions through one point.
Slope fields and Euler's method
The equation assigns a slope to every point . Draw a short segment with that slope at each point and you have a slope field (also called a direction field). A solution curve is one that is tangent to the segments everywhere it passes. For the slopes at a few points are:
textslope = t - y t=0 t=1 t=2 t=3 t=4 y = 3 -3 -2 -1 0 1 y = 2 -2 -1 0 1 2 y = 1 -1 0 1 2 3 y = 0 0 1 2 3 4 y = -1 1 2 3 4 5
The slope is along the line , negative above it and positive below it. A solution that starts above that line falls until it meets the line, then rises.
Euler's method turns the picture into an algorithm: from , follow the local slope for a step :
It is the tangent-line approximation applied repeatedly. The error at a fixed time shrinks roughly in proportion to (it is a first-order method), and in general it does not vanish for a fixed .
Exponential growth and decay
Suppose a quantity changes at a rate proportional to its size: , , with constant. The function solves it. To see that it is the only solution, let be any solution on an interval and compute
A function whose derivative is zero on an interval is constant there (a consequence of the Mean Value Theorem, the-mean-value-theorem-and-monotonicity), so , and the initial condition gives . The word "interval" matters: on a domain such as , which has two pieces, the constant may differ on each piece.
For this is growth with doubling time . For it is decay with half-life . Both are independent of the starting amount, which is the signature of exponential change.
Worked Examples
Example 1: verifying a solution, and its interval
Check that solves , .
Both sides agree, so the formula solves the equation wherever it is defined and differentiable, which is , a set with two pieces. It meets on the piece containing . The solution of the IVP through lives on , the piece that contains . A numerical integration agrees (, ) and runs away to infinity as .
This is the locality in the theorem: and are continuous on the whole plane, yet the solution blows up in finite time.
Example 2: when uniqueness fails
Consider , , with the real cube root. The function is a solution: both sides are . The function also is: and for every real , and . So one IVP has two solutions.
There are many more. For any , take for and for : the second piece has derivative at , matching the first, so the glued function solves the equation. A solution can sit at as long as it likes and then lift off.
The theorem explains it. Here is continuous, but is undefined at and unbounded near it (it is at and at ). The second hypothesis fails at exactly the initial point. Also, the family never equals the zero function, so lies outside that "general solution".
Example 3: Euler's method against the exact solution
Take , . The function solves it: and , and . With , Euler gives:
textt Euler y exact y 0.0 1.0000 1.0000 0.5 0.5000 0.7131 1.0 0.5000 0.7358 1.5 0.7500 0.9463 2.0 1.1250 1.2707
The error at is . Halving the step gives errors at of (), (), and (): each halving of roughly halves the error.
Example 4: Euler's method is gradient descent
Minimize by gradient descent with step size : . This is exactly Euler's method applied to the gradient flow , whose solution is (see gradients-extending-derivatives-to-several-variables for the gradient in several variables). Starting from :
texth factor 1-10h x_0..x_5 0.05 0.5 1, 0.5, 0.25, 0.125, 0.0625, 0.0312 0.15 -0.5 1, -0.5, 0.25, -0.125, 0.0625, -0.0312 0.20 -1.0 1, -1, 1, -1, 1, -1 0.25 -1.5 1, -1.5, 2.25, -3.375, 5.0625, -7.5938
The true flow decays monotonically, but Euler's iterates converge only when , that is . At the iterates converge while flipping sign, so they do not follow the flow at all; at they diverge. A step that is too large breaks the discretization even though the continuous equation is perfectly well behaved.
Example 5: half-life
A substance decays with a half-life of days (a hypothetical value). Then and . After days the fraction left is , about . The time to fall to solves , so days. Substitution check: .
Common Misconceptions & Pitfalls
- "A solution is a number." It is a function, and it comes with an interval. Example 1's formula is also defined for , but that branch is a different solution and does not satisfy .
- "A smooth equation has solutions for all time." The theorem is local, and blows up.
- "An IVP always has exactly one solution." It does, on some interval around , when and are continuous near the initial point. Drop the second condition and Example 2 can appear.
- "The general solution lists every solution." It lists the family you get from the usual method. Check for solutions outside it, as the next lesson does systematically.
- "A smaller Euler step is always safer, a larger one only less accurate." Too large a step can make the iteration unstable, as in Example 4.
- Checking the formula but not the initial condition. A function can satisfy the equation and miss , so it solves a different IVP.
Summary
A solution of a differential equation is a function on an interval that turns the equation into an identity, tested by substitution. A first-order general solution carries one constant, which an initial condition fixes. If and are continuous near , the IVP has a unique solution on some interval around , but only locally, and without the second hypothesis uniqueness can fail (). Slope fields show the solution curves and Euler's method follows them in steps, with error proportional to and instability for large , which is why gradient descent has a step-size limit. The equation has the unique solution , with doubling time or half-life .