Artificial Intelligence 🤖
Differential equations
Ordinary differential equations
Homogeneous LODEs with constant coefficients

Homogeneous LODEs with constant coefficients

In this section, we are interested in finding solutions to the homogeneous version of Eq. (13.1) i.e. when f(x)=0f(x)=0. We start with the simplest case, where the coefficients are constants (i.e. when P(x)P(x) and Q(x)Q(x) are constants). The differential equation we want to solve is,

y+py+qy=0y^{\prime \prime}+p y^{\prime}+q y=0

By Definition 13.1, the general solution is given by

y(x)=c1y1(x)+c2y2(x).y(x)=c_{1} y_{1}(x)+c_{2} y_{2}(x) .

Our objective here is to find the pair of fundamental solutions [y1(x)\left[y_{1}(x)\right. and y2(x)]\left.y_{2}(x)\right] and use them in Eq. (13.5) to construct the general solution to Eq. (13.18).

Auxiliary equation

For LODEs with constant coefficients like Eq. (13.18), it is, it is easy to see that the equation's solution is a function which, when differentiated, gives us constant multiples of the original function. The statement above motivates us to 'guess' a solution to the ODE that takes the form y=emxy=e^{m x} where mm is unknown. Our objective is to find mm.

Differentiating y=emxy=e^{m x} wrt xx to obtain yy^{\prime} and yy^{\prime \prime}, we get y=memxy^{\prime}=m e^{m x} and y=m2emxy^{\prime \prime}=m^{2} e^{m x}. Substituting the expressions for y,yy, y^{\prime} and yy^{\prime \prime} in Eq. (13.18) and simplifying, we obtain:

emx(m2+pm+q)=0e^{m x}\left(m^{2}+p m+q\right)=0

Equation (13.19) is satisfied if emx=0e^{m x}=0 or if m2+pm+q=0m^{2}+p m+q=0. Since emx0e^{m x} \neq 0, we use the following equation to determine mm,

m2+pm+q=0m^{2}+p m+q=0

Equation (13.20) is known as the characteristic or auxiliary equation of the ODE (13.18) which needs to be satisfied if y=emxy=e^{m x} is to be a solution to ODE (13.18). The solution to the quadratic equation gives us the roots, mm as follows,

m=p±p24q2.m=\frac{-p \pm \sqrt{p^{2}-4 q}}{2} .

Assuming that pp and qq are real numbers, we consider three cases:

  1. Case 1: The characteristic equation has two real and distinct roots.
  2. Case 2: The characteristic equation has two complex roots.
  3. Case 3: The characteristic equation has one repeated root.

In what follows, we look at each case separately. Before proceeding we note the following:

  • When looking for the solution to a LODE with constant coefficients, the problem is reduced from solving an ODEO D E to solving an algebraic equation [this is the characteristic equation given by (13.20)].
  • For second order ODEs we are looking for two fundamental solutions, y1y_{1} and y2y_{2}.
  • The solutions take the form y1=em1xy_{1}=e^{m_{1} x} and y2=em2xy_{2}=e^{m_{2} x} where m1m_{1} and m2m_{2} denote the roots to the characteristic equation.
  • If there exist two roots to the characteristic equation, the general solution is,
y(x)=c1em1x+c2em2x.y(x)=c_{1} e^{m_{1} x}+c_{2} e^{m_{2} x} .

Case 1: Roots are real and distinct

If p24q>0p^{2}-4 q>0, then from Eq. (13.21), we obtain two real roots, m1m_{1} and m2m_{2}.

Fundamental solutions

The next step is to form the fundamental solutions. Recall that the characteristic equation is a result of using the ansatz, y=emxy=e^{m x} where mm is unknown, in the differential equation. The two roots are then used to form the fundamental solutions. The first solution is y1=em1xy_{1}=e^{m_{1} x} and the second is y2=em2xy_{2}=e^{m_{2} x}; of course any constant multiple of y1y_{1} (say, c1y1c_{1} y_{1} ) and any constant multiple of y2y_{2} (say, c2y2c_{2} y_{2} ) are also solutions to the ODE.

General solution

With knowledge of the pair of fundamental solutions, we can construct the general solution by forming a linear combination.

If the roots of the characteristic equation (13.20), m1m_{1} and m2m_{2} are real and distinct, then the general solution to (13.18), is given by

