The constants can be imaginary or complex. But there is a theorem that if the coefficients of the DE are real and the boundary conditions are real, the constants C and D will be real in the {sine,cosine} expression. If you leave the solution in the complex exponential form, the constants A and B will come out complex. So for real coefficients and real boundary conditions, you really just make it complicated if you leave it in the complex exponential form. Use the {sine,cosine} form.