Analysis – How to Reduce Cos(x) + 2Sin(x) with Phase Shift

analysistrigonometry

So, I'm analysing the function $\cos{x} + 2\sin{x} (*)$ and determining whether it is convertible to the single function $R\cos{x – a}$ for $a \in (0, \frac{\pi}{2}); R > 0$; so I begin by observing the maximum/minimum of $(*)$ and determining its max./min. at $\pm\sqrt{5}$, so then I apparently have that $R = \sqrt{5}$ as the radius/magnitude of the corresponding function.

Next, I seek to find the phase-shift difference between my $\sqrt{5}\cos{x}$ and $\cos{x} + 2\sin{x}$, so, I take two reference points at their relative roots, i.e. $\cos{x} + 2\sin{x} = 0 \iff x = -\arctan{\frac{1}{2}} + n\pi, n \in \mathbb{Z}$, and respectively, $\sqrt{5}\cos{x} = 0 \iff x = \frac{\pi}{2} + n\pi, n \in \mathbb{Z}$. So I figure that if I take the x's matching with the roots of the functions in the same period, then I should have the phase-shift and my function mutation should be done.

I take $n = 1$ for both functions, so I have $x_{\sqrt{5}\cos{x}} = \pi + \frac{\pi}{2}$ and $x_{\cos{x} + 2\sin{x}} = \pi – \arctan{\frac{1}{2}}$. Then I take their absolute difference, and theoretically this should be the shift. So, $|x_{\sqrt{5}\cos{x}} – x_{\cos{x} + 2\sin{x}}| = |[\pi + \frac{\pi}{2}] – [\pi – \arctan{\frac{1}{2}}]| = |\frac{\pi}{2} + \arctan{\frac{1}{2}}| \approx 2.034$.
So immediately this evaluation seems incorrect; 2.034 radians is well over half a period, and according to plots of these functions the difference does not seem this drastic.

Observe the plot for $y = \sqrt{5}\cos{x – (\frac{\pi}{2} + \arctan{\frac{1}{2}})}$ and $y = \cos{x} + 2\sin{x}$

plot

Evidently incorrect, so I then plot $x = -\arctan{\frac{1}{2}}$ and $y = \cos{x} + 2\sin{x}$ to actually determine where this x-value was being matched:

wtf???

For some reason, the $-\arctan{\frac{1}{2}}$ was in a completely separate period relative to $\sqrt{5}\cos{x}$ at $n=1$. And here my question(s) arises: why is this root observed in a separate period? How can I find where the start of these periods are? Is there a better method to finding the difference between these trigonometric functions besides at the roots?

Best Answer

I would like to suggest another approach to this problem, which I find more illuminating, based on Euler's formula, which says that $\cos x$ is the real part of $e^{ix}$ and $\sin x$ is the real part of $-ie^{ix}$, so we can put $\cos x+2\sin x$ in the desired form by looking at the real part of $e^{ix}-2ie^{ix}$. But this is just $$ (1-2i)e^{ix}, $$ so both $R$ and $a$ can be found simply by plotting the complex number $1-2i$ and seeing what its distance from the origin is ($R$) and what angle its makes, counterclockwise from the positive $x$-axis ($a$). You will find that $\tan a=-2$, since in general for a complex number $z=x+iy$ the angle $a$ will satisfy $\tan a=y/x$, and in this case $y=-2$ and $x=1$.

Related Question