math.wiki
Calculus › Differential equations › Differential equations and their solutions
Open on the map
Calculus 1

Differential equations and their solutions

An equation says how fast something changes, not what it is. What does it mean for a function to solve such an equation, and how can a proposed answer be tested without solving anything?

Where you are 7 in Differential equations

When you reach for it

A differential equation is an equation that involves an unknown function and one or more of its derivatives. Three examples:

\begin{aligned} &xy' = 2y, \qquad y'' + 4y = 0, \\ &\frac{dT}{dt} = -0.1(T - 20). \end{aligned}

In each, the unknown is not a number but a function: y as a function of x, y as a function of t, the temperature T as a function of time t. Equations like these are how science states its laws, because a law usually says how fast something changes (a rate, with units and a sign) rather than what it equals.

Finding the unknown function can be hard, and later lessons build methods for it. Checking a proposed function is never hard: differentiate it, substitute, and see whether the equation becomes true. That check is the move of this lesson. Reach for it when a formula is offered and must be tested, when a family of solutions is known and the one member that starts at a given value is wanted, and when a form such as e^{rx} is guessed and the constants that make it work are wanted.

The procedure

Day 1: equations, order and solutions

The order of a differential equation is the order of the highest derivative that appears in it.

EquationHighest derivativeOrder
xy' = 2yy'1
y'' + 4y = 0y''2
\dfrac{dT}{dt} = -0.1(T - 20)\dfrac{dT}{dt}1
y''' = x\,y'y'''3

A function y = \varphi(x) is a solution of an equation of order n on an interval I if \varphi has derivatives up to order n on I and replacing y, y', \dots, y^{(n)} by \varphi, \varphi', \dots, \varphi^{(n)} makes the equation true for every x in I. The two phrases in bold carry the weight. The equation must become an identity, true at every point, not an equation that some value of x happens to satisfy. And a solution lives on an interval: a formula that breaks at a point gives separate solutions on each side of it.

To verify a proposed solution, compute the derivatives the equation uses, substitute them, and simplify each side separately until the two can be compared as functions. If they agree at every point of I, the function is a solution there. If they disagree at even one point of I, it is not. Each step is allowed for a plain reason: substitution is what “makes the equation true” means, and simplifying one side at a time never assumes the equality being tested.

A formula with an arbitrary constant, such as y = Ce^{5x} for y' = 5y, gives a family of solutions: one solution for each value of C. Each member has its own graph, a solution curve.

Day 2: general and particular solutions, initial value problems

A general solution is a formula with arbitrary constants that gives every solution on an interval. For the equations in this course a first-order equation has a general solution with one constant and a second-order equation one with two. A particular solution is one member of the family, with each constant given a number.

An initial condition is a known value of the unknown function, y(x_0) = y_0, and for a second-order equation also a known value of its derivative, y'(x_0) = v_0. A differential equation together with initial conditions is an initial value problem. A first-order problem takes one condition and a second-order problem two, one for each constant.

That an initial value problem has exactly one solution near x_0 is a theorem that needs hypotheses on the equation; it is stated here without proof, and Boundaries shows what happens when the hypotheses fail. In the same way, when this lesson quotes a general solution of a second-order equation, the claim that it contains every solution is stated without proof. Verification proves only the easier half: every member of the family is a solution.

The simplest equations have the form y' = f(x), where the right side does not involve y. Their solutions are exactly the antiderivatives of f, so the general solution is \int f(x)\,dx, and an initial condition picks one member, as in Antiderivatives and indefinite integrals.

When a form with an unknown constant is guessed, such as y = e^{rx}, substitute it with the constant left as a letter. The equation has to hold for every x, and that forces an equation on the constant.

Worked examples

Example 1

Day 1: a family through the origin

(a) State the order of xy' = 2y. (b) Show that y = Cx^2 is a solution on (-\infty, \infty) for every constant C. (c) Is y = x^3 a solution?

Solution

(a) The only derivative in the equation is y', so the equation is first order.

