# The sum of two continuous periodic functions is periodic if and only if the ratio of their periods is rational?

There are several questions here on MSE about the periodicity of the sum of two continuous, periodic functions. Here's what I know so far:

• It's obvious that if the ratio of the periods is rational, the sum of the functions will be periodic with a period equal to the LCM of the individual periods.

• It's relatively easy to give a counterexample to show that the sum of two continuous periodic functions is not always periodic, for instance by considering $\sin(x) + \sin(\pi x)$.

My hunch is that in fact, the sum of two continuous periodic functions is periodic if and only if the ratio of their periods is rational. First of all, is this true?

Secondly, if it's true, the sufficient part is obvious, but is there a simple proof to show the necessary part?

By a "simple" proof I mean one that is accessible to someone with no extensive formal knowledge of analysis or algebra. This is the closest proof I could find, but I can't quite follow it.

• It won't be easy to provide a proof substantially simpler than the one you refer to. However looking in details at a proof that the additive subgroups of the reals are either dense or discrete will really help you to understand the topic. – mathcounterexamples.net Jul 10 '15 at 20:13

Let $f,g$ be continuous and periodic with period $p,q$ where $\alpha=\frac pq$ is irrational. Assume $f+g$ is periodic with period $r$. Let $f(x_0)=\max f$ and $g(x_1)=\max g$. Then the set $\{\,np+mq\mid n,m\in\mathbb Z\,\}$ is dense in $\mathbb R$. Let $\epsilon>0$. Then for some $\delta>0$, $|x-x_1|<\delta$ implies $g(x)>g(x_1)-\epsilon$. Let $np+mq$ differ by less than $\delta$ from $x_1-x_0$. Then $f(x_0+np)=\max f$ and $g(x_0+np)>\max g-\epsilon$. We conclude that $\max(f+g)=\max f+\max g$. So assume $(f+g)(x_2)=\max (f+g)=\max f+\max g$. Then $(f+g)(x_2+nr)=\max(f+g)$ implies that also $f(x_2+nr)=\max f$ and $g(x_2+nr)=\max g$. At least one of $\frac rp$, $\frac rq$ is irrational, say $\frac rp$ is irrational. Then the set $\{\,x_2+nr+mp\mid n,m\in\mathbb Z\,\}$ is dense in $\mathbb R$ and we conclude that $f(x)=\max f$ on this dense set and hence throughout. Thus $f$ is constant.

In summary: The sum of two nonconstant continuous periodic functions with incommensurable periods is not periodic.

$f(x+p)=f(x); g(x+p')=g(x) \rightarrow (f+g)(x)=f(x+kp)+g(x+k'p'); k \in \mathbb Z$ . Now, $f+g$ must satisfy both periods $p,p'$, so:

Then, for a period, we need $$x+kp=x+k'p'\rightarrow \frac {k}{k'}= \frac{p}{p'}$$.

EDIT: My claim: given $f,g$ periodic, then $h:=f+g$ repeats precisely , i.e., iff $f,g$ simultaneously repeat, i.e., $h$ must satisfy the periods of both $f,g$. This happens precisely when the ratio of their periods is Rational.

• Nothing in your first two lines forces $x+kp=x+k'p'$. – Greg Martin Jul 10 '15 at 20:46
• How so? For the two periods to overlap, we need $x+kp=x+k'p'$. The first two lines are just the layout. – Gary. Jul 10 '15 at 20:54
• @GregMartin: So is it incorrect to say that $f+g$ must be periodic n both $p,p'$, ? – Gary. Jul 10 '15 at 22:48
• @GregMartin: My claim is that if g,h are periodic with periods p1, p2, and f=g+h is periodic with period p, then p1|p and p2|p . Are you saying this is incorrect? – Gary. Jul 14 '15 at 16:27
• I'm not discussing your claim; I'm discussing your proof. Your proof has an equality appear, as I point out, that does not follow from what you've written before. Therefore the proof is incorrect. — I will add that the edit of your answer makes you come across as defensive and petty, and certainly convinces me it's not worth my time to interact with you further. – Greg Martin Jul 14 '15 at 17:40