Linear ODEs
The separable ODEs we have encountered in Section 12.1, can be linear or nonlinear. The method of separating variables can be applied to an ODE whose form matches the one given by Eq. (12.2). In this section, we focus on a method that applies to linear ordinary differential equations. We start off by defining the most general first order, linear ODE expressed in standard form as follows
where . Note that standard form implies that the coefficient of the derivative, is 1 . This is especially important when using the formula given later in Subsec. 12.2.1 to obtain the solution to the ODE.
A first order ODE is linear if:
- the function and its derivative are not present at any power higher than 1 ;
- there are no products of the function and its derivative, .
We note that the functions and in Eq. (12.19) should be continuous but they may be represented by constant, noncontant, linear, or nonlinear functions. A reminder of the definition of continuity is given in the next Definition.
Definition 12.2 A function is continuous at a point if:
- is defined;
- exists;
- .
In the case where the function on the RHS of Eq. (12.19) is zero, then the ODE (12.19) is separable: setting in Eq. (12.19), yields,
Equation (12.20) is now a separable ODE and can easily be solved using the technique outlined in Sec. 12.1.
General solution
For first order, linear ODEs the solution to the differential equation may be expressed by the following general formula,
In Eq. (12.21), is the RHS of Eq. (12.19) (again, note that this is true when the ODE is expressed in standard form). The function is referred to as the integrating factor (I.F.). Integrating factors are often introduced in equations involving differentials to help us follow a solution technique. Here, we use an I.F. that is guaranteed to work for first order, linear ODEs. Later in this chapter, we discuss another I.F. which is to be used to turn inexact to exact ODEs (see Subsec. 12.4.3).
Derivation of solution formula
While having formulae available to express solutions to certain types of ODEs is useful in application, memorising them offers little insight into the mathematics of differential equations. Here, we derive the general solution formula given by Eq. (12.21) starting from the linear ordinary differential equation (LODE), given by Eq. (12.19). 1. Assume there exists an I.F. given by where . Starting from the standard form ODE (12.19), multiply by said factor.
- Our objective is to find an I.F. that allows us to express the entire LHS of Eq. (12.22) as the derivative of something. We observe that we can reduce the LHS of (12.22) as follows
as long as the following ODE is satisfied,
Note that is a function which we define ourselves to facilitate the solution of the ODE; for this reason, we are free to define the ODE in Eq. (12.24). Equation (12.24) represents an ODE which we can solve for the I.F., .
- Reducing the LHS of Eq. (12.22) to the form given by (12.23), we can express the ODE (12.22) as
where is what we want to solve for.
- To solve for , we integrate both sides of Eq. (12.25) wrt . Note that, as the -derivative of a product, integrating wrt simply gives the product itself:
- Finally, solving for gives the formula given previously in Eq. (12.21).
Integrating factor
The derivation of the solution given by Eq. (12.21) is subject to the condition given by Eq. (12.24). The condition (12.24) is an ODE for ( is the independent variable, is the dependent variable) and it is separable. Therefore, by separating the variables in Eq. (12.24),
Integrating both sides of Eq. (12.27),
Exponentiating both sides of Eq. (12.28) yields , as
Equation (12.29) represents the integrating factor for a first order, LODE, in standard form. A typical solution process for first order, LODEs is given next.
General solution method
Here we outline a solution technique to solve LODEs of the form given by (12.19), or any LODE that can be put in that form. Note again that this is used for ; for , we use the method of separation of variables.
Step 1: Check if the ODE is in standard form; if not, put ODE in standard form.
Step 2: Find the integrating factor using
First, integrate wrt (or, more accurately, find any function whose derivative is ; in other words, when integrating wrt , ignore constants of integration). Second, exponentiate the integration result to obtain .
Step 3: Multiply the ODE throughout by the I.F. [like in Eq. (12.22).
Step 4: The LHS of the ODE obtained in Step 3 is always equivalent to
Checking that this is true verifies that the I.F. has been found correctly. Rewrite the ODE so that the LHS is written in the reduced form [like in Eq. (12.25)].
Step 5: Integrate both sides wrt to obtain the solution [like in Eq. (12.26)]. Note, that if you were to include a constant of integration in Step 2, this would ultimately be grouped with the constant of integration obtained in this step. For a first order ODE, the general solution can at most have one unknown constant to be solved with a single IC.
The idea behind the solution technique outlined in this section is that, given the appropriate integrating factor, it possible to express the LHS of Eq. (12.19) as the -derivative of a product of functions; this technique makes it exceptionally easy to solve linear ODEs which at first sight may look tedious and complicated. Now let us look at a specific example to demonstrate the ideas communicated in the solution process in this section. Example 12.3 Find the general solution to the following ODE,
Solution We note that the ODE is a first order, LODE so we can use the integrating factor method to arrive at a solution for .
- The ODE is already in standard form with and .
- Obtain the I.F. using Eq. (12.29).
(a) Find the integral of :
(b) Exponentiate the result to find :
- Multiply by :
- The LHS of Eq. (12.31) is equivalent to .
Rewriting (12.31) using the reduced form of the LHS,
Integrating both sides of Eq. (12.32) wrt
which gives the general solution as
Mixing problems
In this course we will deal with so-called mixing problems which typically involve a 'tank' into which a certain substance is added at a certain input rate (measured in units of ) and the substance leaves the system at a certain output rate (also measured in units of . Figure 12.2 shows a schematic of a typical setup; the inlet stream may contain a mixture of solute and solvent or pure solvent while the exit stream contains the well-mixed solute and solvent. At any time, , there exists some amount of solute in the mixing tank which we denote by . Our objective is to formulate an ODE to solve for the amount of solute in the tank at ; we can describe this mathematically by considering a material balance as follows:
Figure 12.2: A typical setup of a mixing tank showing inlet and outlet streams.
These types of problems are often described by first order, linear ODEs which may be solved by the technique outlined in this section. The rates are described by the product of a flowrate ([volume]/[time]) and concentration ([mass]/[volume]). Typical notation for flowrate in, out is given by and inlet concentration is denoted by . The outlet concentration is unknown, time-dependent, and it is the quantity we associate with , the amount of solute in the tank:
Note that while are usually known parameters and constant in such problems, they may also be functions of time and/or space. Expressing ODE (12.34) in terms of the new notation, we have
where is the volume of liquid in the tank. Equation (12.35) is a linear, first order ODE for . In order to arrive at an ordinary different equation describing the problem (i.e. a single independent variable in the DE), we assume that mixing is done instantaneously. This implies that once the inlet stream contents enter the tank, mixing is done instantaneously such that the concentration is not space dependent and only varies with time. In Eq. (12.35), the volume of liquid in the tank, , may: be constant if such that the level of the liquid remains unchanged, increase if , or decrease if .
Example 12.4 A tank initially holds of solution containing of dissolved salt. A solution of water and salt enters the tank at a rate of containing 0.05 of salt. The mixture flows out of the tank at a rate of . Formulate the IVP and determine the amount of salt in the tank at time .
Solution To formulate the IVP, we need to perform a material balance to describe the rate of change of amount of salt in tank and provide an IC giving the amount of salt initially i.e. at . Following (12.35),
Note that is constant since . The ODE (12.36) is linear and can therefore be solved using an I.F. but it is also separable since it can be put in the form of (12.1). Here, we choose to use the I.F. method. When (12.36) is expressed in standard form, we have and ; the I.F. is:
With the help of the I.F., we can rewrite the standard form version of ODE (12.36) as
which, upon integration, gives the general solution as:
Finally, applying the IC , we obtain the following particular solution,
The limiting value of (i.e. as ) is , which corresponds to a concentration of . This value is equivalent to the concentration of the inlet stream. This makes sense since the inlet and outlet flowrates are equal, it is expected that, after a long time, the concentration of salt in the tank approaches that of the inlet stream.
Exercises
- Solve the following IVP,
- Solve the following ODE giving your answer in explicit form,
- A tank initially holds of solution containing of dissolved salt. A solution of water and salt enters the tank at a rate of containing of salt. The mixture flows out of the tank at a rate of . The maximum capacity of the tank is . Formulate the IVP and determine the concentration of the salt in the tank when the tank is at the point of overflowing.