Another option is to explicitly construct the general solution to the differential equation
$$y''+Ay'+By=0,$$
where $y=y(x)$.
This can be done by transforming it to a first order linear differential equation, for which we know how to find the general solution.
If $B=0$ we can simply integrate both sides to get a first order differential equation (with general solution $y=c_1+c_2e^{-Ax}$), so we may henceforth assume that $B \neq 0$.
Now let $z=z(x)$. A change of variables $y=ze^{rx}$ (for any constant $r\neq0$) makes $y'=(z'+rz)e^{rx}$ and $y''=(z''+2rz'+r^2z)e^{rx}$. Insertion into the original equation yields
$$
y''+Ay'+By
= (z''+2rz'+r^2z)e^{rx}+A(z'+rz)e^{rx}+Bze^{rx}
= e^{rx}(z''+(2r+A)z'+(r^2+Ar+B)z)=0 \Longleftrightarrow \\
z''+(2r+A)z'+(r^2+Ar+B)z=0.
$$
Now we choose $r$ such that $r^2+Ar+B=0$. Here we must consider two cases:
- The equation $r^2+Ar+B=0$ has a double root $r$. In this case $z''=0 \Rightarrow z=c_1x+c_2$, so $y=ze^{rx}=(c_1x+c_2)e^{rx}$.
- The equation $r^2+Ar+B=0$ has distinct roots $r_1$ and $r_2$ (assume we use $r=r_1$). In this case
$$
z''+(2r_1+A)z' = z''+(r_1-r_2)z'=0 \Longrightarrow z'+(r_1-r_2)z=M,
$$
which has the general solution $z=\frac{M}{r_1-r2}+c_2e^{(r_2-r_1)x}=c_1+c_2e^{(r_2-r_1)x}$. This means that $y=c_1e^{r_1x}+c_2e^{r_2x}$.
We have now exhausted the possibilities, and in each case the general solution is of the form
$y=c_1y_1+c_2y_2$, as desired.