y(x)=c1em1x+c2em2x.y(x)=c_{1} e^{m_{1} x}+c_{2} e^{m_{2} x} .

Example 13.2 Find the general solution to the following ODE:

yy2y=0y^{\prime \prime}-y^{\prime}-2 y=0

Solution First we notice that the ODE is homogeneous with constant coefficients implying that the solutions to the ODE are exponential and the exponents are the roots to the corresponding characteristic equation. The characteristic equation is,

m2m2=0m^{2}-m-2=0

which gives m1=2m_{1}=2 and m2=1m_{2}=-1. The roots are real and distinct so from Eq. (13.22), the general solution is,

y(x)=c1e2x+c2ex.y(x)=c_{1} e^{2 x}+c_{2} e^{-x} .

Case 2: Roots are complex conjugates

If p24q<0p^{2}-4 q<0, then from Eq. (13.21), we obtain two complex roots, m1m_{1} and m2m_{2}. These two roots are conjugates,

m1=a+bi and m2=abi,m_{1}=a+b i \quad \text { and } \quad m_{2}=a-b i,

where aa and bb are real numbers. Note that aa may be zero. As in Case 1\mathbf{1}, this gives two linearly independent solutions: y1=em1xy_{1}=e^{m_{1} x} and y2=em2xy_{2}=e^{m_{2} x}. Consequently, the linear combination of y1y_{1} and y2y_{2} make up the general solution

y(x)=c1em1x+c2em2x.y(x)=c_{1} e^{m_{1} x}+c_{2} e^{m_{2} x} .

Of course a natural question that arises is what becomes of the exponential function if the exponents are complex numbers? The answer to that question is given by Euler's formula, defined below (see also Section 7.2 in Chapter 7).

Definition 13.2 Euler's formula states that for any real number x,eixx, e^{i x} is given by,

eix=cosx+isinxe^{i x}=\cos x+i \sin x

Equation (13.26) gives the form of the complex roots, m1m_{1} and m2m_{2}. So, for m1=a+ibm_{1}=a+i b, the exponential function y1=em1xy_{1}=e^{m_{1} x} becomes,

em1x=e(a+ib)x=eaxeibx=eax[cos(bx)+isin(bx)].e^{m_{1} x}=e^{(a+i b) x}=e^{a x} e^{i b x}=e^{a x}[\cos (b x)+i \sin (b x)] .

Similarly, for m2=aibm_{2}=a-i b, we have,

em2x=e(aib)x=eaxeibx=eax[cos(bx)isin(bx)].e^{m_{2} x}=e^{(a-i b) x}=e^{a x} e^{-i b x}=e^{a x}[\cos (b x)-i \sin (b x)] .

From Eqs. (13.28) and (13.29), we can construct the general solution,

y(x)=k1eax[cos(bx)+isin(bx)]+k2eax[cos(bx)isin(bx)].y(x)=k_{1} e^{a x}[\cos (b x)+i \sin (b x)]+k_{2} e^{a x}[\cos (b x)-i \sin (b x)] .

However, the general solution given by (13.30) is a complex-valued function; this means that, given a real number xx, the value of the function y(x)y(x) could be complex. Equation (13.30) represents the most general form: it represents all solutions.

The coefficients in ODE (13.18) are assumed to be real and therefore, we are looking for solutions described by real-valued functions. This means that we want to 'filter out' all functions containing coefficients with an imaginary part, keeping only those whose coefficients are real numbers.

We choose to write down the general solution in the following form*

y(x)=c1eaxcos(bx)+c2eaxsin(bx),y(x)=c_{1} e^{a x} \cos (b x)+c_{2} e^{a x} \sin (b x),

The two real-valued solutions that we seek therefore are given by

eaxcos(bx) and eaxsin(bx).e^{a x} \cos (b x) \text { and } e^{a x} \sin (b x) .

Their Wronskian determinant is W(x)=be2axW(x)=b e^{2 a x} which is never zero; therefore, the two functions are linearly independent and they constitute a fundamental set of solutions which leads to the general solution given by Eq. (13.31).

If the roots of the characteristic equation (13.20), are complex and distinct i.e. m1=a+ibm_{1}=a+i b and m2=aibm_{2}=a-i b, then the general solution to (13.18), is given by