(b) The equation uses y', and y' = 2Cx. Substitute into each side separately:

\begin{aligned} \text{left: } & x \cdot 2Cx = 2Cx^2, \\ \text{right: } & 2 \cdot Cx^2 = 2Cx^2. \end{aligned}

The two sides agree for every x, whatever C is, so every y = Cx^2 is a solution on (-\infty, \infty). Figure 1 shows several members of this family.

−2 2 1 x y C = 2 C = 1 C = 1/2 C = −1/2 C = −1
Figure 1Members of the family y = Cx^2, every one a solution of xy' = 2y (Example 1). The x-axis is the member C = 0. Every curve passes through the origin and none through (0, 1), so the initial condition y(0) = 0 has infinitely many solutions and y(0) = 1 has none (Boundaries).

(c) Here y' = 3x^2, so the left side is x \cdot 3x^2 = 3x^3 and the right side is 2x^3. They are equal only when x^3 = 0, that is at x = 0. The equation is true at one point and false at every other, so y = x^3 is not a solution on any interval.

Example 2

Day 1: a second-order family

Show that y = A\cos 2t + B\sin 2t solves y'' + 4y = 0 for all constants A and B, and that y = \cos t does not.

Solution

The equation uses the Second and higher derivatives, so differentiate twice. By the chain rule, each derivative of \cos 2t or \sin 2t brings out a factor of 2:

\begin{aligned} y' &= -2A\sin 2t + 2B\cos 2t, \\ y'' &= -4A\cos 2t - 4B\sin 2t. \end{aligned}

Then y'' = -4\left(A\cos 2t + B\sin 2t\right) = -4y, so y'' + 4y = 0 for every t. This is a family with two free constants, as a second-order equation leads one to expect.

For y = \cos t, y'' = -\cos t and y'' + 4y = 3\cos t. That is zero only where \cos t = 0, isolated points, so \cos t is not a solution on any interval.

Example 3

Day 1: where a solution lives

Show that y = \dfrac{1}{C - x} solves y' = y^2 for each constant C. On what intervals is the member with C = 2 a solution? Is y = 0 a solution, and is it in the family?

Solution

Write y = (C - x)^{-1}. The chain rule gives

y' = -1 \cdot (C - x)^{-2} \cdot (-1) = \frac{1}{(C - x)^2},

and y^2 = \dfrac{1}{(C - x)^2} as well. The two sides agree at every x \ne C.

The member y = \dfrac{1}{2 - x} is undefined at x = 2, and its graph has a vertical asymptote there. A solution lives on an interval, so this formula gives two different solutions: one on (-\infty, 2) and one on (2, \infty). Nothing in the equation y' = y^2 itself breaks at x = 2; the break comes from the solution. That never happens with y' = f(x), where trouble can only come from f.

The constant function y = 0 has y' = 0 = 0^2, so it is a solution on (-\infty, \infty). It is not in the family, because \dfrac{1}{C - x} is never 0. A family of solutions need not contain every solution.

Example 4

Day 2: the simplest initial value problem

Solve the initial value problem \dfrac{dy}{dx} = 2x + \dfrac{8}{x^3}, y(2) = 1.

Solution

The right side does not involve y, so the solutions are the antiderivatives of 2x + 8x^{-3}. By the power rule for antiderivatives, 8 \cdot \dfrac{x^{-2}}{-2} = -4x^{-2}, and the general solution is

y = x^2 - \frac{4}{x^2} + C.

The right side of the equation is undefined at x = 0, so a solution lives on (0, \infty) or on (-\infty, 0). The initial point x = 2 lies in (0, \infty), so that is the interval. The condition gives

4 - 1 + C = 1, \qquad C = -2.

The solution is y = x^2 - \dfrac{4}{x^2} - 2 for x > 0. Check: y' = 2x + 8x^{-3} and y(2) = 4 - 1 - 2 = 1.

Example 5

Day 2: Nigar’s spring

