Could someone kindly explain to me why these two expressions are equal?
$$\begin{align} x(t)&=c_1e^{-\beta t}\sin(rt) + c_2e^{-\beta t}\cos(rt) \\[4pt] &= Ae^{-\beta t}\cos(rt+\phi) \end{align}$$
with $r := \sqrt{\omega_0^2-\beta^2 }$, where $c_1$, $c_2$ or $A$ and $\phi$ are the pair of arbitrary real constants, while $\beta$ and $\omega_0$ are the known quantities and $t$ represents the independent variable.
$x(t)$ is a linear combination (addition) of a $\sin$ and $\cos$ functions. Because a $\sin$ function can be expressed as a shifted $\cos$ function, we can express $x(t)$ as an addition of two $\cos$ functions (one is shifted, the other one is not shifted), which results in a (shifted) $\cos$ function. That's why $x(t) = a_1 \sin(bt) + a_2 \cos(bt)$ with $a_1 = c_1~e^{-βt}, a_2 = c_2~e^{-βt}$ and $b=\sqrt{ω_0^2-β^2 }$ is the same as $x(t) = A~e^{-βt}~\cos\left(b~t+ φ\right)$, if we choose/calibrate the right constants $A,c_1,c_2$ and $\varphi$ and we can express the amplitude $A$ and the shift angle $\varphi$ in terms of the amplitudes $c_1$ and $c_2$. Just set some values for $t$ like $t = 0$ and $t = \frac{\pi}{2b}$. Then we get $x(t=0)=c_2 =A\cos(\varphi) \Rightarrow c_2^2 = A^2\cos^2(\varphi)$ and $x(t=\frac{\pi}{2b})=c_1=A\cos(\frac{\pi}{2}+\varphi)=-A\sin(\varphi) \Rightarrow c_1^2 = A^2\sin^2(\varphi)$. Then add the two equations and use the identity $\sin^2(x)+\cos^2(x)=1$ to get $A = \sqrt{c_1^2+c_2^2}$. Divide the equations to get $\tan(\varphi)=\large{\frac{c_1}{c_2}}.$
This equation is a solution for some mechanical problem: Differential equation for describing the swing of a spring.