About use of complex number in AC steady state analysis
The main point of the question is why it is valid to replace the term  \$A\cos(\omega t+\theta)\$ by \$A\angle\theta\$.

The expression \$A \angle \theta\$ is a notation for \$ A e^{j\theta}\$, which is called the phasor representation.

Actually there is no identity that would directly result in this representation instead a phasor transform is defined as follows
$$
 A e^{j\theta} = {\cal P} \left\{A cos(\omega t + \theta)\right\}
$$
along with inverse transform
$$
  {\cal P}^{-1}\{A e^{j\theta} \} = Re\left\{A e^{j\phi} e^{j\omega t}\right\}
$$
Often a formal definition is omitted, since phasors are quite common and well-known, but good textbooks usually include them.