Derivation (homogenous solution of second-order ODE with constant coefficient)
We want to solve $$ \mathcal D y \equiv a\frac{d^2y}{dx^2} + b\frac{dy}{dx} + cy = 0. $$
$e^{\lambda x}$ is an eigenfunction of $\mathcal D$ since $$ \mathcal D(e^{\lambda x}) = (a\lambda^2 + b\lambda + c)(e^{\lambda x}). $$
Therefore for solutions in the form $y = Ae^{\lambda x}$, it has to satisfy $$ a\lambda^2 + b\lambda + c = 0, $$ which is the characteristic equation. This gives two roots $\lambda = \lambda_1, \lambda_2$.
-
Case 1: $\lambda_1\neq\lambda_2$
We have two linearly independent solutions $$ y_1(x) = Ae^{\lambda_1 x}, \quad y_2(x) = Be^{\lambda_2 x} $$ so the general solution is $$ y(x) = Ae^{\lambda_1 x} + Be^{\lambda_2 x}. $$
-
Case 2: $\lambda_1=\lambda_2$ (degeneracy)
We'll use the method of detuning here, but you can also use reduction of order.
$$ \frac{d^2y}{dx^2} - 2\mu\frac{dy}{dx} + \mu^2 y = 0.$$ We will remove the degeneracy by considering a detuned equation $$ \frac{d^2y}{dx^2} - 2\mu\frac{dy}{dx} + (\mu^2 - \epsilon^2) y = 0 $$ where $\epsilon\ll 1$. In the limit $\epsilon\to 0$, the detuned equation goes back to the original equation.
Solving the characteristic equation, $$\begin{align*} \lambda^2 - 2\mu\lambda + \mu^2 - \epsilon^2 &= 0 \\ (\lambda - \mu)^2 - \epsilon^2 &= 0 \\ (\lambda - \mu + \epsilon)(\lambda - \mu - \epsilon) &= 0 \\ \lambda &= \mu \pm \epsilon. \end{align*}$$
Therefore the general solution of the detuned equation is $$\begin{align*} y &= Ae^{(\mu + \epsilon)x} + Be^{(\mu - \epsilon)x} \\ &= e^{\mu x}(Ae^{\epsilon x} + Be^{-\epsilon x}) \\ &= e^{\mu x}\big(A + A\epsilon x + O(A\epsilon^2) + B - B\epsilon x + O(B\epsilon^2)\big) \\ &= e^{\mu x}\big((A+B) + (A-B)\epsilon x + O(A\epsilon^2) + O(B\epsilon^2)\big). \end{align*}$$ We do not know if $(A-B)$ is in the order $1/\epsilon$ so we cannot directly take the limit $\epsilon\to 0$.
Consider applying some initial conditions, such as $$ y(0) = C,\quad y'(0) = D. $$
Note that by product rule, $$ y'(x) = e^{\mu x}\big((A-B)\epsilon + O(A\epsilon^2) + O(B\epsilon^2)\big) + \mu e^{\mu x}\big((A+B) + (A-B)\epsilon x + O(A\epsilon^2) + O(B\epsilon^2)\big)$$ so the initial condition translates to $$\begin{cases} A+ B &= C \\ (A-B)\epsilon + \mu(A+B) &= D \end{cases}$$ so $$ (A-B)\epsilon = D - \mu C.$$ Also $A = O(1/\epsilon)$ and $B = O(1/\epsilon)$.
Therefore, $$ y = e^{\mu x}\big(C + (D-\mu C)x + O(\epsilon)\big) $$
In the limit, the full solution of the original equation is $$ y(x) = e^{\mu x}(\alpha + \beta x). $$
The general rule is that if $y_{c1}(x)$ is a degenerate complimentary function of a linear ODE with constant coefficient, the other complimentary function is $y_{c2}(x) = xy_{c1}(x)$.