I am asked to show that a function $y=A\cos(px)+B\sin(px)$ can only be periodic if $p$ is an integer $n$, where $A$, $B$ are arbitrary constants.
In other words $y(x)=y(x+2 \pi)$
I begin by solving for both sides of the equation: $y(x)=A\cos(px)+B\sin(px)$
$y(x+2\pi)=A\cos(px+2\pi p)+ B\sin(px+2\pi p)$
According to the trigonometric identities $\cos(a+b)=\cos(a)\cos(b)-\sin(a)\sin(b)$
and $\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)$
It follows that :
$A\cos(px+2\pi p)+ B\sin(px+2\pi p) = A[\cos(px)\cos(2\pi p)-\sin(px)\sin(2\pi p)] + B[\sin(px)\cos(2\pi p)+\cos(px)\sin(2\pi p)]$
My idea was then to equate the coefficients of $\cos(px)$ and $\sin(px)$ on both the left and right side of the expression; thus:
$A=A\cos(2\pi p)+B\sin(2\pi p)$ [1]
and
$B=-A\sin(2\pi p)+B\cos(2\pi p)$ [2]
dividing [1] by $A$ and [2] by $B$ yields:
$1=\cos(2\pi p)+B/A\sin(2\pi p)$ [3]
and
$1=-A/B\sin(2\pi p)+\cos(2\pi p)$ [4]
Subtracting 4 from 3 yields:
$0=(B/A+A/B)\sin(2\pi p)=0$
Clearly $A$ and $B$ can not be themselves zero; nor can the expression $(B/A+A/B)=0$
Hence:
$2\pi p=n \pi$ implying $p=n/2$
Can anybody find some error in my reasoning or point me in the correct direction?
Does $Y$ need to have a period of $2\pi$? If $Y$ had a period of $\pi$, then how could you adapt your solution to show p is an integer?