2

How can we can we(or can we?) construct two continuous real valued functions defined over the whole real line that agree at integers only?

AgnostMystic
  • 1,654

4 Answers4

6

$\sin\pi x$ and $-\sin\pi x$.

JMP
  • 21,771
5

Another proposition :

Let $f$ a continuous functions, define :

$$g(x) = f(x) + \frac 1 K \sin(\pi x)$$

The constant $K$ can be used to modify the distance between the two functions.

nicomezi
  • 8,254
2

Without any more conditions, $f(x)=0$ and

$g(x)=\begin{cases} \{x\} & ,\{x\}\leq \frac{1}{2}\\ 1-\{x\} &, \frac{1}{2}<\{x\}<1 \end{cases}$

seem to work, where $\{x\}$ is the fractional part of $x$. Are you perhaps demanding something more from the desired example?

Keen-ameteur
  • 7,663
  • Is $[x]$ the fractional part of $x$? It would be better to indicate this in your answer since $[x]$ refers to numerous related functions. – Jam Mar 04 '20 at 10:27
  • 1
    Yes you're right, I'll edit that in. – Keen-ameteur Mar 04 '20 at 10:28
  • 1
    Also, your example is the triangle wave with frequency of $1$ and amplitude of $0.5$. So it can be given the simpler formula of $\left|x-\left\lfloor x+\frac{1}{2}\right\rfloor \right|$. – Jam Mar 04 '20 at 10:32
  • Initially I wanted to say that any appropriate tent function works, but this is the simplest one that popped to mind, and the simplest expression that I had. – Keen-ameteur Mar 04 '20 at 10:37
1

This is the same as finding a continuous function that cancels at integers only. Say

$$\sin(\pi x)(\cos(5x)+2).$$

enter image description here