[Math] How to calculate the intersection points of two cosine (or sine) functions

periodic functionstrigonometry

Let's say I have two functions:

$f_1(t)=\cos(\omega_1t)$

$f_2(t)=\cos(\omega_2t)$

where $\omega_i=2\pi/T_i$ and $T_i$ is the period of the function.

I want to know where $f_1(t)=f_2(t)$ for arbitrary $T_1$ and $T_2$. Naively, I feel that I should set the equations equal to one another:

$\cos(\omega_1t)=\cos(\omega_2t)$

which indicates to me that the arguments of the cosine functions must be equal:

$\omega_1t+n2\pi=\omega_2t$

Solving for $t$:

$t=n\frac{T_1T_2}{T_1-T_2}$

where I've used the periods again. This is true for some intersections, but not all… How can I produce a function that will give me all of the intersections, or intersections for other cases?

For example, the arbitrary case of $T_1=2\pi$ and $T_2=T_1/2.6$. I chose $2.6$ because it's not a neat, easy number to hide somewhere (like a $\pi$ or integer). The plot, with intersections:
Plot of two periods

The first intersection from the equation above is obviously $0$ ($n=0$). Then,

$t = 1.75$

$t = 3.49$

$t = 3.93$

The latter time above is the ($n=1$) intersection from my derived equation… How can I capture the others?

Thanks!

Best Answer

Essentially, you want to solve the equation $\cos(A)=\cos(B)$, or equivalently, $\cos(A)-\cos(B)=0$. By a sum-to-product identity, this is equivalent to $$-2\sin\left(\frac{A+B}{2}\right)\sin\left(\frac{A-B}{2}\right)=0 \quad \implies \quad \sin\left(\frac{A+B}{2}\right)=0 \text{ or } \sin\left(\frac{A-B}{2}\right)=0.$$ Recall $\sin\theta=0$ precisely when $\theta=\pi n$ for $n\in\mathbb{N}$. So we get two families of solutions: $$\sin\left(\frac{A+B}{2}\right)=0 \implies \frac{A+B}{2}=\pi n \implies A+B=2\pi n$$ and $$\sin\left(\frac{A-B}{2}\right)=0 \implies \frac{A-B}{2}=\pi n \implies A-B=2\pi n.$$ Together, these can be summarized as $A\pm B=2\pi n$ or $A=\pm B+2\pi n$.

Starting with your equation $\cos(\omega_1t)=\cos(\omega_2t)$, we'll get that $\omega_1t\pm\omega_2t=2\pi n$, so $$t=\frac{2\pi n}{\omega_1\pm\omega_2}=\frac{nT_1T_2}{T_2\pm T_1}.$$

Related Question