TITLE: $A\cos(\theta) + B\sin(\theta)$ for complex $A,B$
QUESTION [7 upvotes]: Does the equation
$$A\cos(\theta) + B\sin(\theta) = \sqrt{A^2+B^2}\cos(\theta + \gamma) \label{1} \tag{1}$$
with $\gamma = \arg(A-jB)$
require that $A$ and $B$ be real, or can they be complex?
Consider the case $B= jA$ which results in:
$$A\cos(\theta) + jA\sin(\theta) = Ae^{j\theta}$$
Using $\ref{1}$ this results in:
$$=\sqrt{A^2-A^2}\cos(\theta + arg(2A)) = 0$$
Which appears to confirm the answer is no. So then, is there a unified relationship for $A\cos(\theta) + B\sin(\theta)$ that is closest to the form of \ref{1} and allows $A$ and $B$ to be real, imaginary or complex: $A, B \in \mathbb{C}$, $\theta \in \mathbb{R}$ (and \ref{1} is just a simplification of this for A, B real)?
I got this far toward a geometric solution with two cases with A and B both real and with A real and B imaginary as shown below in case this helps toward the analytic result, along with subsequent more significant progress which I provided as an answer. However I would be very interested in a more concise formulation toward a solution or comments on how the answer I provided may be further simplified (toward the form in \ref{1}).
$$A\cos(\theta) + B\sin(\theta)$$
$$= \frac{A}{2}e^{j\theta} + \frac{A}{2}e^{-j\theta} + \frac{B}{2j}e^{j\theta} - \frac{B}{2j}e^{-j\theta}$$
$$= \frac{A}{2}e^{j\theta} + \frac{A}{2}e^{-j\theta} - \frac{jB}{2}e^{j\theta} + \frac{jB}{2}e^{-j\theta}$$
Case with A, B real to confirm known relationship resulting in $A\cos(\theta) + B\sin(\theta) = \sqrt{A^2+B^2}\cos(\theta + \gamma)$:

Case with real A and imaginary B resulting in $\frac{A+jB}{2}\cos(\theta) - jBe^{j\theta}$:

REPLY [2 votes]: Let $A , B \in \mathbb{C}$, we have $$Z = A\cos(\theta) + B\sin(\theta) = (a+bj)\cos(\theta) + (c+dj)\sin(\theta) = (a\cos(\theta) + c\sin(\theta)) + j(b\cos(\theta) + d\sin(\theta)) = \sqrt{a^2 +c^2}\cos(\theta - x_1) + j\sqrt{b^2 +d^2}\cos(\theta - x_2)$$
Where $\tan(x_1) = \frac{c}{a}$ and $\tan(x_2) = \frac{d}{b}$. Note that here real and imaginary parts are independent of each other and it's enough to study $$f(a,b ,\theta) = \sqrt{a^2+b^2}\cos(\theta - x) = \sqrt{a^2+b^2}\mathrm{Re} (e^{-jx}e^{j\theta}) ,\ \ \ \ \tan(x) = \frac{b}{a}$$
So we can represent each of $\mathrm{Re}(Z)$ and $\mathrm{Im}(Z)$ by a phasor.