A weight hangs at rest on a spring. Nigar lifts it and lets it go with a push. Its height above the rest position, y centimeters at time t seconds, satisfies y'' + 4y = 0, with y(0) = 3 and y'(0) = -4. Every solution of this equation has the form A\cos 2t + B\sin 2t (Example 2; that there are no others is stated without proof). Find y(t), and find the weight’s position and velocity at t = \dfrac{\pi}{4}.

Solution

From Example 2, y = A\cos 2t + B\sin 2t and y' = -2A\sin 2t + 2B\cos 2t. At t = 0 every sine is 0 and every cosine is 1:

y(0) = A = 3, \qquad y'(0) = 2B = -4, \quad B = -2.

So y = 3\cos 2t - 2\sin 2t, drawn in Figure 2. The position alone fixes only A: every curve 3\cos 2t + B\sin 2t starts at height 3, and they differ in their starting velocity. That is why a second-order problem needs a second condition.

π/2 π 3π/2 2π 3 −3 t y (0, 3)
Figure 2Nigar’s spring (Example 5): the one solution of y'' + 4y = 0 with y(0) = 3 and y'(0) = -4. The first condition fixes the starting point, the second the starting slope, drawn dashed.

At t = \dfrac{\pi}{4}, 2t = \dfrac{\pi}{2}, where cosine is 0 and sine is 1:

\begin{aligned} y\!\left(\tfrac{\pi}{4}\right) &= 3 \cdot 0 - 2 \cdot 1 = -2, \\ y'\!\left(\tfrac{\pi}{4}\right) &= -6 \cdot 1 + (-4) \cdot 0 = -6. \end{aligned}

About 0.79 seconds after release the weight is 2 centimeters below its rest position, moving down at 6 centimeters per second.

Example 6

Day 2: Aysel’s tea

Aysel’s tea sits in a room at 20 degrees Celsius. Its temperature T, in degrees Celsius, t minutes after it is poured, satisfies

\frac{dT}{dt} = -0.1(T - 20).

Ilkin proposes T = 20 + 70e^{-0.1t}. (a) Verify that it is a solution. (b) What initial condition does it meet? (c) How fast is the tea cooling at t = 0, and when its temperature is 55 degrees? (d) Which member of the family T = 20 + Ce^{-0.1t} fits tea poured at 85 degrees?

Solution

(a) The derivative of e^{-0.1t} is -0.1e^{-0.1t} by the chain rule, so the left side is \dfrac{dT}{dt} = -7e^{-0.1t}. On the right, T - 20 = 70e^{-0.1t}, so -0.1(T - 20) = -7e^{-0.1t}. The sides agree for every t.

(b) T(0) = 20 + 70 = 90: the tea was poured at 90 degrees.

(c) The equation gives the rate straight from the temperature, with no need to know the time. At t = 0, T = 90 and \dfrac{dT}{dt} = -0.1(70) = -7 degrees per minute: the temperature is falling 7 degrees each minute. At T = 55, \dfrac{dT}{dt} = -0.1(35) = -3.5 degrees per minute. The closer the tea is to room temperature, the more slowly it cools.

(d) The same computation with C in place of 70 shows that every member of the family is a solution. The condition T(0) = 85 gives 20 + C = 85, so C = 65 and T = 20 + 65e^{-0.1t}. Where an equation like this comes from, and how its solution is found rather than verified, is the subject of Exponential growth and decay models.

Example 7

Day 2: choosing the constant in a guess

(a) Find every number r for which y = e^{rx} solves y'' - y' - 6y = 0. (b) Show that y = C_1e^{3x} + C_2e^{-2x} is a solution for all constants C_1 and C_2. (c) Taking it as the general solution (stated without proof), solve the initial value problem with y(0) = 0 and y'(0) = 5.

Solution

(a) For y = e^{rx}, y' = re^{rx} and y'' = r^2e^{rx}. Substituting and factoring,

y'' - y' - 6y = e^{rx}\left(r^2 - r - 6\right).

