Skip to main content

Section 2.6 Linear Equations and Integrating Factors

First order linear equation have the following general form.
\begin{equation*} a(t) \frac{dy}{dt} + b(t) y = f(t) \end{equation*}
Here \(a(t)\text{,}\) \(b(t)\) and \(f(t)\) are various (usually continuous) functions. If I avoid the values where \(a(t) = 0\text{,}\) I can divide by \(a(t)\) to isolate the derivative, giving the following more typical form. (Remember the denominators! I have to pay attention to the roots of \(a(t)\) throughout the solution, since they indicate values of \(t\) where the solutions might not exist or might not have the expected behaviour.)
\begin{equation*} \frac{dy}{dt} + P(t) y = Q(t) \end{equation*}
This will be the standard form for the analysis that I will present. To solve equations in this standard form, I work by steps. The first step is to solve a related but easier equation called the homogeneous equation.

Subsection 2.6.1 Homogeneous Solutions

Definition 2.6.1.

A first order linear DE, written in the standard form, is called homogeneous if \(Q(t) = 0\text{.}\)
A homogeneous first order linear DE is relatively easy to solve as a separable equation. I’ll use the standard method for solving a separable equation.
\begin{align*} \frac{dy}{dt} \amp = -P(t) y\\ \frac{1}{y} \frac{dy}{dt} \amp = -P(t) \\ \int \frac{1}{y} \frac{dy}{dt} dt \amp = \int -P(t) dt \\ \int \frac{1}{y} dy \amp = -\int P(t) dt\\ \ln |y| \amp = -\int P(t) dt + c\\ y \amp = c e^{-\int P(t)} dt \end{align*}
I should make a couple of notes about this calculation.
  • I use the previously mentioned informal carelessness to make the constant easy to deal with. When I take exponents of each side of the equation, I should have multiplication by \(e^c\text{.}\) However, since this is still an undetermined constant, I simply write \(c\) instead of \(e^c\text{.}\) Also, when I drop the absolute value bars from \(y\text{,}\) we should have a ‘\(\pm\)’. Again, since \(c\) can be either positive or negative, I don’t worry about that \(\pm\text{.}\) This detail is captured in this constant which will be determined by the initial conditions.
  • I had a \(y\) in the denominator for this process, which means that I have to be careful at points where \(y=0\text{.}\) I would need to use limits to figure out behaviour when \(y\) gets close to zero.
  • If \(P\) is constant, this is just the basic percentage growth equation with solution \(y = ce^{-\alpha t}\text{.}\) If \(\alpha\) is positive, this is decay, and if \(\alpha\) is negative, this is growth.

Subsection 2.6.2 Linear Operators and Superposition

Now I know how to approach homogeneous equations and I’m going to use this to approach the general linear DE. However, before doing so, I want to introduce some very useful tools and terminology. Recall from Definition 2.1.4 the idea of differential operators. If I write \(L = \frac{d}{dt} + P(t)\text{,}\) then I can use the differential operator to write a linear equation in a very simple form.
\begin{equation*} L y = Q(t)\text{.} \end{equation*}
This \(L\) is a linear differential operator, so it behaves linearly, that is, it has the two linearity properties. (In linear algebra language, it is a linear transformation. Only, now, instead of being a transformation sending vectors to vectors, it is a transformation sending functions to functions.)
\begin{align*} L(y_1 + y_2) \amp = Ly_1 + Ly_2\\ L(cy) \amp = cL(y) \end{align*}
Now consider both the homoegenous equation \(Ly = 0\) and a non-homogenous equation \(Ly = Q(t)\text{.}\) If \(f\) is a solution to the non-homogenous equation, then \(Lf = Q(t)\text{,}\) and if \(g\) is a solution to the homogenous equation, then \(Lg = 0\text{.}\) Now I can use linearity to calculate what happens when I apply the operator \(L\) to the sum \(f + \alpha g\text{,}\) for any real number \(\alpha\text{.}\)
\begin{equation*} L(f+\alpha g) = Lf + \alpha Lg = Q(t) + \alpha \cdot 0 = Q(t) \end{equation*}
Let me write this in general and use it for a definition.

Definition 2.6.2.

If \(f\) is a solution to a non-homogenous first order linear DE \(Ly=Q(t)\) and \(g\) is a solution to the homogeneous equation \(Ly = 0\text{,}\) then all other solutions to the non-homogeneous equaiton are formed by adding multiples of \(g\) to \(f\text{.}\) The solution \(f\) to \(Ly = Q(t)\) is called the particular solution and this process of using linearity to create more solutions is called superposition of solutions.
Again using linear algebra language, the solutions of a linear equation form an affine subspace since they can be expressed as an offset span. The non-homogenous solution is the offset and the basis of the span is any homogenous solution. Superposition constructs this offset span structure. The total space in which this linear space lives is the vector space of differentiable functions. This is an infinite dimensional vector space (uncountably infinite, even), so it is a strange object compared with \(\RR^n\text{.}\) But the language of linear algebra still applies and gives very concise and convenient description of things like sets of solutions. If the language of offset spans is not familiar, don’t worry — this won’t be required understanding for the rest of the course.

