Can the expression $D\cos(x)+Ci\sin(x)$ be rewritten in the form $R\sin(x+\theta)$? I've been trying to use the auxiliary equations method to solve the most simple SHM DE:
$$
\frac{d^2x}{dt^2}+w^2x=0
$$
The auxiliary equation has roots $\lambda=\pm iw$
Hence $x=A\exp(iwx)+B\exp(-iwx)=(A+B)\cos(wx)+i(A-B)\sin(wx)$
Letting $A+B=D$, $A-B=C$, we have the expression in the question.
How can this be rewritten in harmonic form?

You are missing that $A$ and $B$ are also complex numbers. To get a real solution, you would need $B=\bar A$ to get $\overline{x(t)}=x(t)$. Then your expression resolves to
$$
(C+iD)(\cos(wt)+i\sin(wt))+(C-iD)(\cos(wt)-i\sin(wt))=2C\cos(wt)-2D\sin(wt)
$$
and this has a classical conversion to an amplidute-phase form.
