Differential Equations / Unit 1, Differential Equations and Their Solutions / Topic 1.1
Unit 1. Differential Equations and Their Solutions
A differential equation is an equation that contains an unknown function and one or more of its derivatives. This topic covers what a differential equation says, what a solution is, how to check a solution, and how an initial condition selects one solution from a family of solutions.
You have already used differential equations in physics. The second law of Newton, F = ma, is a differential equation, because the acceleration is the second derivative of the position. The laws of radioactive decay, of cooling, and of electric circuits are differential equations as well. Most laws of physics give the rate at which a quantity changes. A rate of change is a derivative, so these laws are differential equations.
What you need for this topic: the derivatives of powers, exponential functions, sines, and cosines, the chain rule, and the integrals of powers.
In an equation of algebra, such as 2x + 1 = 7, the unknown is a number. In a differential equation, the unknown is a function. The equation gives a relation between the function and its derivatives, and the task is to find the function.
dy/dt = 2t dy/dt = yThe first equation asks for a function y(t) whose derivative is 2t. The second equation asks for a function that is equal to its own derivative at each time t.
The variable t is called the independent variable, and y is called the dependent variable, because the value of y depends on t. In this course the independent variable is usually the time t, and sometimes it is a position x. The derivative dy/dt is also written y′, and the second derivative d²y/dt² is written y″.
| Situation | Differential equation | What it says |
|---|---|---|
| An object falls without air resistance | dv/dt = −g | The velocity changes at a constant rate |
| A radioactive sample decays | dN/dt = −kN | The number of nuclei decreases at a rate that is proportional to the number that is left |
| A mass moves on a spring | m d²x/dt² = −kx | The mass times the acceleration is equal to the force of the spring |
A solution of a differential equation is a function that makes the equation true at each point of an interval when the function and its derivatives are substituted into the equation.
To check a solution, calculate the derivatives that the equation contains, substitute them, and compare the two sides. A solution can be checked without knowing how it was found.
The function is a solution.
The function is a solution.
The function is not a solution. The two sides are equal at two times only, and a solution must make the equation true at each point of an interval.
The solution of an equation of algebra is a number. The solution of a differential equation is a function. Solving a differential equation means finding a formula, a graph, or a table of values for the whole function.
A differential equation usually has many solutions. The equation y′ = 2t is solved by integration, and an integral contains a constant.
y′ = 2tthe equationy = t² + Cintegrate both sidesEach value of the constant C gives one solution: t², t² + 1, t² − 5, and so on. The formula with the constant is called the general solution, and the solutions together are called a family of solutions. A solution with a chosen value of the constant is called a particular solution.
The equation y′ = ky, with a constant k, also has a family of solutions. Its general solution is y = Cekt. The check has three lines.
y = Cektthe general solutiony′ = kCektthe derivative, by the chain ruley′ = k(Cekt) = kythe equation is satisfied for each value of CFor k = 1 this is the equation y′ = y, with the general solution y = Cet. Topic 2.1 shows how to find this general solution, and why the equation has no other solutions.
Try it: a family of solutions
The curves are solutions y = Cekt of the equation y′ = ky. The blue curve is the solution for the value of C that the slider sets. The red line is the tangent to the blue curve at the green point. Move the sliders, and compare the slope of the tangent with k times y.
The drawing shows what the equation y′ = ky says. At each point of each solution curve, the slope is k times the height. The equation gives the slope at each point. It does not select one curve, so each curve of the family is a solution.
The equation y″ = −4y contains a second derivative, and its general solution contains two constants, A and B.
y = A cos 2t + B sin 2tthe general solutiony′ = −2A sin 2t + 2B cos 2tthe first derivativey″ = −4A cos 2t − 4B sin 2tthe second derivativey″ = −4(A cos 2t + B sin 2t) = −4ythe equation is satisfied for all values of A and BIn general, an equation whose highest derivative is the second derivative has two constants in its general solution, and each higher derivative adds one more constant.
To select one solution from a family, an extra condition is needed. The most common condition gives the value of the function at one time, usually the starting time. It is called an initial condition. A differential equation together with its initial conditions is called an initial value problem.
The general solution has two constants, so two conditions are needed. The second condition gives the value of the derivative at the starting time.
y = A cos 2t + B sin 2tthe general solutiony′ = −2A sin 2t + 2B cos 2tits derivativey(0) = Asubstitute t = 0, with cos 0 = 1 and sin 0 = 0A = 1the condition y(0) = 1y′(0) = 2Bsubstitute t = 0 in the derivative2B = 6the condition y′(0) = 6B = 3divide both sides by 2y = cos 2t + 3 sin 2tthe solutionThe second law of Newton leads to the same kind of problem. The law is an equation for the second derivative of the position. The position and the velocity at the start are the two initial conditions, and together with the law they determine the whole motion.
Differential equations are classified by two properties, because the methods of solution depend on them.
The order of a differential equation is the order of the highest derivative in it. An equation with y′ and no higher derivative has the order 1 and is called a first order equation. An equation with y″ and no higher derivative is a second order equation.
A linear equation is one in which the unknown function and its derivatives appear only to the first power. They are not multiplied by each other, and they are not placed inside another function. The coefficients of a linear equation can depend on t. Any other equation is called nonlinear.
| Equation | Order | Kind | Reason |
|---|---|---|---|
| y′ = 3y | 1 | Linear | y and y′ appear to the first power |
| y″ + 4y = 0 | 2 | Linear | y and y″ appear to the first power |
| t y′ + y = cos t | 1 | Linear | The coefficient t and the term cos t contain only t |
| y′ = y² | 1 | Nonlinear | y is squared |
| y y′ = t | 1 | Nonlinear | y is multiplied by y′ |
| θ″ + sin θ = 0 | 2 | Nonlinear | The unknown function θ is inside a sine |
The last equation describes a pendulum. Linear equations have systematic methods of solution, which Units 2 to 5 teach. Most nonlinear equations cannot be solved with a formula, and Units 1, 6, and 7 teach how to study them with graphs and with numerical methods.
The equations of Units 1 to 9 have one independent variable. They are called ordinary differential equations. An equation for a function of several variables, such as a temperature that depends on the position and on the time, contains partial derivatives and is called a partial differential equation. Unit 10 introduces partial differential equations.
A sample contains 800 radioactive nuclei at the time t = 0. In each year, a fixed fraction of the nuclei that are present decays, so the rate of change of the number N is proportional to N. The constant of proportionality is k = 0.1 per year. The equation is of the first order, and it is linear. The unknown function is N(t), with t in years.
The half-life is the time in which the number falls to one half of its starting value.
800e−0.1t = 400one half of 800e−0.1t = 1/2divide both sides by 800−0.1t = ln(1/2) = −ln 2take the natural logarithm of both sidest = (ln 2)/0.1divide both sides by −0.1t = 6.93 yearswith ln 2 = 0.693The steps of this example are used again in each topic of the course: write the equation, classify it, find the general solution, use the initial conditions, and check the result.
| Idea | Statement |
|---|---|
| Differential equation | An equation that contains an unknown function and its derivatives |
| Solution | A function that makes the equation true at each point of an interval |
| General solution | The family of solutions, written with constants such as C |
| Initial condition | A value of the function, or of a derivative, at one time. It fixes a constant |
| Order | The order of the highest derivative in the equation |
| Linear equation | The unknown function and its derivatives appear only to the first power |
| y′ = ky | The general solution is y = Cekt |
Work each problem on paper first. Then open the answer to check your work.
y = e−2tthe functiony′ = −2e−2tthe derivative, by the chain ruley′ + 2y = −2e−2t + 2e−2tsubstitute into the left sidey′ + 2y = 0the equation is satisfied at each time t
The function is a solution.
y = t³the functiony′ = 3t²the derivativet y′ = t(3t²) = 3t³the left side3y = 3t³the right sidet y′ = 3ythe two sides are equal at each t
The function is a solution.
y′ = 6t²the equationy = 2t³ + Cintegrate both sides. This is the general solutiony(1) = 2 + Csubstitute t = 12 + C = 5the initial condition y(1) = 5C = 3subtract 2 from both sidesy = 2t³ + 3the solution
y = Ce4tthe general solution of y′ = ky, with k = 4y(0) = Csubstitute t = 0C = 7the initial condition y(0) = 7y = 7e4tthe solutiony(0.5) = 7e²substitute t = 0.5y(0.5) = 51.7with e² = 7.389
y″ + t y′ = et has the order 2 and is linear. The coefficient t and the term et contain only t.
y′ = sin y has the order 1 and is nonlinear, because y is inside a sine.
y‴ = y has the order 3 and is linear.
y y′ = t has the order 1 and is nonlinear, because y is multiplied by y′.
y = A cos 3t + B sin 3tthe general solutiony′ = −3A sin 3t + 3B cos 3tits derivativey(0) = Asubstitute t = 0A = 2the condition y(0) = 2y′(0) = 3Bsubstitute t = 0 in the derivative3B = −3the condition y′(0) = −3B = −1divide both sides by 3y = 2 cos 3t − sin 3tthe solution
This part shows how to do the calculations of this topic with Python. Python is a programming language that is widely used in science and engineering. You do not need to know any programming, and you do not need to install anything, because the code runs on this page.
Work through the steps in order. Each step explains the code before you run it. Press Run to run the code in a box. The result appears in the gray area under the box. Some steps ask you to change the code. Type in the box, press Run again, and the page tells you whether the result is correct. Press Reset to bring back the original code. The first run takes a few seconds, because the page has to load Python.
Python reads the code one line at a time, from the top to the bottom. The instruction print shows a result. The value to show goes inside the parentheses. The code in the box below adds two numbers and shows the sum. Press Run.
Python
The gray area shows 5. Python uses + for addition, - for subtraction, * for multiplication, / for division, and ** for a power. For example, 2 ** 3 is 2³, which is 8.
Now change the code in the next box so that it prints the product of 7 and 6. Replace the two numbers and the symbol between them. Then press Run.
Python
A name can store a value, so that the value can be used again on a later line. The equals sign stores the value on its right under the name on its left. In the code below, the second line stores the number 0.5 under the name t. The third line calculates 3e2t and stores the result under the name y. The last line prints it.
The exponential function ex is written as np.exp(x). The name np stands for NumPy. NumPy is the part of Python that contains the functions of mathematics. This page has already loaded it. Python does not understand 2t as a product. A multiplication must always be typed with the * sign.
A line that starts with # is a comment. Python skips comments. They are notes for the person who reads the code.
Python
The result is 8.154845485377136, which is 3e. Python shows many more decimal places than a calculator.
In the next box, change the code so that it calculates the same function at the time t = 1. The result should be 3e², which is about 22.167.
Python
A solution of a differential equation is a function, so one value is not enough. The instruction np.linspace(0, 1, 5) makes a list of 5 evenly spaced numbers from 0 to 1. When a name stores such a list, a calculation with the name is done for each number of the list. The code below calculates y = t² at five times.
Python
The first line of the result shows the times 0, 0.25, 0.5, 0.75, and 1. The second line shows the square of each time. Python prints a list in square brackets, with spaces between the numbers and no commas.
Now change the code so that the times go from 0 to 2. The list should then contain the times 0, 0.5, 1, 1.5, and 2.
Python
Part 2 checked solutions with calculus. Python can make the same check with numbers. The code below stores the function y = e3t at 1001 times between 0 and 1. The instruction np.gradient(y, t) estimates the derivative of y at each time from the values at the neighboring times. The code then compares the derivative with 3y, the right side of the equation y′ = 3y. The instruction abs removes the sign of each difference, and np.max finds the largest one.
Python
The largest difference is about 0.09, while the values of the derivative reach 60. The two sides of the equation agree at each of the 1001 times, apart from the small error of the estimate. The function is a solution.
The code in the next box tests the function y = t² in the same equation. The largest difference is about 1, which is as large as the function itself, so y = t² is not a solution of y′ = 3y. Change the code so that it tests the function y = e−2t in the equation y′ = −2y. Two lines need a change. The largest difference should be less than 0.01.
Python
The general solution of y′ = y is y = Cet. An initial condition y(t0) = y0 gives the constant C in two lines.
Cet0 = y0the general solution at the time t0C = y0/et0divide both sides by et0The code below finds C for the condition y(1) = 5. Its last line calculates the solution at the time t0 again, as a check.
Python
The constant is about 1.839, and the check gives 5. Now find the constant for the initial condition y(2) = 10. The check in the last line should give 10.
Python
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. Which function is a solution of the equation y′ = 5y?
y = e5tthe functiony′ = 5e5tthe derivative, by the chain ruley′ = 5ythe equation is satisfied at each time tFor the other three functions, the derivative is not 5 times the function.
2. A function satisfies y′ = 4t and y(0) = 3. Find y(2).
y′ = 4tthe equationy = 2t² + Cintegrate both sidesy(0) = C = 3the initial condition y(0) = 3y = 2t² + 3the solutiony(2) = 2(2²) + 3 = 11substitute t = 2
3. What are the order and the kind of the equation y″ + 3y′ − y⁴ = 0?
The highest derivative is the second derivative, so the order is 2. The term y⁴ is a power of the unknown function, so the equation is nonlinear. The exponent 4 is not the order.
4. Which expression is the general solution of y′ = 3t²?
The functions whose derivative is 3t² are t³ plus a constant. The function y = t³ is one solution, and the general solution contains the constant C.
5. The function y = A cos 2t + B sin 2t satisfies y(0) = 3 and y′(0) = 8. Find A and B.
y(0) = Asubstitute t = 0A = 3the condition y(0) = 3y′ = −2A sin 2t + 2B cos 2tthe derivativey′(0) = 2Bsubstitute t = 02B = 8the condition y′(0) = 8B = 4divide both sides by 2