Subsection 2.6.3 Integrating Factors

Homogeneous linear differential equations are solvable since they are separable. I did this above. With the understanding of superposition, then, to solve a non-homogeneous linear differential equation, I just need to find one particular solution. To do this, I need a new technique.
Let \(L = \frac{d}{dt} + Q(t)\) be as before, and let \(y_h\) be a homogeneous solution (a solution to \(Ly = 0\)). The technique I will use is called variation of parameters. This technique says I should look for a particular solution of the type \(y_p = g(t) y_h\text{.}\) (This is part of a very general strategy in solving differential equations: make some kind of reasonable guess for what form the solution should take then investigate that form.) Using this assuming, I have to try to find the new function \(g(t)\text{.}\) In order to do that, I put my assumed solution \(g(t) y_h\) into the equation and do some manipulations. I’m going to drop the \((t)\) in most of these functions, to make it all a bit more readable. It’s up to the reader to remember that these symbols stand for functions.
\begin{equation*} Ly_p= L gy_h= Q \end{equation*}
I need to use the product rule to differentiate \(gy_h\) when I apply the differential operator to the left side
\begin{equation*} g^\prime y_h + g y_h^\prime + g P y_h = Q \end{equation*}
I can factor \(g\) out of two terms.
\begin{equation*} g^\prime y_h + g \Big( y_h^\prime + P y_h \Big) = Q \end{equation*}
The expression inside the brackets is precisely the differential operator \(L\) applied to \(y_h\text{.}\)
\begin{equation*} g^\prime y_h + g L y_h = Q \end{equation*}
Since \(y_h\) is the homogeneous solution, \(L y_h = 0\text{.}\)
\begin{equation*} g^\prime y_h + g 0 = Q \end{equation*}
Now I can solve for \(g^\prime\text{.}\)
\begin{equation*} g^\prime = \frac{Q}{y_h} \end{equation*}
Then I can integrate to find \(g\text{.}\)
\begin{equation*} g = \int \frac{Q}{y_h} \end{equation*}
Now I have an expression for \(g\text{.}\) Let me write \(y_p\) using this \(g\text{.}\)
\begin{equation*} y_p = g y_h = \left( \int \frac{Q}{e^{-\int P dt}} dt \right) y_h \end{equation*}
If I want, I can use the fact that the homogeneous solution is \(y = e^{-\int Pdt}\) to write all of \(y_p\) in terms of \(Q\) and \(P\text{.}\)
\begin{equation*} y_p = \left( \int \frac{Q}{e^{-\int P dt}} dt \right) e^{-\int P dt } = e^{-\int P dt} \int e^{\int P dt} Q dt \end{equation*}
This is a complete solution, and the presentation I’ve given is the most general presentation and introduces the useful idea of variation of parameters. However, there is a slightly different presentation of the same solution which is common is the literature and turns out to be more efficient for actually solving these DEs. It involves the following definition.

Definition 2.6.3.

In solving a linear equation of the form \(\frac{dy}{dt} + P y = Q\text{,}\) the expression \(e^{\int P dt}\) is called an integrating factor and it is written \(\mu(t)\text{.}\)
Let me do some algebra again with this new definition. First, I’ll take the full expression for \(y_p\) I ended with above and move the first exponential to the right side. Then I can differentiate both sides and replace the integrating factor with the notation I just introduced.
\begin{align*} e^{\int P y} y_p \amp = \int e^{\int P dt} Q dt\\ \frac{d}{dt} \left( e^{\int P dt} y_p \right) \amp = e^{\int P dt} Q\\ \frac{d}{dt} (\mu y_p) \amp = \mu Q\\ y_p \amp = \frac{\int \mu Q dt + c}{\mu } \end{align*}
Let me emphasize what has happened here: multiplying by the integrating factor turns the expression \(y_p^\prime + P y_p\) into something that looks like the result of a a product rule derivative. Since it is the result of a derivative, it can be easily integrated. This explain the name: the integrating factor is something I multiply by to allow the DE to be directly integrated. It is best to remember the process this way: the original DE becomes a product rule derivative problem by multiplying both sides of the original DE by the integrating factor and then isolating \(y_p\text{.}\) In practice, this is often the most efficient way to actually go about solving a linear DE; it is the method I will use in the examples and my solutions to the activities.

Subsection 2.6.4 Examples

Example 2.6.4.