y(x)=eax[c1cos(bx)+c2sin(bx)]y(x)=e^{a x}\left[c_{1} \cos (b x)+c_{2} \sin (b x)\right]
  • Here we give reasoning behind the choice of Eq. (13.31) [equivalently, Eq. (13.32)], as the general solution for Case 2. Once we write out the general solution using Euler's formula, we have the following form of the general solution to the ODE [this is (13.30) rearranged]
y(x)=(k1+k2)eaxcos(bx)+i(k1k2)eaxsin(bx);y(x)=\left(k_{1}+k_{2}\right) e^{a x} \cos (b x)+i\left(k_{1}-k_{2}\right) e^{a x} \sin (b x) ;

the coefficients k1k_{1} and k2k_{2} are arbitrarily chosen and are also complex. For a second order ODE, we have to satisfy 2 (independent) initial conditions which ultimately dictate what the values of k1k_{1} and k2k_{2} are. However, in its most general form, Eq. (13.33) has 4 unknown constants. This can be seen by expanding Eq. (13.33), using k1=a1+b1ik_{1}=a_{1}+b_{1} i and k2=a2+b2ik_{2}=a_{2}+b_{2} i (where a1,b1,a2a_{1}, b_{1}, a_{2} and b2b_{2} are real and unknown). Doing so gives some terms that are real and some terms that are imaginary. In order for Eq. (13.33) to represent a real-valued function, the constants k1k_{1} and k2k_{2} can no longer be arbitrarily chosen; instead, they must be conjugate numbers such that k1+k2k_{1}+k_{2} and i(k1k2)i\left(k_{1}-k_{2}\right) are real constants. This leaves us with y1=eaxcos(bx)y_{1}=e^{a x} \cos (b x) and y2=eaxsin(bx)y_{2}=e^{a x} \sin (b x) as two real, linearly independent solutions. Their sum using real arbitrary coefficients c1c_{1} and c2c_{2} is the real solution we seek [this is given by Eq. (13.31)]. Finally note that the constant c1c_{1} is k1+k2k_{1}+k_{2} and c2c_{2} is i(k1k2)i\left(k_{1}-k_{2}\right) where k1k_{1} and k2k_{2} are conjugate numbers.

Example 13.3 Find the general solution to the following ODE:

y+2y+17y=0y^{\prime \prime}+2 y^{\prime}+17 y=0

Solution Again, the ODE is homogeneous with constant coefficients so we proceed to solving the corresponding characteristic equation,

m2+2m+17=0m^{2}+2 m+17=0

which gives the complex conjugate roots m1=1+4im_{1}=-1+4 i and m2=14im_{2}=-1-4 i. Comparing to the general solution (13.32), a=1a=-1 (real part) and b=4b=4 (imaginary part) leading to the following solution

y(x)=ex(c1cos4x+c2sin4x),y(x)=e^{-x}\left(c_{1} \cos 4 x+c_{2} \sin 4 x\right),

where c1,c2c_{1}, c_{2} are arbitrary constants which can be solved for using initial conditions.

Case 3: Repeated root

If p24q=0p^{2}-4 q=0, then from Eq. (13.21), we obtain one (real) root, mm which is equal to p/2-p / 2. Again, using the ansatz, y=emxy=e^{m x} and m=p/2m=-p / 2, we now have one solution given as,

y1(x)=epx/2.y_{1}(x)=e^{-p x / 2} .

We now have a problem because unlike Case 1\mathbf{1} and Case 2, where the solution to the characteristic equation gave us two distinct solutions, here, the characteristic equation only gives one. We therefore do not have enough information to construct the general solution to ODE (13.18) for Case 3. In order to be able to write down the general solution for this case, we need to come up with a second solution (which is, of course, linearly independent to the first one).

Using a known solution to find another

We use the known solution, y1y_{1} given by Eq. (13.37) to find the second solution. We are looking for y2y_{2}, a linearly independent function to y1y_{1} which satisfies the ODE (13.18). We assume that the second solution takes the following form

y2(x)=v(x)y1(x)y_{2}(x)=v(x) y_{1}(x)

where v(x)v(x) is an unknown nonconstant function of xx, and y1y_{1} is the solution we already have (from the characteristic equation). The motivation behind this is that if two functions are linearly independent, then, as previously stated in Subsec. 13.1.2, they should not be constant multiples of each other:

y2(x)y1(x)=v(x)y1(x)y1(x)=v(x)\frac{y_{2}(x)}{y_{1}(x)}=\frac{v(x) y_{1}(x)}{y_{1}(x)}=v(x)

