We have a 2nd order Linear Homogeneous Ordinary Differential Equation (LH-ODE):
$$\frac{d^2x}{dt^2}+2k\frac{dx}{dt}+\omega^2x=0 \tag{I} $$
Its general solution is, as pointed in the question:
$$x(t)=e^{-kt}\cdot(Ae^{i\omega't}+Be^{-i\omega't})$$
What the significance of the term $i(A-B)\sin(\omega't)$ ?
Using Euler's formula $(e^{i\theta}=\cos\theta+i\sin\theta)$, we have:
\begin{cases}
e^{i\omega't}=\cos(\omega't)+i\sin(\omega't) \\
e^{-i\omega't}=\cos(-\omega't)+i\sin(-\omega't)=\cos(\omega't)-i\sin(\omega't)
\end{cases}
Therefore:
\begin{align}
x(t) & = e^{-kt}\cdot\big[A\cos(\omega't)+iA\sin(\omega't)+B\cos(\omega't)-iB\sin(\omega't)\big]\\
& =e^{-kt}\cdot\big[(A+B)\cos\omega't+i(A-B)\sin\omega't\big]\\
& =e^{-kt}\cdot(A+B)\cos\omega't+i\cdot e^{-kt}(A-B)\sin\omega't \tag{II}
\end{align}
Note that the equation $\text{(II)}$ above is still the general solution of $\text{(I)}$. Now let's remember the linearity of the solutions and the superposition principle valid for any LH-ODE:
If $x_1(t)$ and $x_2(t)$ are particular solutions, then $x_1(t)+x_2(t)$ is also a particular solution;
If $x(t)$ is a particular solution, then $u\cdot x(t)$, where $u\in\mathbb{C}$ is an arbitrary constant, is also a particular solution;
The general solution in given by: $x(t)=u\cdot x_1(t)+v\cdot x_2(t)$, where $u,v\in\mathbb{C}$ are arbitrary constants.
So, comparing the above general solution with $\text{(II)}$:
\begin{cases}
x_1(t)=e^{-kt}\cdot\cos(\omega't) & \text{and}\space\space\space\space u=A+B \\
x_2(t)=e^{-kt}\cdot\sin(\omega't) & \text{and}\space\space\space\space v=i\cdot(A-B)
\end{cases}
Therefore, $\space i\cdot(A-B)\sin\omega't\space$ has no meaning, but $\space i\cdot (A-B)e^{-kt}\sin\omega't\space$ has: is one of the particular solutions of $\text{(I)}$.
What is the justification for the use of $\space i\cdot(A-B)=C\cos\phi$ ?
First, let's find the values of $A$ and $B$ :
$$\begin{align}
\begin{cases}
A+B=C\sin\phi\\
i\cdot(A-B)=C\cos\phi
\end{cases}
\iff \begin{cases}
A=\frac C2\left(\sin\phi+i\cos\phi\right)\\
B=\frac C2\left(\sin\phi-i\cos\phi\right)\\
\end{cases}
\,\end{align}$$
We can see that $A=B^{\space*}$, where $*$ denotes complex conjugation. Moreover, $\frac C2\left(\sin\phi+i\cos\phi\right)$ and $\frac C2\left(\sin\phi-i\cos\phi\right)$ are the polar forms of $A$ and $B$. If the values of $A$ and $B$ are substituted in $\text{(II)}$, we have:
\begin{align}
x(t) &= e^{-kt}\cdot\big[C\space\sin\phi\space\cos(\omega't)+C\space\cos\phi\space\sin(\omega't)\big]\\
&=C e^{-kt}\cdot\sin(\omega't+\phi)
\end{align}
So, the question now becomes "Why were the constants $A$ and $B$ chosen in this way?"
For three reasons, which I'll list below:
- In a physical problem, $x(t)$ must be real (We can't have the position $x(t)=7+3i$ meters, for example) and the choice of $A=B^{\space*}$ ensures that $x(t)$ is real. This becomes more evident if we take the rectangular form of $A$ and $B$ and substitute them in $\text{(II)}$:
\begin{equation}
\left.
\begin{aligned}
A &\triangleq a+ib\\
B &\triangleq a-ib\
\end{aligned}
\right\}
\implies
\begin{aligned}[t]
x(t) &= e^{-kt}\cdot\big[(a+ib+a-ib)\cos\omega't+i(a+ib-a+ib)\sin\omega't\big]\\
&= e^{-kt}\cdot\big[(2a)\cos\omega't+(-2b)\sin\omega't\big]\\
&\therefore\space \forall t, \space x(t)\in\mathbb{R} \end{aligned}
\end{equation}
The choice of $\sin\phi+i\cos\phi$ instead of the "more natural" way $\cos\phi+i\sin\phi$ is arbitrary, because if we use $\phi=\frac{\pi}{2}-\theta\space$ (without loss of generality), it's possible to see that:
$$\sin\phi+i\cos\phi=\sin\left(\frac{\pi}{2}-\theta\right)+\cos\left(\frac{\pi}{2}-\theta\right)=\cos\theta+i\sin\theta$$
So if we make the substitutions in $\text{(II)}$:
– If we choose $A=B^{\space*}=\frac C2\left(\sin\phi+i\cos\phi\right)$, then we have $x(t)=C e^{-kt}\cdot\sin(\omega't+\phi)$
– If we choose $A=B^{\space*}=\frac C2\left(\cos\phi+i\sin\phi\right)$, then we have $x(t)=C e^{-kt}\cdot\cos(\omega't+\phi)$
(And both forms are valid to represent the position $x(t)$ in the underdamped harmonic motion)
The choice of $\frac C2$ and not just $C$ is for convenience:
– If we choose $A=B^{\space*}=\frac C2\left(\sin\phi+i\cos\phi\right)$, then we have $x(t)=C e^{-kt}\cdot\sin(\omega't+\phi)$
– If we choose $A=B^{\space*}=C\left(\sin\phi+i\cos\phi\right)$, then we have $x(t)=2 C e^{-kt}\cdot\sin(\omega't+\phi)$
(And both forms are valid to represent the position $x(t)$ in the underdamped harmonic motion, but no one uses the latter, because if we define $D\triangleq2C$ it's easy to see that the two forms are equivalent)