\begin{equation*} \frac{dy}{dt} + \frac{y}{t} = 2e^t \end{equation*}
Since there is a \(t\) in the denominator, I must avoid \(t=0\) in the domain of solutions. That doesn’t necessarily affect the process, but it is good to remember when I look at the final solutions. I first look for the homogeneous solution.
\begin{equation*} y_h = ce^{-\int \frac{1}{t}} dt = ce^{-\ln |t|} = \frac{c}{t} \end{equation*}
Then I calculate the integrating factor.
\begin{equation*} \mu = e^{\int \frac{1}{t} dt } = e^{\ln |t|} = t\text{.} \end{equation*}
I multiply the original non-homogeneous equation by the integrating factor. This, as always, will turn the left side of the equation into the output of a product rule derivative. After expressing it as such a derivative, I integrate both sides to remove the derivative.
\begin{align*} \mu \frac{dy}{dt} + \mu \frac{y}{t} \amp = \mu 2e^t\\ t \frac{dy}{dt} + t \frac{y}{t} \amp = t 2e^t\\ \frac{d}{dt} (t y) \amp = 2te^t\\ \int \frac{d}{dt} (t y) dt \amp = \int 2te^t dt\\ ty \amp = 2(te^t - e^t) + c\\ y \amp = 2 \left( e^t - \frac{e^t}{t} \right) + \frac{c}{t} \end{align*}
Notice that I actually get the the homogeneous pieces here from the constant of integration, getting the whole linear family. The family already has the expected form: a particular solution added to some multiple (using the parameter \(c\)) of the homogeneous solution. Also notice that \(t=0\) is excluded from the domain of the solution, as I expected from the form of the original equation.

Example 2.6.5.

\begin{equation*} (t^2-9) \frac{dy}{dt} + ty = 0 \end{equation*}
This is just a homogeneous DE. I can notice that \(t \neq \pm 3\) in the domain, since the term \(t^2 - 9\) will be in the denominator when I write this in the standard form. The solution to the homogeneous case is calcualted directly by integration.
\begin{align*} y \amp = e^{-\int P dt} = e^{-\int \frac{t}{t^2-9} dt} = e^{ - \frac{1}{2} \ln |t^2-9| + c} \\ \amp = c \left( e^{\ln |t^2 - 9|} \right)^{-\frac{1}{2}} = \frac{c}{\sqrt{|t^2-9|}} = \frac{c}{\sqrt{t^2-9}}\text{.} \end{align*}
Again, I treat the constant of integration informally, writing just \(c\) instead of the \(e^c\) that a more formal treatment would give. Also, in the last step, droping the absolute value is acceptable since the term inside the square root must be positive. I should be a bit careful, though, since in the form I have written, I am actually missing solutions. The issues with absolute values in logarithms arising from integrals can often be problematic like this. To find the remaining solution, I write \(|t^2 - 9|\) instead as \(|9-t^2|\text{.}\) Then the solution would have a differen form.
\begin{equation*} y = \frac{c}{\sqrt{|9 - t^2|}} = \frac{c}{\sqrt{9 - t^2}}\text{.} \end{equation*}
The two solutions are both valid, for any positive value of \(c\text{.}\) How can both solutions exist? They exist because they have non-overlaping domains. The first solution is defined on \((-3,3)\text{.}\) The second is defined on \((-\infty, -3) \cup (3, \infty)\text{.}\) Both domains avoid \(\pm 3\text{,}\) which was expected from the original equation.

Example 2.6.6.

\begin{equation*} \frac{dy}{dt} + y = Q \end{equation*}
To add some complication to this particular example, the non-homogeneous piece \(Q\) here is a step function.
\begin{equation*} Q = \left\{ \begin{matrix} 1 \amp 0 \leq t \leq 1 \\ 0 \amp t > 1 \end{matrix} \right. \end{equation*}
This is still allowed: often the coefficients and functions involved in DEs are only piecewise continuous and/or piecewise differentiable. I can still work with them. This step function is discontinuous, but still integrable. One of the reasons piecewise-continuous function are allowed is because they are always integrable. The integrating factor is \(\mu = e^{\int 1 dt} = e^t\text{.}\) Since \(Q\) is discontinuous, I have to work with two different intervals to cover the two different behaviours. First, I’ll look at look at \([0,1]\) and apply the standard method of solution: multiplying by the integrating factor and integrating.
\begin{equation*} \frac{d}{dt} e^t y = e^t \implies e^ty = e^t + c_1 \implies y = 1 + c_1e^{-t} \end{equation*}
Second, I’ll look at the remainder of the domain, which is the interval \((1,\infty)\text{.}\) I apply the same method.
\begin{equation*} \frac{d}{dt} e^t y = 0 \implies e^ty = t + c_2 \implies y = c_2e^{-t} \end{equation*}
This process gives two pieces of the solution, each with their own constant of integration. However, I want the solution to be continuous. (This is also typical: even with a discontinuous term in the original equation, I expect the result of solving the DE to give me something continuous.) The solution will fail to be differentiable at \(t=1\text{,}\) but that’s alright. There is a sudden change in the situation at that point, so a sharp corner is expected. Continuity at \(1\) means that the limit from the left and the limit from the right approaching \(1\) must be equation. If I calculate both of those limits, I get the equation \(e-c_1 = c_2\text{.}\) This lets me replace \(c_2\) with \(e - c_1\) in the second piece of the function. The result is only one constant, which is the expected behaviour for a first order differential equation. Here is the final solution, a piecewise function with only one parameter \(c\text{.}\)
\begin{equation*} y = \left\{ \begin{matrix} 1 + ce^{-t} \amp t \in [0,1] \\ (e-c)e^{-t} \amp t \in (1,\infty) \end{matrix} \right. \end{equation*}
Since there is only one parameter, initial value problems are solvable. If I am given the initial value \(y(0) =0\text{,}\) I find that \(c=1\) and I can produce a unique solution.