# The sum of two periodic functions need not be a periodic function

Let $f(x)=x-[x]$ and $g(x)=\tan x$.

How could we see that $f(x)-g(x)$ is not a periodic function?

This will show that the sum of two periodic functions need not be a periodic function.

I hope the answer has enough details so that I could catch you.

• Let $T_1$ be the period of $f$ and $T_2$ be that of $g$ then $f+g$ is periodic iff $\frac{T_1}{T_2}\in\mathbb{Q}$ Jul 27, 2013 at 17:09
• @metacompactness Note that it is possible for a (highly discontinuous) function to be periodic with no well-defined minimal period. For instance $f$ could be periodic with period $1$ but also have period $\pi$. In this case $f+f$ is periodic even though $1/\pi \notin \mathbb Q$. I admit this is a pathological example and that there is no canonical period $T$ for $f$, but I think some care needs to be taken not to make unwarranted assumptions. Jul 27, 2013 at 17:22
• "periodic with no well-defined minimal period", what does that mean? can you give an example? Of course we're studying functions $f:~I\subset\mathbb{R}\longrightarrow J\subset\mathbb{R}$ Jul 27, 2013 at 18:07
• @metacompactness Yes, here is an example: use the axiom of choice to choose a unique representative from every coset of the additive subgroup $\langle 1,\pi \rangle$ in $\mathbb R$. Then define $f(x)$ to be the representative of the coset containing $x$. Now $f(x+1) = f(x)$ and $f(x+\pi) = f(x)$. In fact, the periods of $f$ are precisely the numbers of the form $m\pi + n$ with $m,n\in\mathbb Z$, and there is no minimal positive element of this form. Jul 27, 2013 at 18:12
• @ErickWong Is $f$ an application? for example what is the value of $f(\pi)$? Jul 27, 2013 at 20:07

First, notice the range of g is not $\mathbb{R}$ but $\mathbb{R} \cup \{ \infty \}$. Second, $g$ and hence $f - g$ take the value $\infty$ $\color{red}{\text{at and only at}}$ $x = \pm \frac{\pi}{2}, \pm \frac{3\pi}{2}, \pm\frac{5\pi}{2}, \ldots$. This means if $f - g$ is a periodic function, then its period must have the form $n\pi$ where $n \in \mathbb{Z}_{+}$. If $n\pi$ is a period, we will have:

$$f(n\pi) - g(n\pi) = f(0) - g(0)\quad\implies\quad n\pi - \lfloor n\pi\rfloor = 0 \quad\implies\quad \pi = \frac{\lfloor n\pi\rfloor}{n} \in \mathbb{Q}$$

This contradicts with the known fact that $\pi$ is an irrational number.

• This is seems the only answer that actually answers the question without any leaps in logic. Jul 27, 2013 at 18:23

For example, $sin(x) + sin(\sqrt{2} x)$ is not periodic

• It doesn't look like it is periodic, but what is the proof that it isn't? Feb 19, 2014 at 5:51
• Let $f(x) = \sin(x) + \sin(\sqrt{2} x)$. Then $2f(x) + f''(x) = \sin(x)$ and $f(x) + f''(x) = -\sin(\sqrt{2}x)$. If $f$ has period $p > 0$, then $2f + f''$ and $f + f''$ also have period $p$. The first statement implies that $p$ is an integer multiple of $2\pi$, and the second implies that $p$ is an integer multiple of $2\pi\sqrt{2}$. But this is impossible because $\sqrt2$ is irrational. Jul 30, 2018 at 0:34

As user84559 said above, the period T of the difference must be an integer multiple of $f(x)$ and $g(x)$. Now the period of $f(x)$ is $1$, and the period of $f(x)$ is $pi$. So the period could be integer multiples of each period, such as $1, 2, 3, ...$ or $pi, 2pi, 3pi, ...$However, there are no common multiples of $1$ and pi. In other words any of $1, 2, 3,...$ will never equal $pi, 2pi, 3pi...$

• Is it (rigorously) obvious that this is a necessary condition to be a period of $f+g$? One can of course contrive periodic functions $f$, $g$ so that the period of $f+g$ is not a multiple of the respective periods. I find myself exploiting salient features of this specific pair of functions rather than applying a general principle. Jun 3, 2013 at 1:38
• Yeah your approach would be better and there would be more to learn from it but this is the first thing that came to mind and I didn't have a lot of time when I wrote this answer.
– Ovi
Jun 3, 2013 at 3:44
• @ErickWong: Actually, what would be 2 functions f and g such that f+g has a period which is not a multiple of the respective periods?
– Ovi
Jun 3, 2013 at 5:17
• $f(x) = \sin x$ and $g(x) = -\sin x$. Here $f+g$ has many periods which are not multiples of $2\pi$. Similarly one could choose $f+g$ to have period $\frac{\pi}{23}$ while $f$ and $g$ have period $2\pi$ (choose $f+g$ first, then $f$). Jun 3, 2013 at 6:10
• Huh? I just told you how to find an example: choose $f+g$ first, then $f$. For instance take $f(x)+g(x) = \sin(46x)$ and $f(x) = \sin(x)$. Jun 3, 2013 at 6:23