Differential Equations for EngineersXYZ Homework Edition

⇩ Download ▾

3.9 Nonhomogeneous systems

First Order Constant Coefficient

Integrating factor

Let us first focus on the nonhomogeneous first order equation

x ( t ) = A x ( t ) + f ( t ) , \vec{x}'(t) = A\vec{x} (t) + \vec{f}(t), \nonumber

where AA is a constant matrix. The first method we will look at is the integrating factor method. For simplicity we rewrite the equation as

x ( t ) + P x ( t ) = f ( t ) , \vec{x}'(t) + P\vec{x}(t) = \vec{f}(t), \nonumber

where P=AP = -A. We multiply both sides of the equation by etPe^{tP} (being mindful that we are dealing with matrices that may not commute) to obtain

e t P x ( t ) + e t P P x ( t ) = e t P f ( t ) . e^{tP} \vec{x}(t) + e^{tP} P\vec{x}(t) = e^{tP}\vec{f}(t). \nonumber

We notice that PetP=etPPPe^{tP}=e^{tP}P. This fact follows by writing down the series definition of etPe^{tP},

P e t P = P ( 𝐼 + 𝐼 + t P + 1 2 ( t P ) 2 + ) = P + t P 2 + 1 2 t 2 P 3 + = ( 𝐼 + 𝐼 + t P + 1 2 ( t P ) 2 + ) P = P e t P \begin{align}\begin{aligned} Pe^{tP} &= P \left( \mathit{I} + \mathit{I} + tP + \frac{1}{2} \left(tP \right)^2 + \cdots \right) = P + tP^2 +\frac{1}{2} t^2 P^3 + \cdots \\ &= \left( \mathit{I} +\mathit{I} +tP +\frac{1}{2}(tP)^2 + \cdots \right) P = Pe^{tP} \end{aligned}\end{align} \nonumber

We have already seen that ddx(etP)=PetP=etPP\frac{\mathrm{d}}{\mathrm{d}x}\left( e^{tP} \right) = Pe^{tP} =e^{tP}P. The product rule says,

d d t ( e t P x ( t ) ) = e t P x ( t ) + e t P P x ( t ) , \frac{d}{dt}\left(e^{tP}\vec{x}(t)\right)=e^{tP}\vec{x}'(t)+e^{tP}P\vec{x}(t), \nonumber

and so

d d t ( e t P x ( t ) ) = e t P f ( t ) . \frac{\mathrm{d}}{\mathrm{d}t} \left(e^{tP} \vec{x}(t) \right) = e^{tP} \vec{f}(t). \nonumber

We can now integrate. That is, we integrate each component of the vector separately

e t P x ( t ) = e t P f ( t ) d t + c . e^{tP}\vec{x}(t) = \int e^{tP}\vec{f}(t) dt +\vec{c}. \nonumber

Recall from Exercise 3.8.6 that (etP)1=etP\left( e^{tP} \right)^{-1} = e^{-tP}. Therefore, we obtain

x ( t ) = e t P e t P f ( t ) d t + e t P c . \vec{x}(t) = e^{-tP} \int e^{tP} \vec{f}(t) dt + e^{-tP} \vec{c}. \nonumber

Perhaps it is better understood as a definite integral. In this case it will be easy to also solve for the initial conditions as well. Suppose we have the equation with initial conditions

x ( t ) + P x ( t ) = f ( t ) , x ( 0 ) = b . \vec{x}'(t) + P\vec{x}(t) = \vec{f}(t), \quad \vec{x}(0) = \vec{b}. \nonumber

The solution can then be written as

x ( t ) = e t P 0 t e s P f ( s ) d s + e t P b . \label{eq:10} \vec{x}(t) = e^{-tP} \int_{0}^{t} e^{sP}\vec{f}(s) ds +e^{-tP}\vec{b}.

(3.9.1)

Again, the integration means that each component of the vector esPf(s)e^{sP} \vec{f}(s) is integrated separately. It is not hard to see that (3.9.1) really does satisfy the initial condition x(0)=b\vec{x}(0) = \vec{b}

x ( 0 ) = e 0 P 0 0 e s P f d s + e 0 P b = 𝐼 b = b . \vec{x}(0) = e^{-0P} \int_{0}^{0} e^{sP} \vec{f} ds + e^{-0P} \vec{b} = \mathit{I} \vec{b} =\vec{b}. \nonumber

For systems, the integrating factor method only works if PP does not depend on tt, that is, PP is constant. The problem is that in general

