My course notes (Mathematics BSc, second-year module on differential equations, unpublished) say that, given a second-order homogeneous, linear ODE with constant coefficients, $$ay''+by'+cy=0,$$ if the discriminant $b^2-4ac$ of the auxiliary equation is negative then the roots are a conjugate complex pair $\sigma\pm i\omega$, and the general solution can be written $$y(x)=e^{\sigma x}[A\cos(\omega x)+B\sin(\omega x)].$$
I think $B$ must be imaginary. Am I right?
Here's my reasoning.
Edit 1: just spotted my $C,D$ disappear without explanation; working on correcting that now.
Edit 2: fixed, I think; I'll try to tidy up.

No, $\ B\ $ doesn't have to be imaginary. There are some algebraic errors in your derivation, but the main problem with your conclusion is that it appears to rely on an unwarranted assumption that $\ C\ $ and $\ D\ $ must be real numbers. Here's a simpler derivation of the relations between $\ A,B,C\ $ and $\ D\ $: \begin{align} e^{\sigma x}\Big(A\cos(\omega x)+B\sin(\omega x)\Big)&=e^{\sigma x}\Big(A\Big(\frac{e^{i\omega x}+e^{-i\omega x}}{2}\Big)+B\Big(\frac{e^{i\omega x}-e^{-i\omega x}}{2i}\Big)\Big)\\ &=e^{\sigma x}\Big(De^{i\omega x}+Ce^{-i\omega x}\Big)\ , \end{align} where $\ D=\frac{A-iB}{2}\ $ and $\ C=\frac{A+iB}{2}\ $, from which we see that when $\ A\ $ and $\ B\ $ are both real, and $\ B\ne0\ $, then $\ C\ $ and $\ D\ $ are both complex with non-zero imaginary parts.