How do we find the solution of a higher-order nonhomogeneous linear differential equation with constant coefficients?
By using the amazing process called Undetermined Coefficients.
Solutions by the method of Undetermined Coefficients sometimes called the Superposition Approach, is where we make a “guess” as to the appropriate form for our solution set, which is then tested by differentiating the resulting equation.
The trick to mastering this technique is to know how to make an appropriate “guess.”
Understanding the General Solution and Its Components
So, let’s dig a bit deeper and see what undetermined coefficients are all about.
- The general solution of the differential equation \(a_{n} y^{(n)}+a_{n-1} y^{(n-1)}+\cdots+a_{1} y^{\prime}+a_{0} y=Q(x)\) when \(a_{n} \neq 0\) and \(Q(x) \neq 0\) in an interval I, is \(y=y_{h}(x)+y_{p}(x)\)
- \(y_{h}\) is the homogeneous solution, sometimes called the complementary function
- \(y_{p}\) is the particular solution
Formulating the Homogeneous Solution and Making an Educated Guess for the Particular Solution
Alright, so here’s what you need to know.
First, we will find the homogeneous solution using the methods we learned in our previous videos to solve second and higher-order DEs (i.e., distinct real roots, complex roots, and repeated roots).
Next, we employ the method of undetermined coefficients to form the particular solution…this is where we must make our educated guess.
How? By choosing something that has the same form as \(Q(x)\)
\begin{equation}
\begin{array}{l|l}
\text { If } Q(x) \text { is… } & \text { Then guess } y_p \text { is… } \\
\hline \text { Exponential: } y e^{r x} & A e^{r x} \\
\hline \text { Polynomial: } a x^n+b x^{n-1}+\cdots+c x+d & A x^n+B x^{n-1}+\cdots+C x+D \\
\hline \text { Trigonometric: } k \sin (\beta x) \text { or } k \cos (\beta x) & A \sin (\beta x)+B \cos (\beta x)
\end{array}
\end{equation}
In other words, we want our guess to look as much like \(Q(x)\) as possible, and we use differentiation and the comparison method we learned with partial fractions to solve for specific coefficients. Confused?
Don’t worry. A few examples, along with the video, will help to illustrate this process.
Example 1: Solving a Nonhomogeneous DE with Exponential Function
Solve \(y^{\prime \prime}+3 y^{\prime}+2 y=12 e^{x}\)
Setting Up & Solving the Characteristic Equation
Okay, so first, we will solve for the homogeneous solution by creating the characteristic equation.
If we let \(y^{\prime \prime}+3 y^{\prime}+2 y=0\), then \(r^{2}+3 r+2=0\)
Next, we solve the characteristic equation for our roots.
\begin{align*}
\begin{aligned}
& r^{2}+3 r+2=0 \\
& (r+2)(r+1)=0 \\
& r_{1}=-2, \quad r_{2}=-1
\end{aligned}
\end{align*}
Because we found two distinct, real roots, we can write our complementary function as follows:
\begin{align*}
\begin{aligned}
& y_{h}=c_{1} e^{r_{1} x}+c_{2} e^{r_{2} x} \\
& y_{h}=c_{1} e^{-2 x}+c_{2} e^{-x}
\end{aligned}
\end{align*}
Formulating a Guess for the Particular Solution
Now it’s time to focus on \(Q(x)\) and formulate a guess for our particular solution.
Because \(Q(x)=12 e^{x}\) is an exponential function, let’s guess that \(y_{p}=A e^{x}\)
Now all we have to do is take the appropriate number of derivatives that match our DE, which is a second-order differential equation.
\begin{align*}
\begin{aligned}
& y_{p}=A e^{x} \\
& \left(y_{p}\right)^{\prime}=A e^{x} \\
& \left(y_{p}\right)^{\prime \prime}=A e^{x}
\end{aligned}
\end{align*}
Solving for the Coefficient in the Particular Solution
Next, we will substitute these derivatives into our differential equation and solve for the missing coefficient, A.
\begin{align*}
\begin{aligned}
& y^{\prime \prime}+3 y^{\prime}+2 y=12 e^{x} \\
& \left(A e^{x}\right)+3\left(A e^{x}\right)+2\left(A e^{x}\right)=12 e^{x} \\
& 6 A e^{x}=12 e^{x} \\
& 6 A=12 \\
& A=2
\end{aligned}
\end{align*}
This means that our particular solution is \(y_{p}=2 e^{x}\)
Combining Homogeneous and Particular Solutions
Finally, we are ready to write our final solution by combining our complementary (homogeneous) function with our particular solution.
\begin{align*}
\begin{aligned}
& y=y_{h}+y_{p} \\
& y=\underbrace{\left(c_{1} e^{-2 x}+c_{2} e^{-x}\right)}_{y_{h}}+\underbrace{\left(2 e^{x}\right)}_{y_{p}} \\
& y=c_{1} e^{-2 x}+c_{2} e^{-x}+2 e^{x}
\end{aligned}
\end{align*}
And that’s it. Not bad, right?
Important Considerations When Making a Guess
But I do need to warn you about something…
To find \(y_{p}\) by the method of undetermined coefficients, it is important to compare the terms of your “guess” with \(y_{h}\).
Why?
Because no term of \(Q(x)\) can be the same as a term of \(y_{h}\). Therefore, if our guess matches a term in our homogeneous solution, we must multiply by \(x\) to offset the difference.
Example 2: Solving a Nonhomogeneous DE with Polynomial and Exponential Functions
Let’s take a look.
Solve \(y^{\prime \prime}+4 y^{\prime}+4 y=3 x e^{-2 x}\)
Setting Up & Solving the Characteristic Equation
First, we will solve for the homogeneous solution by creating the characteristic equation.
If we let
\begin{equation}
y^{\prime \prime}+4 y^{\prime}+4 y=0, \text { then } r^2+4 r+4=0
\end{equation}
Next, we solve the characteristic equation for our roots.
\begin{align*}
\begin{aligned}
& r^{2}+4 r+4=0 \\
& (r+2)(r+2)=0 \\
& r=-2(\text { twice })
\end{aligned}
\end{align*}
Finding the Homogeneous Solution
Because we found two repeating real roots, we can write our complementary function as follows:
\begin{equation}
\begin{aligned}
& y_h=c_1 e^{r x}+c_2 x e^{r x} \\
& y_h=c_1 e^{-2 x}+c_2 x e^{-2 x}
\end{aligned}
\end{equation}
Creating an Appropriate Guess for the Particular Solution
Now it’s time to focus on \(Q(x)\) and formulate a guess for our particular solution.
Because \(Q(x)=3 x e^{-2 x}\) is a combination of a polynomial and exponential function, let’s guess that.
\begin{equation}
y_p=\underbrace{(A x+B)}_{\text {polynomial }} \underbrace{e^{-2 x}}_{\text {exponential }}=A x e^{-2 x}+B e^{-2 x}
\end{equation}
Adjusting the Guess to Avoid Overlap with the Homogeneous Solution
But there’s a problem! Notice that one of the terms in our homogeneous solution is exactly the same as our guess – and that’s not allowed.
\begin{align*}
y_{h}=\underline{c_{1} e^{-2 x}}+\underline{\underline{c_{2} x e^{-2 x}}} \quad y_{p}=\underline{\underline{A x e^{-2 x}}}+\underline{B e^{-2 x}}
\end{align*}
This means we need to tweak our guess so they are different… we do so by multiplying each term of our particular solution by \(\mathrm{x}\) until there are no more matches.
If we multiply our guess by \(\mathrm{x}\), we get
\begin{equation}
y_p=x\left(A x e^{-2 x}+B e^{-2 x}\right)=A x^2 e^{-2 x}+B x e^{-2 x}
\end{equation}
But we still have a match.
\begin{align*}
y_{h}=c_{1} e^{-2 x}+\underline{c_{2} x e^{-2 x}} \quad y_{p}=A x^{2} e^{-2 x}+\underline{B x e^{-2 x}}
\end{align*}
So, we multiply our particular solution by \(\mathrm{x}\) again, and get
\begin{equation}
y_p=x\left(A x^2 e^{-2 x}+B x e^{-2 x}\right)=A x^3 e^{-2 x}+B x^2 e^{-2 x}
\end{equation}
Determining the Particular Solution
Finally, we don’t have any terms that match our complementary function, so now our guess is set and ready to find our derivatives that match our DE.
\begin{align*}
\begin{aligned}
& y_{p}=A x^{3} e^{-2 x}+B x^{2} e^{-2 x} \\
& \left(y_{p}\right)^{\prime}=-2 A x^{3} e^{-2 x}+3 A x^{2} e^{-2 x}-2 B x^{2} e^{-2 x}+2 B x e^{-2 x} \\
& \left(y_{p}\right)^{\prime \prime}=4 A x^{3} e^{-2 x}-12 A x^{2} e^{-2 x}+6 A x e^{-2 x}+4 B x^{2} e^{-2 x}-8 B x e^{-2 x}+2 B e^{-2 x}
\end{aligned}
\end{align*}
Next, we will substitute these derivatives into our differential equation and solve for the missing coefficients, A and B, using the comparison method like we did when evaluating Partial Fractions.
\begin{align*}
y^{\prime \prime}+4 y^{\prime}+4 y=3 x e^{-2 x}
\end{align*}
\begin{align*}
\begin{aligned}
& \left(4 A x^{3} e^{-2 x}-12 A x^{2} e^{-2 x}+6 A x e^{-2 x}+4 B x^{2} e^{-2 x}-8 B x e^{-2 x}+2 B e^{-2 x}\right)+ \\
& \quad 4\left(-2 A x^{3} e^{-2 x}+3 A x^{2} e^{-2 x}-2 B x^{2} e^{-2 x}+2 B x e^{-2 x}\right)+4\left(x^{3} e^{-2 x}+B x^{2} e^{-2 x}\right)=3 x e^{-2 x}
\end{aligned}
\end{align*}
\begin{equation}
6 A x e^{-2 x}+2 B e^{-2 x}=3 x e^{-2 x}
\end{equation}
\begin{equation}
\underline{6 A x e^{-2 x}}+\underline{\underline{2 B e^{-2 x}}}=\underline{3 x e^{-2 x}}+\underline{\underline{0 e^{-2 x}}}
\end{equation}
\begin{equation}
\text { So, } A=\frac{1}{2} \text { and } B=0 \text {. }
\end{equation}
This means that our particular solution is
\begin{equation}
y_p=\left(\frac{1}{2}\right) x^3 e^{-2 x}+(0) x^2 e^{-2 x}=\frac{1}{2} x^3 e^{-2 x}
\end{equation}
Writing the General Solution
Lastly, we are ready to write our final solution by combining our complementary (homogeneous) function with our particular solution.
\begin{align*}
\begin{aligned}
& y=y_{h}+y_{p} \\
& y=\underbrace{\left(c_{1} e^{-2 x}+c_{2} x e^{-2 x}\right)}_{y_{h}}+\underbrace{\left(\frac{1}{2} x^{3} e^{-2 x}\right)}_{y_{p}} \\
& y=c_{1} e^{-2 x}+c_{2} x e^{-2 x}+\frac{1}{2} x^{3} e^{-2 x}
\end{aligned}
\end{align*}
Conclusion and Recap
Don’t fear. Together we will work through the process in detail so you will quickly get the swing of things.
So, we will begin our lesson with an understanding that to solve a nonhomogeneous, or inhomogeneous, linear differential equation, we must do two things:
- Find the complimentary function to the Homogeneous Solution, using the techniques from our previous lessons.
- Find any Particular Solution for the nonhomogeneous equation.
We will use the method of undetermined coefficients, where a “guess” is made as to the appropriate form, which is then tested by differentiating the resulting equation. And we will practice using multiple examples to make a reasonable guess so the process becomes more second nature.
Then we will use our new skills and write the general solution for nonhomogeneous DEs.
Let’s jump right in!
Video Tutorial w/ Full Lesson & Detailed Examples
Get access to all the courses and over 450 HD videos with your subscription
Monthly and Yearly Plans Available
Still wondering if CalcWorkshop is right for you?
Take a Tour and find out how a membership can take the struggle out of learning math.