Solution (source code)

= Solution

When all three exponents equal $\alpha$, write $y=e^{\alpha x}v$. The <exponential shift rule for differential operators> gives $(D-\alpha)y=e^{\alpha x}v'$ and $(D-\alpha)^2y=e^{\alpha x}v''$. Thus $v''=k$. Two integrations give
$$
\boxed{y=e^{\alpha x}\left(C_1+C_2x+\frac{kx^2}{2}\right).}
$$
The repeated <characteristic root> supplies $e^{\alpha x}$ and $xe^{\alpha x}$ as <homogeneous solutions>; forcing at that same exponent needs the further $x^2$ factor.