Period of trigonometric function $f(x)=\cos(ax) + \sin(bx)$
This has a period if and only if $\frac{a}{b}$ is rational.
Period of $cos(ax)$ and $sin(bx)$ are $2π/|a|$ and $2π/|b|$, respectively. Now
The period of the sum of two periodic functions are the LCM of their periods
So here the period of $f(x)= cos(ax) + sin(bx)$ will be LCM($2π/|a|$,$2π/|b|$)
PS: As other answers(or comments) pointed out this only works if $a,b \in$ $\mathbb{Z}$