Differential Equation Exercise 22
We are tasked with solving the following differential equation:
$$ y'' + 3y = x + 2 \cos(x) $$
This is a second-order linear nonhomogeneous differential equation.
The right-hand side consists of the sum of two distinct types of terms: a polynomial \( x \) and a trigonometric function \( \cos(x) \).
We will solve the equation using the method of undetermined coefficients together with the principle of superposition.
The procedure is divided into three main steps.
1] Solving the homogeneous equation
The corresponding homogeneous equation is:
$$ y'' + 3y = 0 $$
Its associated characteristic equation is:
$$ z^2 + 3 = 0 $$
This yields complex conjugate roots:
$$ z = \pm i\sqrt{3} $$
These can be written as \( z = \alpha \pm i\beta \), where \( \alpha = 0 \) and \( \beta = \sqrt{3} \).
Therefore, the general solution to the homogeneous equation is:
$$ y_o = c_1 \cos(\sqrt{3}x) + c_2 \sin(\sqrt{3}x) $$
2] Finding a particular solution
The nonhomogeneous term is the sum of two functions:
$$ y'' + 3y = x + 2 \cos(x) $$
By the principle of superposition, the particular solution is the sum of two independent particular solutions:
$$ y'' + 3y = x $$
$$ y'' + 3y = 2 \cos(x) $$
2.1] Particular solution for the polynomial term
For the equation:
$$ y'' + 3y = x $$
Since the right-hand side is a first-degree polynomial and the coefficient of \( y \) is nonzero, the appropriate trial solution is:
$$ y_{p1} = A + Bx $$
Its derivatives are:
$$ y'_{p1} = B, \quad y''_{p1} = 0 $$
Substituting into the equation:
$$ 0 + 3(A + Bx) = x $$
Which leads to:
$$ 3A + 3Bx = x $$
Equating coefficients:
$$ \begin{cases} 3A = 0 \\ 3B = 1 \end{cases} \Rightarrow \begin{cases} A = 0 \\ B = \frac{1}{3} \end{cases} $$
So the particular solution is:
$$ y_{p1} = \frac{x}{3} $$
2.2] Particular solution for the trigonometric term
Next, consider the equation:
$$ y'' + 3y = 2 \cos(x) $$
We use the trial function:
$$ y_{p2} = A \cos(x) + B \sin(x) $$
We first verify that \( \cos(x) \) is not a solution of the homogeneous equation. The characteristic equation has no real roots, and in particular, \( z = 1 \) is not a root:
$$ z^2 + 3 = 1 + 3 = 4 \ne 0 $$
So the trial function is valid.
Computing derivatives:
$$ y'_{p2} = -A \sin(x) + B \cos(x) $$
$$ y''_{p2} = -A \cos(x) - B \sin(x) $$
Substituting into the equation:
$$ (-A \cos(x) - B \sin(x)) + 3(A \cos(x) + B \sin(x)) = 2 \cos(x) $$
Which simplifies to:
$$ 2A \cos(x) + 2B \sin(x) = 2 \cos(x) $$
Matching coefficients:
$$ \begin{cases} 2A = 2 \\ 2B = 0 \end{cases} \Rightarrow \begin{cases} A = 1 \\ B = 0 \end{cases} $$
Thus, the second particular solution is:
$$ y_{p2} = \cos(x) $$
2.3] Complete particular solution
Combining the two particular solutions:
$$ y_p = y_{p1} + y_{p2} = \frac{x}{3} + \cos(x) $$
This is the particular solution to the original equation.
3] General solution
The general solution is given by the sum of the homogeneous and particular parts:
$$ y = y_o + y_p $$
Substituting:
$$ y = c_1 \cos(\sqrt{3}x) + c_2 \sin(\sqrt{3}x) + \frac{x}{3} + \cos(x) $$
This is the general solution to the differential equation.
