If $f(x) = \sin x+\cos ax$ is periodic function, Then $a$ is If $f(x) = \sin x+\cos ax$ is periodic function, Then $a$ is 
Attempt: If $f(x)$ is periodic function, Then $f(x+T) = f(x)$
So $\sin(x+T)+\cos(a(x+T)) = \sin x+\cos ax$ for all $x$
Now How can i calculate $a$, could some help me, thanks
 A: The function $x\mapsto \cos(ax)$ is periodic with period $2\pi/a.$ And $x\mapsto\sin x$ is periodic with period $2\pi.$ In order that the sum $\sin x + \cos(ax)$ be periodic, it is necessary that some integer number $n$ of periods of $x\mapsto\cos(ax)$ must be equal to some integer number $m$ of periods of $x\mapsto\sin x.$ Thus we have
$$
n \frac{2\pi} a = m\cdot 2\pi.
$$
Thus $a = n/m.$ In other words, $a$ must be a rational number.
A: What is periodic? You defined it.
$\sin(x)$ has a period of $2π$.
$\cos(ax)$ has a period of $\frac{2\pi}{a}$.
If $a$ is an integer, then the period of $f(x)$ is $2π$. 
Now, let $a=\frac{p}{q}$. Then we have $\cos(ax)$ has a period of $\frac{2\pi q}{p}$. 
We now need to find the LCM of these two periods. Fortunately, it isn't hard, and the period is $2πq$.  Note that our fraction should be simplified.
Now let's say $a=0.12342342535262362355\ldots$, is irrational. The period is defined for $a=0.123$, $a=0.1234$, and $a=0.1234234$. But the period gets exceedingly long. As this rational number approaches a denominator of infinity, or $a$ approaches true irrationality, the period does not exist, and thus the function isn't periodic. 
In other terms, the function is only periodic if $a$ is rational.
