<s>[INST] Can a ratio of sinusoidal functions with the same frequency always be written as a tangent function? In general, two sinusoidal functions $y_1$ and $y_2$ with angular frequency $\omega$ can be written as

*

*$y_1 = A\sin(\omega x) + B \cos(\omega x)$,


*$y_2 = C\sin(\omega x) + D \cos(\omega x)$.
Where $A, B, C, D$ are real numbers and it is not the case that $A=B=0$ or $C=D=0$.
Can the ratio $\frac{y_1}{y_2}$ always be written in the form
$$ \frac{y_1}{y_2} = E \tan(\omega x + h) + k$$
for some constants $E, h$, and $k$?
Edit:
For example
$$\frac{12 \sin (x) + 3 \cos(x)}{  4 \sin(x) + 2 \cos(x)}$$
has a graph like this:

Which looks like the tangent function transformed by scaling and shifting.
 [/INST] The answer is yes.
Claim 1 : If $D=0$, then
$$\dfrac{y_1}{y_2}=-\frac BC \tan\bigg(\omega x -\frac{\pi}{2}\bigg) + \frac AC$$
Claim 2 : If $D\not=0$, then $$\frac {y_1}{y_2}=\frac{DA-BC}{C^2+D^2}\tan\bigg(\omega x-\arctan\bigg(\frac CD\bigg)\bigg)+\frac{CA+BD}{C^2+D^2}$$

Claim 1 : If $D=0$, then
$$\dfrac{y_1}{y_2}=-\frac BC \tan\bigg(\omega x - \frac{\pi}{2}\bigg) + \frac AC$$
Proof :
One has
$$\frac{y_1}{y_2}=\frac BC\cdot\frac{\cos(\omega x)}{\sin(\omega x)}+\frac AC=-\frac BC \tan\bigg(\omega x - \frac{\pi}{2}\bigg) + \frac AC\ .\quad\blacksquare$$

Claim 2 : If $D\not=0$, then $$\frac {y_1}{y_2}=\frac{DA-BC}{C^2+D^2}\tan\bigg(\omega x-\arctan\bigg(\frac CD\bigg)\bigg)+\frac{CA+BD}{C^2+D^2}$$
Proof :
If $A=\dfrac{BC}{D}$, then
$$\frac{y_1}{y_2}=\frac{B(C\sin(\omega x)+D\cos(\omega x))}{D(C\sin(\omega x)+D\cos(\omega x))}=\frac BD$$
In the following, $A\not=\dfrac{BC}{D}$.
For $x$ such that $\cos(\omega x)\not=0$, one has
$$\frac{y_1}{y_2}=\frac{ A\dfrac{\sin(\omega x)}{\cos(\omega x)} + B}{C\dfrac{\sin(\omega x)}{\cos(\omega x)} + D}=\frac{A\tan(\omega x)+B}{C\tan(\omega x)+D}=\frac{\dfrac AD\tan(\omega x)+\dfrac BD}{\dfrac CD\tan(\omega x)+1}$$
Now,
$$\begin{align}G\bigg(\frac{y_1}{y_2}+F\bigg)&=\frac{G\dfrac AD\tan(\omega x)+G\dfrac BD}{\dfrac CD\tan(\omega x)+1}+GF
\\\\&=\frac{G\dfrac AD\tan(\omega x)+G\dfrac BD+GF\bigg(\dfrac CD\tan(\omega x)+1\bigg)}{\dfrac CD\tan(\omega x)+1}
\\\\&=\frac{G\bigg(\dfrac AD+\dfrac{CF}{D}\bigg)\tan(\omega x)-G\bigg(-\dfrac BD-F\bigg)}{1+\dfrac CD\tan(\omega x)}\end{align}$$
Solving the system
$$\begin{cases}G\bigg(\dfrac AD+\dfrac{CF}{D}\bigg)=1
\\G\bigg(-\dfrac BD-F\bigg)=\dfrac CD\end{cases}$$
for $F$ and $G$, one has
$$G=\frac{C^2+D^2}{DA-BC},\qquad F=\frac{-CA-BD}{C^2+D^2}$$
So, taking $(F,G)=\bigg(\dfrac{-CA-BD}{C^2+D^2},\dfrac{C^2+D^2}{DA-BC}\bigg)$, one has
$$G\bigg(\frac{y_1}{y_2}+F\bigg)=\frac{\tan(\omega x)-\dfrac CD}{1+\dfrac CD\tan(\omega x)}=\tan\bigg(\omega x-\arctan\bigg(\frac CD\bigg)\bigg)$$
so one gets
$$\frac {y_1}{y_2}=\frac 1G\tan\bigg(\omega x-\arctan\bigg(\frac CD\bigg)\bigg)-F,$$
i.e.
$$\frac {y_1}{y_2}=\frac{DA-BC}{C^2+D^2}\tan\bigg(\omega x-\arctan\bigg(\frac CD\bigg)\bigg)+\frac{CA+BD}{C^2+D^2}$$
which holds even for $x$ such that $\cos(\omega x)=0$ since for $x=\dfrac{1}{\omega}\bigg(\dfrac{\pi}{2}+n\pi\bigg)$ where $n$ is an integer, one has
$$\begin{align}\text{RHS}&=\frac{DA-BC}{C^2+D^2}\tan\bigg(\dfrac{\pi}{2}+n\pi-\arctan\bigg(\frac CD\bigg)\bigg)+\frac{CA+BD}{C^2+D^2}
\\\\&=\frac{DA-BC}{C^2+D^2}\cdot\frac{\cos\bigg(\arctan\bigg(\dfrac CD\bigg)\bigg)}{\sin\bigg(\arctan\bigg(\dfrac CD\bigg)\bigg)}+\frac{CA+BD}{C^2+D^2}
\\\\&=\frac{DA-BC}{C^2+D^2}\cdot\frac{1}{\dfrac CD}+\frac{CA+BD}{C^2+D^2}
\\\\&=\dfrac AC
\\\\&=\dfrac{y_1}{y_2}\end{align}$$
Therefore, one finally can say that if $D\not=0$, then
$$\frac {y_1}{y_2}=\frac{DA-BC}{C^2+D^2}\tan\bigg(\omega x-\arctan\bigg(\frac CD\bigg)\bigg)+\frac{CA+BD}{C^2+D^2}\ .\quad\blacksquare$$

Using this, your example can be written as
$$\frac{12 \sin (x) + 3 \cos(x)}{  4 \sin(x) + 2 \cos(x)}=\frac{3}{5}\tan\bigg(x-\arctan(2)\bigg)+\frac{27}{10}$$
</s>