Second-Order Nonhomogeneous Linear Differential Equations
A second-order nonhomogeneous linear differential equation with constant coefficients is written as $$ ay'' + by' + cy = r(x) $$ where \( a \), \( b \), and \( c \) are real constants.
This is referred to as the complete form of the differential equation.
One common approach to solving it is the method of variation of parameters.
- Start by finding the general solution of the associated homogeneous equation: $$ y_A = c_1 y_1 + c_2 y_2 \qquad \text{where } ay'' + by' + cy = 0 $$
- Next, determine a particular solution of the nonhomogeneous equation in the form \( y_P = c_1(x) y_1 + c_2(x) y_2 \), by solving the following system: $$ \begin{cases} c'_1(x) y_1 + c'_2(x) y_2 = 0 \\ \\ c'_1(x) y'_1 + c'_2(x) y'_2 = r(x) \end{cases} $$
Note. There are alternative techniques for finding a particular integral, such as the method of undetermined coefficients.
- The general solution to the original equation is then the sum: $$ y = y_A + y_P $$
A Worked Example
Let’s solve the following second-order nonhomogeneous differential equation:
$$ y'' - 2y' + y = \frac{e^x}{x^4} $$
The associated homogeneous equation is:
$$ y'' - 2y' + y = 0 $$
We solve its characteristic equation by introducing an auxiliary variable \( t \) and using the coefficients \( a = 1 \), \( b = -2 \), \( c = 1 \):
$$ at^2 + bt + c = 0 $$
$$ t^2 - 2t + 1 = 0 $$
This quadratic equation yields:
$$ t = \frac{2 \pm \sqrt{4 - 4(1)(1)}}{2} $$
$$ t = \frac{2 \pm 0}{2} $$
$$ t = \begin{cases} t_1 = 1 \\ \\ t_2 = 1 \end{cases} $$
Since the roots are repeated, the general solution to the homogeneous equation is:
$$ y_A = c_1 e^x + c_2 x e^x $$
We now look for a particular solution in the form:
$$ y_P = c_1(x) e^x + c_2(x) x e^x $$
Here, \( c_1(x) \) and \( c_2(x) \) are functions of \( x \). This is why the method is called variation of parameters.
To determine these functions, we solve the system:
$$ \begin{cases} c'_1(x) e^x + c'_2(x) x e^x = 0 \\ \\ c'_1(x) D[e^x] + c'_2(x) D[xe^x] = \frac{e^x}{x^4} \end{cases} $$
Important. The system involves the derivatives \( c'_1(x) \) and \( c'_2(x) \), not the functions themselves.
Computing the derivatives gives:
$$ \begin{cases} c'_1(x) e^x + c'_2(x) x e^x = 0 \\ \\ c'_1(x) e^x + c'_2(x) (x e^x + e^x) = \frac{e^x}{x^4} \end{cases} $$
Using substitution, we isolate \( c'_1(x) \) from the first equation:
$$ \begin{cases} c'_1(x) = \frac{-c'_2(x) x e^x}{e^x} \\ \\ c'_1(x) e^x + c'_2(x)(x e^x + e^x) = \frac{e^x}{x^4} \end{cases} $$
$$ \begin{cases} c'_1(x) = -c'_2(x) x \\ \\ c'_1(x) e^x + c'_2(x)(x e^x + e^x) = \frac{e^x}{x^4} \end{cases} $$
Substituting into the second equation:
$$ \begin{cases} c'_1(x) = -c'_2(x) x \\ \\ (-c'_2(x) x)e^x + c'_2(x)(x e^x + e^x) = \frac{e^x}{x^4} \end{cases} $$
$$ \begin{cases} c'_1(x) = -c'_2(x) x \\ \\ -c'_2(x) x e^x + c'_2(x) x e^x + c'_2(x) e^x = \frac{e^x}{x^4} \end{cases} $$
$$ \begin{cases} c'_1(x) = -c'_2(x) x \\ \\ c'_2(x) e^x = \frac{e^x}{x^4} \end{cases} $$
$$ \begin{cases} c'_1(x) = -c'_2(x) x \\ \\ c'_2(x) = \frac{1}{x^4} \end{cases} $$
Now substitute \( c'_2(x) = 1/x^4 \) into the first equation:
$$ \begin{cases} c'_1(x) = -\left( \frac{1}{x^4} \right) x \\ \\ c'_2(x) = \frac{1}{x^4} \end{cases} $$
$$ \begin{cases} c'_1(x) = -\frac{1}{x^3} \\ \\ c'_2(x) = \frac{1}{x^4} \end{cases} $$
Now we integrate to find \( c_1(x) \) and \( c_2(x) \):
$$ \begin{cases} c_1(x) = \int -\frac{1}{x^3} \ dx \\ \\ c_2(x) = \int \frac{1}{x^4} \ dx \end{cases} $$
$$ \begin{cases} c_1(x) = \frac{x^{-2}}{2} \\ \\ c_2(x) = \frac{x^{-3}}{-3} \end{cases} $$
Substitute these into the expression for \( y_P \):
$$ y_P = c_1(x) e^x + c_2(x) x e^x $$
$$ y_P = \frac{x^{-2}}{2} e^x + \left( \frac{-x^{-3}}{3} \right) x e^x $$
$$ y_P = \frac{x^{-2}}{2} e^x - \frac{x^{-2}}{3} e^x $$
$$ y_P = \left( \frac{x^{-2}}{2} - \frac{x^{-2}}{3} \right) e^x $$
$$ y_P = \left( \frac{3x^{-2} - 2x^{-2}}{6} \right) e^x $$
$$ y_P = \frac{x^{-2}}{6} e^x $$
$$ y_P = \frac{e^x}{6x^2} $$
Finally, combine the homogeneous and particular solutions:
$$ y = y_A + y_P $$
$$ y = [ c_1 e^x + c_2 x e^x ] + y_P $$
$$ y = c_1 e^x + c_2 x e^x + \frac{e^x}{6x^2} $$
And that completes the solution.
