First-order ordinary differential equations

1.1 Separable ODEs

A separable first-order ODE can be written in the form

We will assume that is continuous over some range of values of , e.g. , possibly the whole real line . Continuity of ensures that we can take the necessary integrals.

1.1.1 A simple solution

Any (constant) solution of the equation is also a possible solution of (1.1).

Example 1.1

Show that () is a possible solution of the first-order ODE,

Solution

Here and . Now, if (where ), so the right-hand side of the ODE is zero. Clearly (constant) (i.e. the left-hand side is also zero). Therefore is a possible solution.

1.1.2 Separation of variables

To derive a more general solution, we must assume that , so that we can divide each side by ,

Integrating each side with respect to ,

since , this implies that

Evaluating these integrals leads to a solution for . Sometimes the general solution will contain solutions of , but this is not always the case.

Example 1.2

Find the general solution to

Solution

Clearly is a possible constant solution. If , we separate variables,

where C is an arbitrary constant of integration. Rearranging this expression,

where is a rescaled constant. Alongside the special solution , this is the most general solution to this first order ODE. Different values of lead to a family of solution curves (or integral curves) in the -plane.

Check (not lectured): Differentiating this function, we see that

as required.

Example 1.3

Find the general solution of the ODE and then the particular solution which passes through the point , i.e. .

Solution

We have

Clearly is a possible solution, but this is incompatible with so can be ignored. Assuming , separation of variables leads to

(where is the constant of integration). Taking the exponential of both sides,

where . Dropping the modulus operators from both sides,

Absorbing the plus/minus sign into a new constant (where ),

If , this implies that

So the required solution is,

Example 1.4

If is the size of a radioactive sample at time , then

where is a positive constant. How long does it take for half the sample to decay?

Solution

Assuming that , we again proceed by separating variables (note the change of notation!):

where is a constant of integration. Hence,

where is a new constant () into which the plus/minus sign has been absorbed. If (initial sample size) then,

Let be the length of time it takes for half the sample to decay, i.e. . This implies that,

Hence

This is the time it takes for half the sample to decay (known as the sample’s half-life).

1.2 Homogeneous ODEs

A homogeneous first-order ODE can be written in the form

We will assume that is a continuous function of its argument.

Idea: Define a new variable, , such that

Rewriting (1.3) in terms of and ,

Hence,

which can be solved by separating variables.

Example 1.5

Find the general solution to . Then find the specific solution satisfying .

Solution

Rearranging this equation,

This is a homogeneous, first-order ODE, so we set . Following the procedure leading to (1.5),

Separating variables and integrating both sides,

Note that we have implicitly assumed that and . Neither of these special solutions are consistent with , so this is valid.

To evaluate the integral on the left-hand side, use a partial fractions decomposition,

where and are constants. Hence,

For this to be true for any , we require that and . Therefore

Substituting this into the separated ODE,

where is a constant. Hence

where is a new constant. Rearranging,

Recalling that , this leads to the general solution

Now, given that ,

Hence,

which is the required answer.

1.3 Linear first-order ODEs

1.3.1 Terminology

Recalling our definition of a linear operator,

(where the are specified functions of ), any linear first-order ODE can be written in the form

where is another given function of . Without loss of generality, we shall assume .

Note

The case of is trivial, i.e. .

Dividing (1.6) by ,

where and . This is the most general form for a (non-trivial) first-order linear ODE.

1.3.2 The integrating factor method

The challenge is to solve . We shall assume that and are continuous (and hence integrable) over some interval , possibly the whole real line . Let

For any , the fundamental theorem of calculus tells us that

This implies that

The quantity is known as the integrating factor. As we have just shown, if we multiply our original ODE by this integrating factor, i.e.

this is equivalent to

Integrating this equation,

where is a constant. Hence, recalling that ,

This is the general solution. The term proportional to is often referred to as the complementary function, whilst the rest of the right-hand side is known as the particular integral.

Example 1.6

Find the general solutions of the following first-order ODEs:

i)

;

ii)

.

Solution

i) This equation is already in the form . Here, and . Clearly,

(note that the integrating factor is simply a computational tool, so we can ignore any constants of integration here). Hence,

Without loss of generality, we can ignore the modulus operator here, setting (this is because a negative integrating factor would also work in the same way). Multiplying our original equation by this integrating factor, we obtain the following ODE:

Referrring to (1.8), we have already shown that this is equivalent to

Integrating this equation,

which is the required result.

[Check: , as required.]

ii) This equation () is not in the correct form to apply the integrating factor directly. Dividing through by ,

so and . Here,

Hence,

Again we can drop the modulus operator, so that . Applying this integrating factor,

which, by (1.8), is equivalent to

Integrating each side of this equation,

which is the required solution.

[Check: , as required.]

1.3.3 Existence and uniqueness

Theorem: If the functions and are continuous , then there exists a unique function , defined on the open interval , satisfying the linear first-order ODE

for some given and .

Proof: Existence has already been demonstrated by the construction of an explicit solution (1.9). For uniqueness, we assume that there are two solutions and . Consider the function . Clearly

whilst . Obviously is a possible solution of this ODE, in which case (i.e. the solution is unique). For , separation of variables leads to

(where, as before. and is a constant). Rearranging this expression, we see that

where is a redefined constant. The only way that this can be compatible with is if . This again implies that , i.e. unique solution.

Note

Linearity is crucial to this result. There are many nonlinear ODEs for which solutions are not unique. For example, consider the following differentiable function,

where is any positive constant (i.e. ). For any valid choice of (of which there are infinitely many), this function satisfies the nonlinear ODE

subject to .

1.4 Isoclines

Consider an equation of the form . The function defines the slope of the solution curve at each point in the -plane. Lines of constant slope, known as isoclines, satisfy

where is a constant (). Isoclines can be used to sketch the solution curves.

Example 1.7

Consider the following ODE:

By finding the isoclines, sketch some integral curves (i.e. solution curves) for this ODE (Exercise: show that the general solution is , where is a constant).

Solution

The isoclines correspond to

These are straight lines on which the slope of the solution curve is . The short line elements (or flow vectors) on the sketch indicate the corresponding direction field, i.e. the slope of the solution curves at each point in space. By connecting these, we can sketch the solution.

Example 1.8

Find the isoclines and sketch some solution curves for the following ODE,

Check your solution curves by finding the exact solution.

Solution

The isoclines are given by

which are straight lines, of gradient , passing through the origin.

Connecting up the flow vectors (see sketch) we obtain the solution curves. These look like concentric circles, centred at the origin. To find the exact solution, we can separate variables:

where is a constant of integration. Rearranging,

which describes a circle, centred at the origin in the -plane, of radius . This is consistent with the solution curves obtained from the isoclines.

Terminology: Consider an ODE of the form

with isoclines defined by

Lines of zero slope (i.e. ) are defined by , whilst lines of infinite slope (i.e. ) are defined by . If

at any point in the -plane, then the point is said to be singular. At this point, the slope is not single-valued: it lies on both the and isoclines. In Example 1.8, all of the isoclines intersect at the origin, which is the only singular point in this case. See handout for a more complicated example.