The fact that y1y_{1} and y2y_{2} are not constant multiples of each other is an encouraging first step in determining the second fundamental solution. The objective here is to determine v(x)v(x). If we have v(x)v(x) then, by using Eq. (13.38), we have y2(x)y_{2}(x).

Determine the unknown function, v(x)v(x)

  • If y2y_{2} is a solution to the ODE (13.18) then it must satisfy Eq. (13.18). Our next step therefore is to take Eq. (13.38) and differentiate wrt xx (to obtain y2y_{2}^{\prime} and y2y_{2}^{\prime \prime} ) and substitute back in the original ODE,
y2=y1v+vy1y2=y1v+2vy1+vy1\begin{aligned} & y_{2}^{\prime}=y_{1}^{\prime} v+v^{\prime} y_{1} \\ & y_{2}^{\prime \prime}=y_{1}^{\prime \prime} v+2 v^{\prime} y_{1}^{\prime}+v^{\prime \prime} y_{1} \end{aligned}
  • Take Eqs. (13.38), (13.40), (13.41) and substitute in (13.18),
y2+py2+qy2=0y1v+2vy1+vy1+p(y1v+vy1)+qvy1=0\begin{aligned} y_{2}^{\prime \prime}+p y_{2}^{\prime}+q y_{2} & =0 \\ y_{1}^{\prime \prime} v+2 v^{\prime} y_{1}^{\prime}+v^{\prime \prime} y_{1}+p\left(y_{1}^{\prime} v+v^{\prime} y_{1}\right)+q v y_{1} & =0 \end{aligned}
  • Factorise v,vv, v^{\prime} and vv^{\prime \prime} in Eq. (13.42),
v(y1+py1+qy1)+v(2y1+py1)+vy1=0.v\left(y_{1}^{\prime \prime}+p y_{1}^{\prime}+q y_{1}\right)+v^{\prime}\left(2 y_{1}^{\prime}+p y_{1}\right)+v^{\prime \prime} y_{1}=0 .

Now, Eq. (13.43) is made up of three terms which (from left to right) are: the coefficients of vv (blue terms), of vv^{\prime} (green terms) and of vv^{\prime \prime} (red term).

  • Let us start with the coefficients of vv,

If y1y_{1} satisfies the ODE (13.18), then,

y1+py1+qy1=0;y_{1}^{\prime \prime}+p y_{1}^{\prime}+q y_{1}=0 ;

which means that the coefficient of vv is 0 and hence the first term on the LHS of (13.43) disappear,

vy1+py1+qy1)+v(2y1+py1)+vy1=0.v \underline{\left.y_{1}^{\prime \prime}+p y_{1}^{\prime}+q y_{1}\right)}+v^{\prime}\left(2 y_{1}^{\prime}+p y_{1}\right)+v^{\prime \prime} y_{1}=0 .
  • Moving on to the coefficient of vv^{\prime}. This is given by
2y1+py1=2(p2epx/2)+pepx/2=02 y_{1}^{\prime}+p y_{1}=2\left(-\frac{p}{2} e^{-p x / 2}\right)+p e^{-p x / 2}=0

so, the coefficient of vv^{\prime} also disappears,

v(2y1+py1)+vy1=0.v^{\prime}\left(2 y_{1}^{\prime}+p y_{1}\right)+v^{\prime \prime} y_{1}=0 .
  • We are left with vy1=0v^{\prime \prime} y_{1}=0 and, since y1=epx/20y_{1}=e^{-p x / 2} \neq 0 then, what we are really left with is v=0v^{\prime \prime}=0. This is a second order ODE for v(x)v(x) which can be easily solved by integrating twice wrt xx,
v(x)=k1x+k2,v(x)=k_{1} x+k_{2},

for any nonzero k1k_{1} and any k2k_{2}. Note that the constants k1k_{1} and k2k_{2} can be arbitrarily chosen to construct the general solution since we ultimately solve for the constants appearing in the solution through application of initial conditions. As long as we have k10k_{1} \neq 0 then, v(x)v(x) will be a nonconstant function of xx which, in turn, guarantees that y1y_{1} and y2y_{2} are linearly independent.

  • The simplest form v(x)v(x) can take therefore is v(x)=xv(x)=x where we chose k1=1k_{1}=1 and k2=0.k_{2}=\overline{0 .} This implies that the second solution is given by,
