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.
First let's dispense with having to worry about $\omega$ all the time. Let $t = \omega x.$ Then \begin{align} y_1 &= A\sin(t) + B \cos(t),\\ y_2 &= C\sin(t) + D \cos(t). \end{align}
Let $R$ and $\alpha$ be such that
$$ C\sin(t) + D \cos(t) = R \cos(t + \alpha). $$
Then $$ R\sin(t + \alpha) = -\frac{\mathrm d}{\mathrm dt} R\cos(t + \alpha) = D \sin(t) - C \cos(t). $$
Now we want $u$ and $v$ such that $u \langle D, -C \rangle + v \langle C, D\rangle = \langle A, B\rangle.$ Since $C^2 + D^2 \neq 0$ we can solve this as $$ u = \frac{AD - BC}{C^2 + D^2}, \quad v = \frac{AC + BD}{C^2 + D^2}. $$
Then \begin{align} \frac{y_1}{y_2} &= \frac{u(D \sin(t) - C \cos(t)) + v(C\sin(t) + D \cos(t))}{C\sin(t) + D \cos(t)} \\ &= \frac{uR\sin(t + \alpha) + vR \cos(t + \alpha)}{R \cos(t + \alpha)} \\ &= u\tan(t + \alpha) + v \\ &= u\tan(\omega x + \alpha) + v. \end{align}
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}$$
Yes: for $C,D$ not both zero, $$\frac{A\sin \omega x+B\cos \omega x}{C\sin \omega x+D\cos \omega x}=\frac{AD-BC}{C^2+D^2}\;\tan\left(\omega x-\arctan\frac CD\right)+\frac{AC+BD}{C^2+D^2}.$$ This is true even when $D=0,$ if we let $\displaystyle\arctan\frac CD=\begin{cases}\displaystyle&\frac\pi2&\text{if }C>0; \\ \displaystyle-&\frac\pi2 &\text{if }C<0.\end{cases}$
- The above expressions for the parameters $E,h,k$ were obtained by equating $$\frac{A\sin \omega x+B\cos \omega x}{C\sin \omega x+D\cos \omega x}$$ and the given tangent function $$E \tan(\omega x + h) + k,$$ expanding the latter into sines and cosines, observing from the denominators that $$\frac CD=-\tan h,$$ and setting $$h=-\arctan\frac CD.$$ Now, $h$ is in either quadrant $4$ or $1$ depending on the relative signs of $C$ & $D,$ so $$\sin h=\frac{\mp C}{C^2+D^2},\\\cos h=\frac{D}{C^2+D^2}.$$ Substituting these two equalities into the equation where we left off gives $$\sqrt{C^2+D^2}(E\cos h-k\sin h)=A,\\\sqrt{C^2+D^2}(E\sin h+k\cos h)=B.$$ Solving this system finally gives the above expressions for $E$ and $k.$
- Here's a rigorous proof: $$\frac{AD-BC}{C^2+D^2}\;\tan\left(\omega x-\arctan\frac CD\right)+\frac{AC+BD}{C^2+D^2}\\ =\frac{AD-BC}{C^2+D^2}\left(\frac{\tan \omega x-\frac CD}{1+(\tan \omega x)\frac CD}\right)+\frac{AC+BD}{C^2+D^2}\\ =\frac{AD-BC}{C^2+D^2}\left(\frac{D\sin \omega x-C\cos \omega x}{D\cos \omega x+C\sin \omega x}\right)+\frac{AC+BD}{C^2+D^2}\\ =\frac{(AD-BC)(D\sin \omega x-C\cos \omega x)+(AC+BD)(D\cos \omega x+C\sin \omega x)}{(C^2+D^2)(C\sin \omega x+D\cos \omega x)}\\ =\frac{(AD^2-BCD+AC^2+BCD)\sin \omega x+(-ACD+BC^2+ACD+BD^2)\cos \omega x}{(C^2+D^2)(C\sin \omega x+D\cos \omega x)}\\ =\frac{A\sin \omega x+B\cos \omega x}{C\sin \omega x+D\cos \omega x}.$$