I'm trying to solve the differential equation $y^{''} + 2y^{'} + 5y = 0$
I get that the general solution is: $$y = Ae^{-x + 2xi} + Be^{-x-2xi} $$ $$y = e^{-x}(Ae^{2xi} + Be^{-2xi}) $$ $$ y = e^{-x}(A\cos(2x) + Ai\sin(2x) + B\cos(-2x) + Bi\sin(-2x))$$
In the book the answer is written as: $$y = e^{-x}(A\cos(2x) + B\sin(2x))$$
How can my answer be rewritten to equal the book's? Or did I do wrong somewhere?
Using $\sin(-2x)=-\sin(2x)$ and $\cos(-2x)=\cos(2x),$ your result is $$y=e^{-x}\left((A+B)\cos(2x) + i(A-B)\sin(2x)\right)$$
So, letting $C=A+B$ and $D=i(A-B)$, you've got $$y=e^{-x}\left(C\cos(2x)+D\sin(2x)\right)$$