Please help me please.
I found a solution of a differential equation :
$a\cdot\ddot{r}+b\cdot r=c$
where a,b,c are constant.
The solution looks like : $r_h(t)=A\exp(i\omega_{0}t)+B\exp(-i\omega_{0}t)$ Where A and B are complex constants.
Now I need to find the constants using my initial values and the particular solution combined with my homogenous solution and this is fine.
However I do remember that this homogenous solution can be also represented as $r_h(t)=C_{0}\cos(\omega_{0}t+\varphi)$ where $C_0$ is a real number as well as $\varphi$
How do I turn this sum of complex exponentials $A\exp(i\omega_{0}t)+B\exp(-i\omega_{0}t)$ and turn it into $C_{0}\cos(\omega_{0}t+\varphi)$
Thank you !!
$$A\exp(i\omega_0t)+B\exp(-i\omega_ot)=(A+B)\cos(\omega_ot)+i(A-B)\sin(\omega_0t)\\=2\sqrt{AB}(\cos\theta\cos(\omega_ot)+\sin\theta\sin(\omega_0t))\\=2\sqrt{AB}\cos(\omega_0t-\theta)$$
Where $\cos\theta={A+B\over 2\sqrt{AB}}$
EDIT:
Here I have taken $\sin\theta $ to be an imaginary quantity. If you don't want so, you will have to make $A=B$ (from the first inequality)