This must be 0 for every x. Since e^{rx} > 0, that happens exactly when r^2 - r - 6 = 0, that is (r - 3)(r + 2) = 0. So r = 3 or r = -2.

(b) Here y' = 3C_1e^{3x} - 2C_2e^{-2x} and y'' = 9C_1e^{3x} + 4C_2e^{-2x}. Collect the terms in e^{3x} and in e^{-2x}:

\begin{aligned} &y'' - y' - 6y \\ &\quad = C_1e^{3x}(9 - 3 - 6) + C_2e^{-2x}(4 + 2 - 6) = 0. \end{aligned}

(c) At x = 0 both exponentials are 1, so the conditions give

C_1 + C_2 = 0, \qquad 3C_1 - 2C_2 = 5.

The first gives C_2 = -C_1; then 5C_1 = 5, so C_1 = 1 and C_2 = -1. The solution is y = e^{3x} - e^{-2x}. Check: y(0) = 0 and y'(0) = 3 + 2 = 5.

Boundaries

  • One point is not enough. A solution makes the equation true at every point of an interval. A function that satisfies it only at isolated points, such as x^3 for xy' = 2y, is not a solution.
  • Solutions live on intervals. A formula undefined at a point gives a separate solution on each side of it, and the initial point decides which one an initial value problem means (Examples 3 and 4).
  • A family may miss solutions. y = 0 solves y' = y^2 but is not of the form \dfrac{1}{C - x}. Calling a formula the general solution claims it has every solution, and that claim needs a theorem, not just a substitution.
  • An initial value problem can have no solution or many. For xy' = 2y, putting x = 0 into the equation gives 0 = 2y(0), so every solution has y(0) = 0. The condition y(0) = 1 has no solution, and y(0) = 0 has infinitely many, every Cx^2 (Figure 1). The uniqueness theorem asks for the equation in the form y' = F(x, y) with F well behaved near the initial point, and y' = \dfrac{2y}{x} is undefined at x = 0.
  • Two conditions for second order, and at one point. One condition leaves a family (Example 5). Two values of y at different points do not always work: for y'' + 4y = 0, y(0) = 0 forces A = 0, and then \displaystyle y\!\left(\frac{\pi}{2}\right) = B\sin\pi = 0, so \displaystyle y\!\left(\frac{\pi}{2}\right) = 1 is impossible.
  • Verifying is not solving. Substitution tests a candidate; it cannot produce one.

Where this goes next

Slope fields draws a differential equation as short segments of slope, so solution curves can be seen before any formula is known. Separable differential equations gives a method that finds solutions of many first-order equations, such as y' = y^2, and then fixes the constant from the initial condition exactly as here. Exponential growth and decay models solves the equation behind Aysel’s tea and the exponential models of growth and decay, Logistic growth studies growth with a ceiling, and Writing a differential equation from a description turns a sentence about a rate into an equation. When no formula can be found, Euler’s method follows the initial condition step by step. The equation s'(t) = v(t) with a starting position is an initial value problem of the simplest kind, and Position, displacement and distance from velocity uses it for motion. Equations y' = f(x) with trigonometric or exponential right sides need Antiderivatives of trig, exponential and log functions.

Exercises

