Home Notes Research CV Projects Outside of Math

← Back to Course Resources

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.

Section 1.1

Introduction to Differential Equations and Classification
↑ Back to top

What Is a Differential Equation?

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

Throughout calculus, we have encountered many differential equations.

Example \[ \frac{dy}{dx} = 3x^2 \] \[ \frac{dy}{dx} = x^4 + 5\sin(x) \] These are differential equations since they involve the derivative of the unknown function \(y(x)\).

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.

Example \[ y'' + 4y = 0 \] This equation involves the second derivative of \(y\) and is also a differential equation.

Classification of Differential Equations

Classification by Type

We interact with two main types of differential equations, classified by the kind of derivatives that appear.

Definition An ordinary differential equation (ODE) is a differential equation that only contains the ordinary derivatives of one or more unknown functions.
Example The following are examples of ordinary differential equations:
  1. \(\dfrac{dy}{dx} + 7y = e^x+2\)
  2. \(y''+3y'-3y = x^2\)
  3. \(\dfrac{dy}{dt} + \dfrac{dx}{dt} = 2x+y\)

On the other hand, we have the following other type of differential equation.

Definition A partial differential equation (PDE) is a differential equation that involves the partial derivatives of one or more unknown functions of two or more variables.
Example An example of a partial differential equation is \[ \frac{\partial^2u}{\partial x^2} + \frac{\partial^2u}{\partial x^2} = 0. \]

This course will focus mostly on ordinary differential equations, but it is important to be able to tell the difference.

Classification by Order

Definition The order of a differential equation is the highest derivative that appears in the equation.
Example \[ \frac{dy}{dx} = x^2 \] This is a first-order ordinary differential equation.
Example \[ y''' - y' + y = 0 \] This is a third-order ordinary differential equation.

Classification by Linearity

Definition A differential equation is linear if it can be written in the form \[ a_n(x)y^{(n)} + a_{n-1}(x)y^{(n-1)} + \cdots + a_1(x)y' + a_0(x)y = g(x), \] where the coefficients \(a_i(x)\) and \(g(x)\) depend only on \(x\).
Remark In a linear differential equation:
Example \[ y' + 2y = e^x \] This is a linear differential equation.
Example \[ y' + y^2 = 0 \] This is nonlinear because of the \(y^2\) term.

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

Definition Any function \(\phi(x)\) defined on an interval \(I\) and possessing at least \(n\) derivatives that are continuous on \(I\), which when substituted into an \(n\)th-order ordinary differential equation reduces the equation to an identity, is said to be a solution of the equation on that interval.
Example Consider \[ \frac{dy}{dx} = 3x^2. \] A solution is \[ y = x^3 + C, \] where \(C\) is an arbitrary constant.
Example Consider the function \(y = xe^x\). We verify that this function is a solution to the ordinary differential equation \(y''-2y'+y=0\) on \((-\infty, \infty)\).

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.

Remark There is another solution to the previous example: \(y = 0\). This is called the trivial solution. Often we will only be concerned with finding nontrivial solutions — nonetheless, it is still important to know all solutions that exist.

Implicit vs Explicit Solutions

When we find a solution, there are different forms we may need to leave it in.

Definition A solution to a differential equation such that the dependent variable is expressed in terms of the independent variable and constants (i.e. written as \(y = \phi(x)\)) is said to be an explicit solution. A solution written in the form \(G(x,y) = 0\) is said to be an implicit solution.

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.

Example The differential equation \(y' = 2x\) has a family of solutions \(x^2+c\), where \(c\) is some constant.
Example Let's verify the one-parameter family \(y = cx-x\cos(x)\) is a solution to the ordinary differential equation \(xy'-y = x^2\sin(x)\) on \((-\infty,\infty)\).

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.

Section 1.2

Initial Value Problems
↑ Back to top

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?

Definition An initial value problem (IVP) is a differential equation together with some initial conditions that must be met.

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.

Example Let us verify the family \(y = ce^x\) is a solution to \(y'=y\) on \((-\infty,\infty)\) and find the particular solution such that \(y(0) = 3\).

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.

Theorem Let \(R\) be a rectangle in the \(xy\)-plane that contains the point \((x_0,y_0)\) in its interior. If \(f(x,y)\) and \(\dfrac{\partial f}{\partial y}\) are continuous on \(R\), then there exists some interval \(I\), and a unique function \(y(x)\) defined on \(I\) that is a solution to the initial value problem \(\dfrac{dy}{dx} = f(x,y)\) given \(y(x_0) = y_0\).

Let's take a look at a couple of examples to see if we can determine the existence of solutions to initial value problems.

Example Consider the initial value problem \(\dfrac{dy}{dx} = xy^{1/2}\). Let \(f(x,y) = xy^{1/2}\) and compute \[ \frac{\partial f}{\partial y} = x\left(\frac{1}{2}y^{-1/2}\right) = \frac{x}{2y^{1/2}}. \] This partial derivative is continuous for all \(x\) and all \(y\) such that \(y \neq 0\). So given some initial condition \((x_0,y_0)\) that we want the solution curve to hit, the initial value problem is guaranteed to have a solution if \(y_0 \ne 0\).
Remark The theorem above is enough to guarantee a unique solution to an initial value problem, but it is not required. That is, an initial value problem could fail to meet all these conditions and still have a unique solution.

Now we try a second-order differential equation example.

Example Consider the two-parameter family of solutions \(x = c_1\cos(t)+c_2\sin(t)\). Let's verify this is a solution to \(x''+x = 0\). First, \[ x' = -c_1\sin(t)+c_2\cos(t) \] and \[ x'' = -c_1\cos(t) - c_2\sin(t). \] Notice that \(x''+x = 0\) is reduced to an identity. Thus, this two-parameter family is a solution.

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). \]
Section 1.3

Mathematical Modeling with Differential Equations
↑ Back to top

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:

  1. Identify all variables contributing to the system.
  2. Set reasonable assumptions about the system to limit the number of changing variables as needed.
  3. 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)} \]
Example (Radioactive Decay)

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.

Example (Spread of Disease)

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.

Example (Draining Tank)

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

\[ \frac{dV}{dt} = cA_h\sqrt{2gh} = c\left(\frac{5}{12}\right)^2\pi \sqrt{64h} = \frac{200}{144}c\pi \sqrt{h} = \frac{25}{18}c\pi\sqrt{h}. \] \[ V(t) = A_wh \]

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,

\[ \begin{aligned} \frac{dh}{dt} &= \frac{1}{A_w}\frac{dV}{dt}\\ &= \frac{1}{A_w}\cdot\frac{25}{18}c\pi\sqrt{h}. \end{aligned} \]

Of course, there are plenty of other examples, but these are some of the most common.

Section 2.1

Autonomous Differential Equations
↑ Back to top

Autonomous Differential Equations

Definition An ordinary differential equation is said to be autonomous if the independent variable does not appear explicitly in the differential equation. That is, \[ \frac{dy}{dx} = f(y). \]

An autonomous differential equation describes relationships solely between the dependent variable and its derivatives. The independent variable does not appear explicitly.

Example The following are examples of autonomous differential equations:

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

Definition For an autonomous differential equation \(\dfrac{dy}{dx} = f(y)\), a critical point (or stationary point) is a value \(y = c\) such that \[ f(c) = 0. \]

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
Example Consider the autonomous differential equation \[ \frac{dy}{dx} = y(a - by), \qquad a,b > 0. \] The critical points satisfy \[ y(a - by) = 0 \quad \Rightarrow \quad y = 0, \; y = \frac{a}{b}. \] We examine the sign of \(f(y)\):
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

0 a/b

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.
Example Consider \[ \frac{dy}{dx} = (y-1)^2. \] The critical point satisfies \((y-1)^2 = 0\), so \(y=1\). Since \((y-1)^2 \ge 0\) for all \(y\), solutions are increasing on both sides of \(y=1\).
Interval \(f(y)\) \(y(x)\)
\((-\infty,1)\) \(\ge0\) Increasing
\((1,\infty)\) \(\ge0\) Increasing

Phase Portrait

1

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

Definition Suppose \(y(x)\) is a nonconstant solution of \(\dfrac{dy}{dx}=f(y)\).
Example Consider \[ \frac{dy}{dx} = 10 + 3y - y^2. \] Critical points satisfy \[ 10 + 3y - y^2 = 0 \quad \Rightarrow \quad y^2 - 3y - 10 = 0, \] so \[ y = -2, \qquad y = 5. \] Sign analysis gives:
Interval \(f(y)\) \(y(x)\)
\((-\infty,-2)\) \(<0\) Decreasing
\((-2,5)\) \(>0\) Increasing
\((5,\infty)\) \(<0\) Decreasing

Phase Portrait

-2 5

Thus:

Section 2.2

Separable Equations
↑ Back to top

Separable Differential Equations

Definition A first-order differential equation of the form \[ \frac{dy}{dx} = g(x)\,h(y) \] is said to be separable or to have separable variables.

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.

Remark We only need one constant of integration. If we had separate constants \(c_1\) and \(c_2\), then \[ H(y) + c_1 = G(x) + c_2 \implies H(y) = G(x) + \underbrace{(c_2 - c_1)}_{:=\,c}. \]

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.

Example Find a general solution to the differential equation \[ \frac{dy}{dx} = 2x\,y^2. \]

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}.} \]
Method of Solving
  1. Separate variables. Write the equation in the form \(h(y)\,dy = g(x)\,dx\).
  2. Integrate both sides. Find an antiderivative of each side of the equation.
  3. 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.

Example Find the particular solution of the initial value problem \[ (1+x)\,\frac{dy}{dx} = y, \qquad y(0) = 3. \]

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.

Example Find the general solution to the differential equation \[ \frac{dy}{dx} = \frac{x\,y}{\sqrt{1+x^2}}. \]

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}}.} \]
Section 2.3

Solving First-Order Linear Differential Equations
↑ Back to top

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). \]
Definition A first-order linear differential equation written as \[ y' + P(x)y = f(x) \] is said to be in standard form. Note that even if the coefficient in front of \(y'\) is not \(1\), we can always divide the equation by any nonzero function and put the differential equation in standard form.

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} \]
Remark The formula \[ \mu(x) = e^{\int P(x)\,dx} \] is called the integrating factor. With this choice of \(\mu(x)\), we go back to the equation before to get the following result: \[ \begin{aligned} \mu(x)\big(y' + P(x)y\big) &= \mu(x)y'+\mu(x)P(x)y\\ &= \frac{d}{dx}\big(\mu(x)y\big)\\ &= \mu(x)f(x). \end{aligned} \] We can integrate both sides and get the solution \[ y = \frac{1}{\mu(x)} \int \mu(x)f(x)\,dx = e^{-\int P(x)\,dx}\int e^{\int P(x)\,dx} f(x)\,dx. \]

That is the whole method. Here are the checkpoints to make sure you are on the right track when attempting to use the method:

Method of Solving
  1. Confirm the differential equation is first-order and linear.
  2. Put the differential equation in standard form.
  3. Compute the integrating factor.
  4. Multiply both sides of the differential equation by the integrating factor.
  5. Integrate both sides and solve for \(y\) (or the dependent variable).

Let's run through some examples to end the section:

Example Consider the first-order linear differential equation \[ y'-3y = 0. \] We saw in a previous section (or we can check via separation of variables) that the solutions to this differential equation are of the form \(y=ce^{3x}\). Now, we use the method of integrating factor to confirm this. First, compute the integrating factor \[ \mu(x) = e^{\int P(x)dx} = e^{\int -3\,dx} = e^{-3x}. \] Multiplying both sides of the equation by \(e^{-3x}\) gives \[ e^{-3x}y' - 3e^{-3x}y = e^{-3x}(0). \] Notice that the left-hand side is the exact derivative of \(e^{-3x}y\). Thus, \[ \frac{d}{dx}\big(e^{-3x}y\big) = 0. \] Integrating both sides and solving for \(y\), \[ \begin{aligned} \int \frac{d}{dx}\big(e^{-3x}y\big)\, dx &= \int 0\,dx\\ e^{-3x}y &= c\\ y &= ce^{3x}, \end{aligned} \] where \(c\) is a constant.

Now we will show what happens when we look at initial value problems using this method.

Example Consider the first-order linear differential equation \[ xy'+y = e^x \] and suppose we insist that the point \((1,2)\) be on the solution curve. First, we put the differential equation in standard form by dividing both sides by \(x\): \[ y' + \frac{1}{x}y = \frac{1}{x}e^x. \] Then, we compute the integrating factor \[ \mu(x) = e^{\int P(x)dx} = e^{\int \frac{1}{x} dx} = e^{\ln|x|} = x. \] Multiplying both sides of the equation by \(x\) gives \[ xy' + y = x\cdot\frac{e^x}{x}. \] Notice that the left-hand side is the exact derivative of \(xy\). Thus, \[ \frac{d}{dx}\big(xy\big) = e^x. \] Integrating both sides and solving for \(y\), \[ \begin{aligned} \int \frac{d}{dx}\big(xy\big)\, dx &= \int e^x\,dx\\ xy &= e^x+c\\ y &= \frac{e^x+c}{x}, \end{aligned} \] where \(c\) is a constant. This gives us the general solution. To find the particular solution and finish the problem, we use the point \((1,2)\) to solve for \(c\): \[ 2 = y(1) = \frac{e+c}{1} = e+c. \] We conclude that \(c = 2-e\) and the particular solution is \[ \boxed{y = \frac{e^x+(2-e)}{x}.} \]
Section 2.4

Exact Equations
↑ Back to top

Exact Equations

Definition A first-order differential equation of the form \[ M(x,y)\,dx + N(x,y)\,dy = 0 \] is said to be an exact equation if the expression on the left-hand side is an exact differential.
Theorem \(M(x,y)\,dx + N(x,y)\,dy\) is an exact differential if and only if \[ \frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}. \]
Method of Solving
  1. Check that \(\dfrac{\partial M}{\partial y} = \dfrac{\partial N}{\partial x}\) (the equation is exact).
  2. Find \(f(x,y) = \displaystyle\int M(x,y)\,dx + g(y)\) so that \(\dfrac{\partial f}{\partial x} = M(x,y)\).
  3. Find \(\dfrac{\partial f}{\partial y}\) and use \(\dfrac{\partial f}{\partial y} = N(x,y)\) to find \(g'(y)\).
  4. Integrate \(g'(y)\) to find \(g(y)\).
  5. Assemble \(f(x,y)\); the implicit solution curve is \(f(x,y)=C\).
Example Find the solution to \(2xy\,dx + (x^2-1)\,dy = 0\).

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}.} \]
Example Find the solution to \[ (y^2\cos x - 3x^2y - 2x)\,dx + (2y\sin x - x^3 + \ln y)\,dy = 0, \qquad y(0) = e. \]

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.} \]
Example Find the solutions to \(x\dfrac{dy}{dx} = 2xe^x - y + 6x^2\).

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.} \]
Section 2.5

Solving by Substitution
↑ Back to top

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\).

Method of Solving
  1. Locate \(f(Ax+By+C)\) on the right-hand side of the DE.
  2. Let \(u=Ax+By+C\) and find \(\dfrac{du}{dx}\).
  3. Rewrite \(\dfrac{dy}{dx}\) in terms of \(\dfrac{du}{dx}\), \(u\), and \(x\) only.
  4. Check that the new DE (in \(u\) and \(x\)) is separable.
  5. Apply separation of variables to solve for \(u\).
  6. Return to the original variables.
Example Find the solutions to \(\dfrac{dy}{dx} = (x+y+1)^2\).

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.} \]
Example Find the solution to \(\dfrac{dy}{dx} = 2 + \sqrt{y-2x+3}\).

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}.} \]