d d t [ e P ( t ) d t ] P ( t ) e P ( t ) d t , \frac{\mathrm{d}}{\mathrm{d}t} [e^{\int P(t) dt}] \neq P(t) e^{\int P(t) dt}, \nonumber

because matrix multiplication is not commutative.

Eigenvector Decomposition

For the next method, we note that eigenvectors of a matrix give the directions in which the matrix acts like a scalar. If we solve our system along these directions these solutions would be simpler as we can treat the matrix as a scalar. We can put those solutions together to get the general solution.

Take the equation

x ( t ) = A x ( t ) + f ( t ) \label{eq:19}\vec{x}'(t) = A\vec{x}(t) + \vec{f}(t)

(3.9.2)

Assume that AA has nn linearly independent eigenvectors x1,,xn.\vec{x}_1, \ldots, \vec{x}_n. Let us write

x ( t ) = v 1 ξ 1 ( t ) + v 2 ξ 2 t + + v n ξ n ( t ) \label{eq:20}\vec{x}(t) = \vec{v_1}\xi_1(t) + \vec{v_2}\xi_2{t} + \cdots + \vec{v_n} \xi_n(t)

(3.9.3)

That is, we wish to write our solution as a linear combination of eigenvectors of AA. If we can solve for the scalar functions ξ1\xi_1through ξn\xi_n we have our solution x\vec{x}. Let us decompose f\vec{f} in terms of the eigenvectors as well. We wish to write

f ( t ) = v 1 g 1 ( t ) + v 2 g 2 t + + v n g n ( t ) \label{eq:21} \vec{f}(t) = \vec{v_1}g_1(t) + \vec{v_2}g_2{t} +\cdots + \vec{v_n}g_n(t)

(3.9.4)

That is, we wish to find g1g_1 through gng_n that satisfy (3.9.4). We note that since all the eigenvectors are independent, the matrix E=[v1v2vn]E = \begin{bmatrix} \vec{v_1}&\vec{v_2}&\cdots&\vec{v_n} \end{bmatrix} is invertible. We see that (3.9.4) can be written as f=Eg\vec{f} = E\vec{g}, where the components of g\vec{g}are the functions g1g_1 through gng_n. Then g=E1f\vec{g} = E^{-1} \vec{f}. Hence it is always possible to find g\vec{g} when there are n linearly independent eigenvectors.

We plug (3.9.3) into (3.9.2), and note that Avk=λkvkA\vec{v}_k = \lambda_k\vec{v}_k.

v 1 ξ 1 + v 2 ξ 2 + + v n ξ n x = A ( v 1 ξ 1 + v 2 ξ 2 + + v n ξ n ) A x + v 1 g 1 + v 2 g 2 + + v n g n f = A v 1 ξ 1 + A v 2 ξ 2 + + A v n ξ n + v 1 g 1 + v 2 g 2 + + v n g n = v 1 λ 1 ξ 1 + v 2 λ 2 ξ 2 + + v n λ n ξ n + v 1 g 1 + v 2 g 2 + + v n g n = v 1 ( λ 1 ξ 1 + g 1 ) + v 2 ( λ 2 ξ 2 + g 2 ) + + v n ( λ n ξ n + g n ) . \begin{align}\begin{aligned} \overset{\vec{x}'}{\overbrace{\vec{v}_{1}\xi_{1}'+\vec{v}_{2}\xi_{2}'+\cdots +\vec{v}_{n}\xi_{n}'}}&=\overset{A\vec{x}}{\overbrace{A\left(\vec{v}_{1}\xi_{1}+\vec{v}_{2}\xi_{2}+\cdots +\vec{v}_{n}\xi_{n}\right)}}+\overset{\vec{f}}{\overbrace{\vec{v}_{1}g_{1}+\vec{v}_{2}g_{2}+\cdots +\vec{v}_{n}g_{n}}} \\ &= A\vec{v_1}\xi_1 + A\vec{v_2}\xi_2 + \cdots + A\vec{v_n}\xi_n + \vec{v_1}g_1 + \vec{v_2}g_2 +\cdots + \vec{v_n}g_n \\ &= \vec{v_1}\lambda_1\xi_1 + \vec{v_2}\lambda_2\xi_2 + \cdots + \vec{v_n}\lambda_n\xi_n + \vec{v_1}g_1+\vec{v_2}g_2 + \cdots +\vec{v_n}g_n \\ &=\vec{v_1}\left(\lambda_1\xi_1 + g_1 \right) +\vec{v_2}\left(\lambda_2\xi_2 + g_2 \right) +\cdots +\vec{v_n}\left(\lambda_n\xi_n + g_n \right). \end{aligned}\end{align} \nonumber