Day 1: order and verification

  1. Give the order of each equation: (a) \dfrac{dy}{dx} = x^2 - y; (b) y''' + y' = 0; (c) (y')^2 = 4y; (d) \dfrac{d^2s}{dt^2} = -9.8.
  2. Show that y = Ce^{5x} solves y' = 5y for every constant C.
  3. Show that y = x - 1 + Ce^{-x} solves y' + y = x for every constant C.
  4. Show that y = A\cos 3t + B\sin 3t solves y'' + 9y = 0 for all constants A and B.
  5. Decide whether each function is a solution: (a) y = x^3 for xy' = 3y; (b) y = \sin x for y'' - y = 0; (c) y = \dfrac{1}{x} for y' = -y^2 on (0, \infty).
  6. Show that \displaystyle y = \sqrt{x^2 + C} solves yy' = x, and say where it is a solution.
  7. Show that y = C_1e^{2x} + C_2xe^{2x} solves y'' - 4y' + 4y = 0 for all constants C_1 and C_2.
  8. Ilkin tests y = x^2 in y' = y + x^2 - 2x at x = 2 and finds that both sides equal 4. Is y = x^2 a solution? Find every x at which the two sides agree.
  9. Show that y = \tan(x + C) solves y' = 1 + y^2, and give the largest interval containing x = -C on which it is a solution.

Day 2: initial value problems

  1. Using Exercise 3, find the solution of y' + y = x with y(0) = 4.
  2. Solve \dfrac{dy}{dx} = 6x^2 - 4x + 1, y(1) = 2.
  3. Solve \dfrac{dy}{dx} = 5x^{3/2}, y(1) = 0, for x > 0.
  4. Solve y'' = 12x, y(0) = 1, y'(0) = -3.
  5. Every solution of y'' + 9y = 0 has the form in Exercise 4. Find the one with y(0) = -2 and y'(0) = 6.
  6. Every solution of y'' - 4y' + 4y = 0 has the form in Exercise 7. Find the one with y(0) = 1 and y'(0) = 0.
  7. Using Exercise 9, solve y' = 1 + y^2, y(0) = 1, and give the interval on which the solution lives.

Day 2: constants and a spring

  1. Find the number k for which y = kx^2 solves xy' + y = 6x^2.
  2. Find every number r for which y = e^{rt} solves y'' + y' - 12y = 0.
  3. Find every number r for which y = x^r solves x^2y'' - 2xy' - 4y = 0 for x > 0.
  4. Aysel hangs a weight on a stiffer spring. Its height above rest, y centimeters after t seconds, satisfies y'' + 16y = 0, with y(0) = 0 and y'(0) = 12. Show that y = A\cos 4t + B\sin 4t is a solution for all A and B, find the one that meets the conditions (taking it to be the only one), and find the greatest height and the first time it is reached.

Reasoning

  1. Show that every solution of y'' = 0 on (-\infty, \infty) has the form y = C_1x + C_2. Describe all the solutions with y(0) = 1, and explain why a second condition is needed to pick one.
  2. Show that if y_1 and y_2 solve y'' + 4y = 0, then so does c_1y_1 + c_2y_2 for all constants c_1 and c_2. Then show that the same is false for y' = y^2, using y_1 = \dfrac{1}{1 - x} and 2y_1.
  3. Nigar says that y = \dfrac{1}{3 - x} is a solution of y' = y^2 on (0, 5), because the equation holds at every point of (0, 5) where the function is defined. Explain why it is not.
Answers
  1. (a) 1; (b) 3; (c) 1; (d) 2. The order is the highest derivative present; the square in (c) is a power of y', not a second derivative.
  2. y' = 5Ce^{5x} = 5y for every x.
  3. y' = 1 - Ce^{-x}, so y' + y = 1 - Ce^{-x} + x - 1 + Ce^{-x} = x.
  4. y'' = -9A\cos 3t - 9B\sin 3t = -9y, so y'' + 9y = 0.
  5. (a) Yes: x \cdot 3x^2 = 3x^3 = 3y. (b) No: y'' - y = -2\sin x, which is not 0 on any interval. (c) Yes: y' = -\dfrac{1}{x^2} = -y^2.
  6. By the chain rule \displaystyle y' = \dfrac{x}{\sqrt{x^2 + C}}, so yy' = x. It is a solution on any interval where x^2 + C > 0: all x when C > 0; x > 0 or x < 0 when C = 0; \displaystyle x > \sqrt{-C} or \displaystyle x < -\sqrt{-C} when C < 0.
  7. y' = (2C_1 + C_2)e^{2x} + 2C_2xe^{2x} and y'' = (4C_1 + 4C_2)e^{2x} + 4C_2xe^{2x}. In y'' - 4y' + 4y the e^{2x} terms give 4C_1 + 4C_2 - 8C_1 - 4C_2 + 4C_1 = 0 and the xe^{2x} terms give 4C_2 - 8C_2 + 4C_2 = 0.
  8. No. The left side is 2x and the right side is 2x^2 - 2x; they agree only where 2x^2 - 4x = 0, at x = 0 and x = 2. Agreement at isolated points is not a solution.
  9. y' = \sec^2(x + C) = 1 + \tan^2(x + C) = 1 + y^2. It is a solution on -\dfrac{\pi}{2} - C < x < \dfrac{\pi}{2} - C, where \tan(x + C) is defined.
  10. y = x - 1 + 5e^{-x}. At x = 0: -1 + C = 4, so C = 5.
  11. y = 2x^3 - 2x^2 + x + 1. The general solution is 2x^3 - 2x^2 + x + C, and 2 - 2 + 1 + C = 2.
  12. y = 2x^{5/2} - 2. The general solution is \displaystyle 5 \cdot \frac{2}{5}x^{5/2} + C = 2x^{5/2} + C, and 2 + C = 0.
  13. y = 2x^3 - 3x + 1. First y' = 6x^2 + C_1 with C_1 = -3, then y = 2x^3 - 3x + C_2 with C_2 = 1.
  14. y = -2\cos 3t + 2\sin 3t. y(0) = A = -2 and y'(0) = 3B = 6.
  15. y = e^{2x} - 2xe^{2x}. y(0) = C_1 = 1 and y'(0) = 2C_1 + C_2 = 0, so C_2 = -2.
  16. y = \tan\!\left(x + \dfrac{\pi}{4}\right) on -\dfrac{3\pi}{4} < x < \dfrac{\pi}{4}. \tan C = 1 with \displaystyle -\frac{\pi}{2} < C < \frac{\pi}{2} gives \displaystyle C = \frac{\pi}{4}, and the interval is the one in Exercise 9 that contains 0.
  17. k = 2. x \cdot 2kx + kx^2 = 3kx^2, which equals 6x^2 for every x exactly when 3k = 6.
  18. r = 3 or r = -4. Substituting gives e^{rt}(r^2 + r - 12) = 0, and r^2 + r - 12 = (r - 3)(r + 4).
  19. r = 4 or r = -1. With y' = rx^{r-1} and y'' = r(r - 1)x^{r-2} the left side is x^r\left(r^2 - r - 2r - 4\right) = x^r(r - 4)(r + 1).
  20. y'' = -16A\cos 4t - 16B\sin 4t = -16y. The conditions give A = 0 and 4B = 12, so y = 3\sin 4t. The greatest height is 3 centimeters, first reached when \displaystyle 4t = \frac{\pi}{2}, at t = \dfrac{\pi}{8} seconds, about 0.39 seconds.
  21. If y'' = 0, then y' has derivative 0 on the interval, so y' is a constant C_1; then y and C_1x have the same derivative, so y = C_1x + C_2. The condition y(0) = 1 gives C_2 = 1 and leaves C_1 free: every line y = C_1x + 1 through (0, 1), one for each slope. A second condition, such as a value of y'(0), fixes the slope.
  22. By the sum and constant multiple rules for derivatives, (c_1y_1 + c_2y_2)'' + 4(c_1y_1 + c_2y_2) equals c_1(y_1'' + 4y_1) + c_2(y_2'' + 4y_2), which is c_1 \cdot 0 + c_2 \cdot 0 = 0. For y' = y^2, 2y_1 = \dfrac{2}{1 - x} has derivative \dfrac{2}{(1 - x)^2}, while its square is \dfrac{4}{(1 - x)^2}. The equation is not linear in y, so multiples of solutions need not be solutions.
  23. A solution must be a function defined at every point of the interval, with a derivative there. \dfrac{1}{3 - x} is undefined at x = 3, which lies in (0, 5). It gives two solutions, one on (0, 3) and one on (3, 5), but no solution on (0, 5).
unattributed · CC-BY-SA-4.0