MATH 2410 — Differential Equations
Lecture Notes. This is NOT meant to be a substitute for coming to lecture or consulting the textbook directly, but rather a helpful resource to review for exams/ review what was discussed in lecture.
What Is a Differential Equation?
Throughout calculus, we have encountered many differential equations.
Even though these differential equations can be solved using "elementary" methods (i.e. standard integration), that does not make them any less differential equations. Notice that the function \(y = e^x\) has the property that it is equal to its own derivative — that is, \(y = e^x\) satisfies \[ y' = e^x = y. \] Modifying this example, if \(y = e^{mx}\), then \[ y' = me^{mx} = my. \] This exponential family gives motivation to find methods for solving various kinds of differential equations.
Classification of Differential Equations
Classification by Type
We interact with two main types of differential equations, classified by the kind of derivatives that appear.
- \(\dfrac{dy}{dx} + 7y = e^x+2\)
- \(y''+3y'-3y = x^2\)
- \(\dfrac{dy}{dt} + \dfrac{dx}{dt} = 2x+y\)
On the other hand, we have the following other type of differential equation.
This course will focus mostly on ordinary differential equations, but it is important to be able to tell the difference.
Classification by Order
Classification by Linearity
- The unknown function and its derivatives appear only to the first power.
- No products of \(y\) and its derivatives appear.
Here is a small table of examples of different orders and linearity.
| Order | Linear | Nonlinear |
|---|---|---|
| 1st | \(y' + 2y = e^x\) | \(y' + y^2 = 0\) |
| 2nd | \(y'' - 3\sin(x)y' + 2y = x\) | \(y'' + (y')^2 = 0\) |
| 3rd | \(y''' + e^{3x}y'' - xy' + 2y = \sin x\) | \(y''' + \sin(y) = 0\) |
Solutions of Differential Equations
Using the product rule,
\[ y' = e^x+xe^x \text{ and } y'' = e^x+e^x+xe^x = 2e^x+xe^x. \]Then,
\[ \begin{aligned} y''-2y'+y &= (2e^x+xe^x) -2(e^x+xe^x)+(xe^x)\\ &= 2e^x+xe^x -2e^x-2xe^x+xe^x\\ &= 0. \end{aligned} \]So the ordinary differential equation is reduced to an identity. To verify the interval of definition, notice that \(y=xe^x\) is continuous and differentiable on \((-\infty, \infty)\). That completes the example.
Implicit vs Explicit Solutions
When we find a solution, there are different forms we may need to leave it in.
Often, if we want to visualize the solution curves, one form will be more appropriate than the other (implicit vs. explicit). However, if we just want to know the solution, the implicit form is usually good enough.
Families of Solutions
Much like how \(x^2+1\) and \(x^2+7\) both have the same derivative, differential equations can also have families of solutions.
We need \(y'\) first:
\[ y' = c-(\cos(x)-x\sin(x)). \]Thus,
\[ \begin{aligned} xy'-y &= x(c-\cos(x)+x\sin(x)) - cx+x\cos(x)\\ &= cx-x\cos(x)+x^2\sin(x)-cx+x\cos(x)\\ &= x^2\sin(x). \end{aligned} \]Since \(y\) is continuous and differentiable on \((-\infty, \infty)\), the solution is verified.
Initial Value Problems
As we saw in the previous section, there can be infinitely many solutions to a differential equation. Some may be constant solutions, some may form a one-parameter family of solutions. So the question remains: what if we want our solutions to have a certain property attached to them?
Given an initial value problem, we limit the number of solutions to possibly just one, although we will see conditions on when this happens later. The solution to an initial value problem is called a particular solution.
Notice that \(y = ce^x\) is continuous and differentiable on \((-\infty, \infty)\). Thus, the only thing to check is
\[ y' = \frac{d}{dx}(ce^x) = ce^x = y. \]This verifies that the one-parameter family is an infinite set of solutions to \(y'=y\). To find the particular solution, we insist that \(y=ce^x\) has the property that
\[ y(0) = ce^0 = c = 3. \]Thus, the particular solution is \(y = 3e^x\).
When Does an Initial Value Problem Have Solutions?
Suppose we have some family of solutions, or even just an initial value problem. We would like to know some conditions for when this initial value problem has solutions — maybe even when this solution is unique.
Let's take a look at a couple of examples to see if we can determine the existence of solutions to initial value problems.
Now we try a second-order differential equation example.
Now, suppose we want the particular solution such that \(x(0) = -1\) and \(x'(0)= 8\). We plug our conditions in:
\[ \begin{aligned} x(0) &= c_1\cos(0) + c_2\sin(0)\\ &= c_1 = -1. \end{aligned} \] \[ \begin{aligned} x'(0) &= -c_1\sin(0)+c_2\cos(0)\\ &= c_2 = 8. \end{aligned} \] Thus, the particular solution to this initial value problem is \[ x = -\cos(t)+8\sin(t). \]Mathematical Modeling with Differential Equations
Many times, modeling real-world situations is best done with differential equations. Why? Because a derivative describes the instantaneous rate at which a quantity changes. The task, then, is to come up with a method to set up equations that model different situations.
We construct mathematical models using the following logic:
- Identify all variables contributing to the system.
- Set reasonable assumptions about the system to limit the number of changing variables as needed.
- Adjust the model as needed, given more data.
We want to balance the number of factors we add into the model against the ability to solve the differential equation relatively simply. If there are too many variable factors, we may reach a point where we cannot fully understand what is going on with the model. Below are some real-world situations that can be modeled using differential equations. The key is the following relationship/translation from words to mathematics:
\[ \text{"rate proportional to"} \longleftrightarrow k \cdot \text{(quantity)} \]The first example of a mathematical model that many students come across in a Calculus class is radioactive decay — the rate at which an unstable element decays.
Let \(t\) represent the time unit (usually in years), and \(A(t)\) be the amount of substance remaining at time \(t\). Then,
\[ \frac{dA}{dt} = \text{the rate of change of } A(t). \]An assumption made in these types of problems is that the substance decays at a rate proportional to the amount of substance remaining. Thus, the model becomes
\[ \frac{dA}{dt} = kA, \qquad k < 0. \]We insist \(k < 0\) since we want the rate of change of the substance to be negative (to represent decay). Some references instead write
\[ \frac{dA}{dt} = -kA, \qquad k>0. \]For all these examples, this represents one unstable element decaying into a stable state. This model can be adjusted to a system if we consider that an unstable element must go through different states — but we will look into linear systems later on in this course.
Another common example is the spread of a disease through a population. The variables in this model are:
\[ \begin{aligned} x(t) &= \text{number of people who have contracted the disease}\\ y(t) &= \text{number of people who have not been exposed to the disease.} \end{aligned} \]We assume that the rate at which the disease spreads is proportional to the number of encounters between people who have the disease and people who do not, and that the number of encounters is proportional to both \(x(t)\) and \(y(t)\). Thus, the model is
\[ \frac{dx}{dt} = kxy. \]If we further impose a fixed population of \(n\) people and introduce one infected person, so \(x(0) = 1\), then
\[ \frac{dx}{dt} = kx(n+1-x), \qquad x(0)=1. \]Once again, this can be adjusted to a system if we model the rate at which the number of people infected, recovered, and susceptible changes. This is commonly known as an "SIR" model.
Suppose water is leaking from a tank through a circular hole of area \(A_h\) at its
bottom. When it leaks, the volume of water leaving the tank is \(cA_h\sqrt{2gh}\),
\(0 This problem wants us to model the rate of change of the height of water in the tank. What we know just from our assumptions is where \(A_w\) is the area of the bottom of the tank. By implicit differentiation on the second equation and substituting in the first, \(\dfrac{dV}{dt} = A_w\dfrac{dh}{dt}\). So,
Of course, there are plenty of other examples, but these are some of the most common.
Autonomous Differential Equations
An autonomous differential equation describes relationships solely between the dependent variable and its derivatives. The independent variable does not appear explicitly.
- \(y' = y\)
- \(y' = 1 + y^2\)
- \(y'' - y' + y = 0\)
Although solutions to autonomous differential equations can often be found using separation of variables (Section 2.2), we can gain significant qualitative information about solution behavior without explicitly solving the equation.
Critical Points and Phase Portraits
Because the equation is autonomous, critical points correspond to constant solutions and are values of the dependent variable — not the independent variable.
This definition directly generalizes the notion of critical points from calculus, where a critical point occurs when the derivative of a function is zero or undefined. Recall:
| \(f'(x)\) | \(f(x)\) |
|---|---|
| \(>0\) | Increasing |
| \(<0\) | Decreasing |
| Interval | \(f(y)\) | \(y(x)\) |
|---|---|---|
| \((-\infty,0)\) | \(<0\) | Decreasing |
| \(\left(0,\dfrac{a}{b}\right)\) | \(>0\) | Increasing |
| \(\left(\dfrac{a}{b},\infty\right)\) | \(<0\) | Decreasing |
Phase Portrait
This information allows us to construct the phase portrait. The constant solutions are
\[ y = 0, \qquad y = \frac{a}{b}. \] Solution curves increase toward \(y=\frac{a}{b}\) and decrease toward it from above.| Interval | \(f(y)\) | \(y(x)\) |
|---|---|---|
| \((-\infty,1)\) | \(\ge0\) | Increasing |
| \((1,\infty)\) | \(\ge0\) | Increasing |
Phase Portrait
Verification: Let
\[ y = 1 - \frac{1}{x+c}. \] Then \[ y' = \frac{1}{(x+c)^2}. \] Also, \[ (y-1)^2 = \left(-\frac{1}{x+c}\right)^2 = \frac{1}{(x+c)^2}. \] Thus \(y' = (y-1)^2\), verifying the solution.If \(y(0)=2\), then
\[ 2 = 1 - \frac{1}{c} \Rightarrow c = -1, \] and the solution is \[ y = 1 - \frac{1}{x-1}. \]Classifying Critical Points
- If \(\lim_{x\to\infty} y(x)=c\), then \(y=c\) is asymptotically stable (an attractor).
- If solutions move away from \(y=c\) in both directions, then \(y=c\) is unstable (a repellor).
- If solutions approach from one direction only, then \(y=c\) is semi-stable.
| Interval | \(f(y)\) | \(y(x)\) |
|---|---|---|
| \((-\infty,-2)\) | \(<0\) | Decreasing |
| \((-2,5)\) | \(>0\) | Increasing |
| \((5,\infty)\) | \(<0\) | Decreasing |
Phase Portrait
Thus:
- \(y=-2\) is unstable (repellor)
- \(y=5\) is asymptotically stable (attractor)
Separable Differential Equations
The method for finding solutions to separable differential equations is known as separation of variables. Here is how the method works: consider a separable differential equation
\[ \frac{dy}{dx} = g(x)\,h(y). \]We can rearrange the equation by moving the differential \(dx\) to the right-hand side and dividing both sides by \(h(y)\). This puts the equation in the form
\[ \frac{dy}{h(y)} = g(x)\,dx. \]Suppose that an explicit solution \(y = \phi(x)\) exists. Then,
\[ \begin{aligned} \frac{dy}{h(y)} &= \frac{1}{h(\phi(x))}\,\phi'(x)\,dx \\ &= g(x)\,dx \end{aligned} \]by definition of a solution. Integrating both sides gives
\[ \int \frac{1}{h(\phi(x))}\,\phi'(x)\,dx = \int \frac{dy}{h(y)} = \int g(x)\,dx. \]We conclude that
\[ H(y) = G(x) + c, \]where \(H\) and \(G\) are antiderivatives of \(1/h\) and \(g\), respectively.
In practice, you will frequently see constants being absorbed: sums, differences, or scalar multiples of arbitrary constants can be collapsed into a single new constant, as long as the independent variable does not appear.
The right-hand side factors as \(g(x)\,h(y)\) with \(g(x) = 2x\) and \(h(y) = y^2\), so the equation is separable. Rearranging,
\[ \frac{dy}{y^2} = y^{-2}\,dy = 2x\,dx. \]Integrating both sides:
\[ \begin{aligned} \int y^{-2}\,dy &= -y^{-1} = -\frac{1}{y}, \\ \int 2x\,dx &= x^2 + c. \end{aligned} \]An implicit solution is therefore \(\tfrac{-1}{y} = x^2 + c\), which gives the explicit solution
\[ \boxed{y = \frac{-1}{x^2 + c}.} \]- Separate variables. Write the equation in the form \(h(y)\,dy = g(x)\,dx\).
- Integrate both sides. Find an antiderivative of each side of the equation.
- Solve explicitly and/or apply the initial condition. If needed, solve for \(y\) in terms of \(x\), and use any given initial value to find the particular solution.
Now we look at an initial value problem.
Step 1 (Separate variables).
Divide both sides by \(y(1+x)\) to get \[ \frac{dy}{y} = \frac{dx}{1+x}. \]Step 2 (Integrate both sides).
\[ \begin{aligned} \int \frac{dy}{y} &= \ln|y|, \\ \int \frac{dx}{1+x} &= \ln|1+x| + c. \end{aligned} \] So the implicit solution is \(\ln|y| = \ln|1+x| + c\).Step 3 (Find the explicit solution).
Exponentiating both sides, \[ y = e^{\ln|1+x|\,+\,c} = e^c\,|1+x|. \] Absorbing the sign and the constant into a new constant \(c\), we obtain \[ y = c\,(1+x). \]Step 4 (Apply the initial condition).
Setting \(x = 0\) and \(y = 3\): \[ 3 = c\,(1 + 0) \implies c = 3. \] The particular solution is therefore \[ \boxed{y = 3(1+x).} \]The previous example required only a straightforward integration on the \(x\)-side. Sometimes the integral \(\int g(x)\,dx\) is not immediate and requires a substitution.
Step 1 (Separate variables).
Divide both sides by \(y\) and multiply by \(dx\): \[ \frac{dy}{y} = \frac{x}{\sqrt{1+x^2}}\,dx. \]Step 2 (Integrate the left side).
\[ \int \frac{dy}{y} = \ln|y|. \]Step 3 (Integrate the right side via \(u\)-substitution).
Let \(u = 1 + x^2\), so \(du = 2x\,dx\), i.e. \(x\,dx = \tfrac{1}{2}\,du\). Substituting, \[ \int \frac{x}{\sqrt{1+x^2}}\,dx = \frac{1}{2}\int u^{-1/2}\,du = \frac{1}{2}\cdot 2\sqrt{u} = \sqrt{u} = \sqrt{1+x^2}. \] Therefore the implicit solution is \[ \ln|y| = \sqrt{1+x^2} + c. \]Step 4 (Find the explicit solution).
Exponentiate both sides: \[ |y| = e^{\sqrt{1+x^2}+\,c} = e^c\,e^{\sqrt{1+x^2}}. \] Absorbing \(e^c\) into a new arbitrary constant \(C > 0\) (and allowing any sign), \[ \boxed{y = C\,e^{\sqrt{1+x^2}}.} \]Solving First-Order Linear Differential Equations
So far, the only method for finding solutions to differential equations we have is separation of variables. This works when the first-order differential equation is of the form
\[ \frac{dy}{dx} = g(x)h(y). \]However, in general, most first-order differential equations will not be separable. Thus, we need a method that works for more first-order differential equations. Consider a first-order linear differential equation
\[ y' + P(x)y = f(x). \]The method used to solve all first-order linear differential equations is known as the method of integrating factor. First, multiply both sides of the standard-form equation by some function \(\mu(x)\). We get
\[ \mu(x)\big(y' + P(x)y\big) = \mu(x)y'+\mu(x)P(x)y = \mu(x)f(x). \]Upon inspection of the left-hand side, we see the form
\[ (\text{function})(\text{derivative of } y) + (\text{function})(y), \]which looks a lot like the product rule, where
\[ \frac{d}{dx}\big(\mu(x)y\big) = \mu(x)y' + \mu'(x)y. \]These equations are only equal if we insist that
\[ \mu'(x) = \mu(x)P(x) \qquad \text{or} \qquad \frac{d\mu}{dx} = \mu(x)P(x), \]which is a separable differential equation. Using separation of variables, we can determine what this mystery function \(\mu(x)\) must be:
\[ \begin{aligned} \frac{d\mu}{\mu} &= P(x)\,dx\\ \int\frac{d\mu}{\mu} &= \int P(x)\,dx\\ \ln|\mu| &= \int P(x)\,dx\\ \mu(x) &= e^{\int P(x)\,dx}. \end{aligned} \]That is the whole method. Here are the checkpoints to make sure you are on the right track when attempting to use the method:
- Confirm the differential equation is first-order and linear.
- Put the differential equation in standard form.
- Compute the integrating factor.
- Multiply both sides of the differential equation by the integrating factor.
- Integrate both sides and solve for \(y\) (or the dependent variable).
Let's run through some examples to end the section:
Now we will show what happens when we look at initial value problems using this method.
Exact Equations
- Check that \(\dfrac{\partial M}{\partial y} = \dfrac{\partial N}{\partial x}\) (the equation is exact).
- Find \(f(x,y) = \displaystyle\int M(x,y)\,dx + g(y)\) so that \(\dfrac{\partial f}{\partial x} = M(x,y)\).
- Find \(\dfrac{\partial f}{\partial y}\) and use \(\dfrac{\partial f}{\partial y} = N(x,y)\) to find \(g'(y)\).
- Integrate \(g'(y)\) to find \(g(y)\).
- Assemble \(f(x,y)\); the implicit solution curve is \(f(x,y)=C\).
Here \(M(x,y)=2xy\) and \(N(x,y)=x^2-1\), and
\[ \frac{\partial M}{\partial y} = 2x = \frac{\partial N}{\partial x}, \]so the equation is exact. We want \(f(x,y)\) such that \(\partial f/\partial x = 2xy\) and \(\partial f/\partial y = x^2-1\). Integrating \(M\) with respect to \(x\),
\[ f(x,y) = x^2y + g(y). \]Then \(\partial f/\partial y = x^2 + g'(y)\), and setting this equal to \(N\),
\[ x^2 + g'(y) = x^2 - 1 \;\Longrightarrow\; g'(y) = -1 \;\Longrightarrow\; g(y) = -y. \]So \(f(x,y) = x^2y - y\), and the solution curve is \(x^2y - y = C\), i.e.
\[ \boxed{y = \frac{C}{x^2-1}.} \]Here \(M = y^2\cos x - 3x^2y - 2x\) and \(N = 2y\sin x - x^3 + \ln y\), and
\[ \frac{\partial M}{\partial y} = 2y\cos x - 3x^2 = \frac{\partial N}{\partial x}, \]so the equation is exact. Integrating \(M\) with respect to \(x\),
\[ f(x,y) = y^2\sin x - x^3y - x^2 + g(y). \]Then
\[ \frac{\partial f}{\partial y} = 2y\sin x - x^3 + g'(y) \stackrel{\text{set}}{=} 2y\sin x - x^3 + \ln y \;\Longrightarrow\; g'(y) = \ln y. \]Integrating by parts (\(u=\ln y\), \(dv=dy\)),
\[ g(y) = \int \ln y\,dy = y\ln y - y + C. \]So the solution curve is
\[ y^2\sin x - x^3y - x^2 + y\ln y - y = C. \]Applying \(y(0)=e\):
\[ e^2\sin 0 - 0 - 0 + e\ln e - e = 0 + e - e = 0 \;\Longrightarrow\; C=0. \]Thus
\[ \boxed{y^2\sin x - x^3y - x^2 + y\ln y - y = 0.} \]Rearranging into \(M\,dx+N\,dy=0\) form,
\[ (-2xe^x + y - 6x^2)\,dx + x\,dy = 0, \]so \(M = -2xe^x+y-6x^2\) and \(N=x\). Since
\[ \frac{\partial M}{\partial y} = 1 = \frac{\partial N}{\partial x}, \]the equation is exact. Integrating \(M\) with respect to \(x\) (using integration by parts on \(xe^x\)),
\[ f(x,y) = -2(xe^x-e^x) + xy - 2x^3 + g(y). \]Then \(\partial f/\partial y = x + g'(y) \stackrel{\text{set}}{=} x\), so \(g'(y)=0\) and \(g(y)=C\). Thus the solution is
\[ \boxed{-2(xe^x-e^x) + xy - 2x^3 = C.} \]Solving by Substitution
Suppose we have a differential equation of the form \(\dfrac{dy}{dx} = f(Ax+By+C)\). These can always be reduced to a separable equation via the substitution \(u = Ax+By+C\), provided \(B\ne 0\).
- Locate \(f(Ax+By+C)\) on the right-hand side of the DE.
- Let \(u=Ax+By+C\) and find \(\dfrac{du}{dx}\).
- Rewrite \(\dfrac{dy}{dx}\) in terms of \(\dfrac{du}{dx}\), \(u\), and \(x\) only.
- Check that the new DE (in \(u\) and \(x\)) is separable.
- Apply separation of variables to solve for \(u\).
- Return to the original variables.
Let \(u = x+y+1\), so \(\dfrac{du}{dx} = 1+\dfrac{dy}{dx}\), i.e. \(\dfrac{dy}{dx} = \dfrac{du}{dx}-1\). Substituting,
\[ \frac{du}{dx} - 1 = u^2 \;\Longrightarrow\; \frac{du}{dx} = u^2+1. \]This is separable:
\[ \frac{du}{u^2+1} = dx \;\Longrightarrow\; \int \frac{du}{u^2+1} = \int dx \;\Longrightarrow\; \tan^{-1}(u) = x+C. \]So \(u = \tan(x+C)\), and returning to the original variables, \(x+y+1 = \tan(x+C)\), i.e.
\[ \boxed{y = \tan(x+C) - 1 - x.} \]Let \(u = y-2x+3\), so \(\dfrac{du}{dx} = \dfrac{dy}{dx}-2\), i.e. \(\dfrac{dy}{dx} = \dfrac{du}{dx}+2\). Substituting,
\[ \frac{du}{dx} + 2 = 2+\sqrt{u} \;\Longrightarrow\; \frac{du}{dx} = \sqrt{u}. \]This is separable:
\[ \frac{du}{\sqrt{u}} = dx \;\Longrightarrow\; \int u^{-1/2}\,du = \int dx \;\Longrightarrow\; 2\sqrt{u} = x+C \;\Longrightarrow\; u = \frac{(x+C)^2}{4}. \]Returning to the original variables, \(y-2x+3 = \dfrac{(x+C)^2}{4}\), i.e.
\[ \boxed{y = 2x-3+\frac{(x+C)^2}{4}.} \]