If we identify the coefficients of the vectors v1\vec{v}_1 through vn\vec{v}_n we get the equations

ξ 1 = λ 1 ξ 1 + g 1 , ξ 2 = λ 2 ξ 2 + g 2 , ξ n = λ n ξ n + g n . \begin{align}\begin{aligned} \xi'_1 &= \lambda_1\xi_1 + g_1, \\ \xi'_2 &= \lambda_2\xi_2 + g_2, \\ & \vdots \\ \xi'_n &= \lambda_n\xi_n + g_n. \end{aligned}\end{align} \nonumber

Each one of these equations is independent of the others. They are all linear first order equations and can easily be solved by the standard integrating factor method for single equations. That is, for example for the kthk^{th}equation we write

ξ k ( t ) λ k ξ k ( t ) = g k ( t ) . \xi'_k(t) - \lambda_k \xi_k(t) = g_k(t).

We use the integrating factor eλkte^{-\lambda_k t} to find that

d d x [ ξ k ( t ) e λ k t ] = e λ k t g k ( t ) . \frac{\mathrm{d}}{\mathrm{d}x} \left[ \xi_k(t) e^{-\lambda_k t} \right] = e^{-\lambda_k t} g_k(t). \nonumber

Now we integrate and solve for ξk\xi_k to get

ξ k ( t ) = e λ k t e λ k t g k ( t ) d t + C k e λ k t . \xi_k (t) = e^{\lambda_k t} \int e^{-\lambda_k t }g_k(t) dt + C_k e^{\lambda_k t}. \nonumber

If we are looking for just any particular solution, we can set CkC_{k} to be zero. If we leave these constants in, we get the general solution. Write x(t)=v1ξ1(t)+v2ξ2(t)++vnξn(t)\vec{x}(t)=\vec{v}_{1}\xi_{1}(t)+\vec{v}_{2}\xi_{2}(t)+\cdots +\vec{v}_{n}\xi_{n}(t), and we are done.

Again, as always, it is perhaps better to write these integrals as definite integrals. Suppose that we have an initial condition x(0)=b\vec{x}(0) = \vec{b}. We take c=E1b\vec{c}= E^{-1} \vec{b} and note b=v1a1++vnan\vec{b} = \vec{v_1}a_1 + \cdots + \vec{v_n} a_n, just like before. Then if we write

ξ k ( t ) = e λ k ( t ) 0 t e λ k s g k ( s ) d t + a k e λ k t , \xi_k(t) = e^{\lambda_k(t)} \int_{0}^{t} e^{-\lambda_ks} g_k(s)dt + a_k e^{\lambda_kt}, \nonumber

we will actually get the particular solution x(t)=v1ξ1+x2ξ2++vnξn\vec{x}(t) = \vec{v}_1\xi_1 + \vec{x}_2 \xi_2 + \cdots + \vec{v}_n\xi_n satisfying x(0)=b\vec{x}(0) = \vec{b}, because ξk(0)=ak\xi_k(0) = a_k.

Let us remark that the technique we just outlined is the eigenvalue method applied to nonhomogeneous systems. If a system is homogeneous, that is, if f=0\vec{f}=\vec{0}, then the equations we get are ξk=λkξk\xi_{k}'=\lambda_{k}\xi_{k}, and so ξk=Ckeλkt\xi_{k}=C_{k}e^{\lambda_{k}t} are the solutions and that’s precisely what we got in Section 3.4.

Undetermined Coefficients

We also have the method of undetermined coefficients for systems. The only difference here is that we will have to take unknown vectors rather than just numbers. Same caveats apply to undetermined coefficients for systems as for single equations. This method does not always work. Furthermore if the right hand side is complicated, we will have to solve for lots of variables. Each element of an unknown vector is an unknown number. So in system of 33 equations if we have say 44 unknown vectors (this would not be uncommon), then we already have 1212 unknown numbers that we need to solve for. The method can turn into a lot of tedious work. As this method is essentially the same as it is for single equations, let us just do an example.

As you can see, other than the handling of conflicts, undetermined coefficients works exactly the same as it did for single equations. However, the computations can get out of hand pretty quickly for systems. The equation we had done was very simple.

First Order Variable Coefficient

Variation of Parameters

Just as for a single equation, there is the method of variation of parameters. In fact for constant coefficient systems, this is essentially the same thing as the integrating factor method we discussed earlier. However, this method will work for any linear system, even if it is not constant coefficient, provided we can somehow solve the associated homogeneous problem.

Suppose we have the equation

x = A ( t ) x + f ( t ) . \label{eq:43} \vec{x}'= A(t) \vec{x}+\vec{f}(t).

