For a second order homogeneous DE with complex roots $a \pm bi$ (e.g., $y'' + 6y'+10y = 0$), the solution is:
$$y = e^{ax}(A \cos(bx) + B \sin(bx))$$
When I take the first and second derivative of this solution ($y'$ and $y''$), and put them back into the original DE, it doesn't work, I mean the LHS will not be equal to zero. Is there anything I am missing? why it happens?
The DEQ is
$$\tag 1 y'' + 6y'+10y = 0$$
The solution is given by
$$\tag 2 y(x) = e^{-3 x} (a \cos (x)+b \sin (x))$$
Substituting $(2)$ into $(1)$
$$(9 e^{-3 x} (a \cos (x)+b \sin (x))-6 e^{-3 x} (b \cos (x)-a \sin (x))+e^{-3 x} (-a \cos (x)-b \sin (x))) + (6 \left(e^{-3 x} (b \cos (x)-a \sin (x))-3 e^{-3 x} (a \cos (x)+b \sin (x))\right)) + (10 e^{-3 x} (a \cos (x)+b \sin (x))) = 0$$
Update
$\begin{align} y''(x) &= 6 a e^{-3 x} \sin (x)+8 a e^{-3 x} \cos (x)+8 b e^{-3 x} \sin (x)-6 b e^{-3 x} \cos (x) \\ 6 y'(x) &= -6 a e^{-3 x} \sin (x)-18 a e^{-3 x} \cos (x)-18 b e^{-3 x} \sin (x)+6 b e^{-3 x} \cos (x) \\10 y(x) &= 10 a e^{-3 x} \cos (x)+10 b e^{-3 x} \sin (x) \end{align}$
Now you can easily sum all the items and you get zero.