y2(x)=xy1(x)y_{2}(x)=x y_{1}(x)

Note that for constant coefficient, homogeneous ODEs whose characteristic equation gives a single, repeated root the pair of fundamental solutions is always given by

y1(x)=epx/2 and y2=xepx/2,y_{1}(x)=e^{-p x / 2} \text { and } y_{2}=x e^{-p x / 2},

where pp is the coefficient of yy^{\prime} when the ODE is written in standard form.

If the characteristic equation (13.20) gives a repeated, real root i.e. m=p/2m=-p / 2, then the general solution to (13.18), is given by

y(x)=c1epx/2+c2xepx/2.y(x)=c_{1} e^{-p x / 2}+c_{2} x e^{-p x / 2} .

Example 13.4 Find the particular solution to the following ODE:

y6y+9y=0y(0)=0,y(0)=5.y^{\prime \prime}-6 y^{\prime}+9 y=0 \quad y(0)=0, y^{\prime}(0)=5 .

Solution In this case, initial conditions are provided at x=0x=0, which allow us to solve for a particular solution to the IVP. We start off with the characteristic equation

m26m+9=0m^{2}-6 m+9=0

which gives the a repeated root as m=3m=3 yielding the first solution as y1=e3xy_{1}=e^{3 x}. A linearly independent solution is y2=v(x)=y1y_{2}=v(x)=y_{1} where v(x)=xv(x)=x. Using Eq. (13.49), the general solution is

y(x)=c1e3x+c2xe3x.y(x)=c_{1} e^{3 x}+c_{2} x e^{3 x} .

Applying the initial condition, y(0)=0y(0)=0 yields c1=0c_{1}=0 and y(0)=5y^{\prime}(0)=5 yields c2=5c_{2}=5. Thus, the particular solution is:

y(x)=5xe3x.y(x)=5 x e^{3 x} .

Note that while the general solution is made up of all linearly independent derivatives, the particular solution satisfying the aforementioned initial conditions is only described by y2y_{2}.

Summary

Given a second order linear, homogeneous equation with constant coefficients,

y+py+qy=0y^{\prime \prime}+p y^{\prime}+q y=0

solve its characteristic equation,

m2+pm+q=0m^{2}+p m+q=0

The general solution to (13.54), depends on the type of roots obtained in (13.55).

  1. When p24q>0p^{2}-4 q>0, the roots m1m_{1} and m2m_{2} are real + distinct and the general solution is,
yh(x)=c1em1x+c2em2x.y_{h}(x)=c_{1} e^{m_{1} x}+c_{2} e^{m_{2} x} .
  1. When p24q<0p^{2}-4 q<0, the roots are complex + distinct and they take the form m=a±ibm=a \pm i b. The general solution is,
yh(x)=eax[c1cos(bx)+c2sin(bx)].y_{h}(x)=e^{a x}\left[c_{1} \cos (b x)+c_{2} \sin (b x)\right] .
  1. When p24q=0p^{2}-4 q=0, there is only one real root given by m=p/2m=-p / 2. The general solution is,
yh(x)=c1epx/2+c2xepx/2.y_{h}(x)=c_{1} e^{-p x / 2}+c_{2} x e^{-p x / 2} .

Note the subscript hh in the general solutions in Eqs. (13.56)-(13.58). This denotes that the functions, yhy_{h} are solutions to the homogeneous ODE (i.e. when f(x)=0f(x)=0 ). The homogeneous solution yhy_{h} is also known as the complementary function.

Notes

  • You do not need to set the ODE in standard form when solving it using the characteristic equation method. If we start off using the following ODE (not in standard form):
αy+βy+γy=0,\alpha y^{\prime \prime}+\beta y^{\prime}+\gamma y=0,

then the characteristic equation becomes,

αm2+βm+γ=0\alpha m^{2}+\beta m+\gamma=0
  • In Eq. (13.58), the root given as m=p/2m=-p / 2 is a result of having the ODE in standard form. For the more general form given by Eq. (13.59) and the associated characteristic equation (13.60), the characteristic equation solution is given by,
m=β±β24αγ2α.m=\frac{-\beta \pm \sqrt{\beta^{2}-4 \alpha \gamma}}{2 \alpha} .

If β24αγ=0\beta^{2}-4 \alpha \gamma=0 then the only root is m=β2αm=\frac{-\beta}{2 \alpha}.