(3.9.5)

Further, suppose we have solved the associated homogeneous equation x=A(t)x\vec{x}'= A(t) \vec{x} and found the fundamental matrix solution X(t)X(t). The general solution to the associated homogeneous equation is X(t)cX(t) \vec{c} for a constant vector c\vec{c}. Just like for variation of parameters for single equation we try the solution to the nonhomogeneous equation of the form

x p = X ( t ) u ( t ) , \vec{x}_p = X(t) \vec{u}(t), \nonumber

where u(t)\vec{u}(t) is a vector valued function instead of a constant. Now we substitute into (3.9.5) to obtain

xp(t)=X(t)u(t)+X(t)u(t)xp(t)=A(t)X(t)u(t)A(t)xp(t)+f(t).{\vec{x}_p}'(t) = \underbrace{X'(t)\, \vec{u}(t) + X(t)\, {\vec{u}}'(t)} _{{\vec{x}_p}'(t)} = \underbrace{A(t)\, X(t)\, \vec{u}(t)} _{A(t) \vec{x}_p (t)} + \vec{f}(t). \nonumber

But X(t)X(t) is a fundamental matrix solution to the homogeneous problem. So X(t)=A(t)X(t)X'(t) = A(t)X(t), and

X(t)u(t)+X(t)u(t)=X(t)u(t)+f(t).\cancel{X'(t)\, \vec{u}(t)} + X(t)\, {\vec{u}}'(t) = \cancel{X'(t)\, \vec{u}(t)} + \vec{f}(t). \nonumber

Hence X(t)u(t)=f(t)X(t) \vec{u}'(t) = \vec{f}(t). If we compute [X(t)]1[ X(t)]^{-1}, then u(t)=[X(t)]1f(t)\vec{u}'(t) =[ X(t)]^{-1} \vec{f}(t). We integrate to obtain u\vec{u} and we have the particular solution xp=X(t)u(t)\vec{x}_p = X(t) \vec{u}(t). Let us write this as a formula

x p = X ( t ) [ X ( t ) ] 1 f ( t ) d t . \vec{x}_p = X(t) \int [ X(t)]^{-1} \vec{f}(t)dt. \nonumber

Note that if AA is constant and we let X(t)=etAX(t) = e^{tA}, then [X(t)]1=etA[ X(t)]^{-1} =e^{-tA} and hence we get a solution xp=etAetAf(t)dt\vec{x}_p = e^{tA} \int e^{-tA} \vec{f}(t)dt, which is precisely what we got using the integrating factor method.

In the variation of parameters, just like in the integrating factor method we can obtain the general solution by adding in constants of integration. That is, we will add X(t)cX(t) \vec{c} for a vector of arbitrary constants. But that is precisely the complementary solution.

Second Order Constant Coefficients

Undetermined Coefficients

We have already seen a simple example of the method of undetermined coefficients for second order systems in Section 3.6. This method is essentially the same as undetermined coefficients for first order systems. There are some simplifications that we can make, as we did in Section 3.6. Let the equation be

x = A x + f ( t ) , \vec{x}'' = A \vec{x} + \vec{f}(t), \nonumber

where AA is a constant matrix. If F(t)\vec{F}(t) is of the form F0cos(ωt)\vec{F}_0 \cos(\omega t), then as two derivatives of cosine is again cosine we can try a solution of the form

x p = c cos ( ω t ) , \vec{x}_p = \vec{c} \cos(\omega t), \nonumber

and we do not need to introduce sines.

If the F\vec{F} is a sum of cosines, note that we still have the superposition principle. If F(t)=F0cos(ω0t)+F1cos(ω1t)\vec{F}(t)= \vec{F}_0 \cos(\omega_0 t)+\vec{F}_1 \cos(\omega_1 t), then we would try acos(ω0t)\vec{a} \cos(\omega_0 t) for the problem x=Ax+F0cos(ω0t)\vec{x}''=A \vec{x} + \vec{F}_0 \cos(\omega_0 t), and we would try bcos(ω1t)\vec{b} \cos(\omega_1 t) for the problem x=Ax+F0cos(ω1t)\vec{x}''=A \vec{x} + \vec{F}_0 \cos(\omega_1 t). Then we sum the solutions.

However, if there is duplication with the complementary solution, or the equation is of the form x=Ax+Bx+F(t)\vec{x}'' = A \vec{x}' + B \vec{x} +\vec{F}(t), then we need to do the same thing as we do for first order systems.

You will never go wrong with putting in more terms than needed into your guess. You will find that the extra coefficients will turn out to be zero. But it is useful to save some time and effort.

Eigenvector Decomposition

If we have the system

x = A x + F ( t , ) \vec{x}'' = A \vec{x} + \vec{F}(t,) \nonumber

we can do eigenvector decomposition, just like for first order systems.

Let λ1,,λn\lambda_1, \ldots, \lambda_n be the eigenvalues and v1,,vn\vec{v}_1, \ldots, \vec{v}_n be eigenvectors. Again form the matrix E=[v1vn]E=[\vec{v}_1 \cdots \vec{v}_n]. We write

x ( t ) = v 1 ξ 1 ( t ) + v 2 ξ 2 ( t ) + + v n ξ n ( t ) . \vec{x}(t) = \vec{v}_1 \xi_1(t)+\vec{v}_2 \xi_2(t)+ \cdots+\vec{v}_n \xi_n(t). \nonumber

We decompose F\vec{F} in terms of the eigenvectors

f ( t ) = v 1 g 1 ( t ) + v 2 g 2 ( t ) + + v n g n ( t ) . \vec{f}(t)= \vec{v}_1 g_1(t) + \vec{v}_2 g_2(t) + \cdots+ \vec{v}_n g_n(t). \nonumber

And again g=E1F\vec{g} = E^{-1} \vec{F}.

Now we plug in and doing the same thing as before we obtain

v 1 ξ 1 + v 2 ξ 2 + v n ξ n x = A ( v 1 ξ 1 + v 2 ξ 2 + v n ξ n ) A x + v 1 g 1 + v 2 g 2 + + v n g n f = A v 1 ξ 1 + A v 2 ξ 2 + A v n ξ n + v 1 g 1 + v 2 g 2 + + v n g n = v 1 λ 1 ξ 1 + v 2 λ 2 ξ 2 + v n λ n ξ n + v 1 g 1 + v 2 g 2 + + v n g n = v 1 ( λ 1 ξ 1 + g 1 ) + v 2 ( λ 2 ξ 2 + g 2 ) + + v n ( λ n ξ n + g n ) . \begin{align}\begin{aligned}\overset{\vec{x}''}{\overbrace{\vec{v}_1 \xi_1''+\vec{v}_2 \xi_2''+ \cdots \vec{v}_n \xi_n''}}&=\overset{A\vec{x}}{\overbrace{A(\vec{v}_1 \xi_1+\vec{v}_2 \xi_2+ \cdots \vec{v}_n \xi_n)}}+\overset{\vec{f}}{\overbrace{\vec{v}_1 g_1+\vec{v}_2 g_2+ \cdots + \vec{v}_n g_n}} \\ &= A\vec{v}_1 \xi_1+A\vec{v}_2 \xi_2+ \cdots A\vec{v}_n \xi_n + \vec{v}_1 g_1+\vec{v}_2 g_2+ \cdots + \vec{v}_n g_n \\ &= \vec{v}_1 \lambda_1 \xi_1+\vec{v}_2 \lambda_2 \xi_2+ \cdots \vec{v}_n \lambda_n \xi_n + \vec{v}_1 g_1+\vec{v}_2 g_2+ \cdots + \vec{v}_n g_n \\ &= \vec{v}_1( \lambda_1 \xi_1 + g_1)+\vec{v}_2( \lambda_2 \xi_2 + g_2) + \cdots +\vec{v}_n( \lambda_n \xi_n + g_n). \end{aligned}\end{align} \nonumber

We identify the coefficients of the eigenvectors to get the equations

ξ 1 = λ 1 ξ 1 + g 1 , ξ 2 = λ 2 ξ 2 + g 2 , ξ n = λ n ξ n + g n . \begin{align}\begin{aligned} \xi_1''&= \lambda_1 \xi_1 + g_1, \\ \xi_2''&= \lambda_2 \xi_2 + g_2, \\ &\vdots \\ \xi_n''&= \lambda_n \xi_n + g_n. \end{aligned}\end{align} \nonumber

Each one of these equations is independent of the others. We solve each equation using the methods of Chapter 2. We write x(t)=v1ξ1(t)++vnξn(t)\vec{x}(t)= \vec{v}_1 \xi_1(t) + \cdots + \vec{v}_n \xi_n(t), and we are done; we have a particular solution. If we have found the general solution for ξ1\xi_1 through ξ2\xi_2, then again x(t)=v1ξ1(t)++vnξn(t)\vec{x}(t)= \vec{v}_1 \xi_1(t) + \cdots + \vec{v}_n \xi_n(t) is the general solution (and not just a particular solution).

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.