Example 4.15. Find the particular solution of the equation

$$
y^{\prime \prime}=\sin x-1,
$$

satisfying the given initial conditions $y(0)=-1$, $y^{\prime}(0)=1$.
Solution. We have $\frac{d y}{d x}=z$, hence

$$
\begin{gathered}
\frac{d z}{d x}=\sin x-1, d z=(\sin x-1) d x \\
z=-\cos x-x+C_{1}
\end{gathered}
$$

Therefore,

$$
y^{\prime}=-\cos x-x+C_{1} .
$$

Using the initial condition $y^{\prime}(0)=1$, we get

$$
1=-\cos 0+C_{1},
$$

from which $C_{1}=2$. Thus,

$$
\frac{d y}{d x}=-\cos x-x+2
$$

or

$$
d y=(-\cos x-x+2) d x
$$

Integrating this equation:

$$
y=-\sin x-\frac{x^{2}}{2}+2 x+C_{2} .
$$

Using the initial condition $y(0)=-1$, we find $C_{2}=-1$. Therefore, the required particular solution is:

$$
y=-\sin x-\frac{x^{2}}{2}+2 x-1
$$

## 4.7. Linear Homogeneous Second-Order Differential Equations with Constant Coefficients

A linear homogeneous second-order differential equation with constant coefficients is an equation of the form

$$
y^{\prime \prime}+p y^{\prime}+q y=0 \text {. }
$$

To find the general solution of equation (1), the characteristic equation is formed:

$$
r^{2}+p r+q=0
$$

which is obtained from equation (1) by replacing the derivatives of the unknown function with the corresponding powers of $r$, and the function itself with one.

The general solution of equation (1) is then constructed depending on the nature of the roots $r_{1}$ and $r_{2}$ of equation (2). There are three possible cases.

1st case. The roots $r_{1}$ and $r_{2}$ are real and distinct. Then the general solution of equation (1) is:

$$
y=C_{1} e^{r_{1} x}+C_{1} e^{r_{2} x} .
$$

2nd case. The roots $r_{1}$ and $r_{2}$ are real and equal: $r_{1}=r_{2}=r$. In this case, the general solution of equation (1) is:

$$
y=\left(C_{1}+C_{2} x\right) e^{r x} .
$$

3rd case. The roots $r_{1}$ and $r_{2}$ are complex conjugates: $r_{1}=\alpha+\beta i, r_{2}=\alpha-\beta i$. Then the general solution is constructed as follows:

$$
y=e^{a x}\left(C_{1} \cos \beta x+C_{2} \sin \beta x\right) .
$$