Solution (source code)

= Solution

For an exponential trial $y=e^{rx}$, the <characteristic equation> is
$$
r^2+2ar+a^2+b^2=(r+a)^2+b^2=0.
$$
Its distinct complex <roots> are $r=-a\pm ib$. Thus the general real solution of the homogeneous <second-order linear differential equation> is
$$
\boxed{y_h(x)=e^{-ax}[C_1\cos(bx)+C_2\sin(bx)].}
$$
The two displayed solutions have nonzero <Wronskian> $be^{-2ax}$ and hence <linear independence>. The same formula permits complex solutions when $C_1,C_2$ are complex.