# If $f(x)=f(2x)$, then how do we get the solution $f(x)=\sin ( \log _a (x))$ through computation?

In this question Does $f(x) = f(2x)$ for all real $x$, imply that $f(x)$ is a constant function?, one of the answers mentioned a counterexample that $$f(x) = \sin (\log _a(x))$$ is a solution, (where $$a=2^{\frac{1}{2\pi}}$$) which is albeit not continuous at $$x=0$$ , but satisfies the given criteria.

I am trying to derive this through differential equations, but the answer is eluding me...

(Specifically, I was using $$2f'(2x)=f'(x)$$, with $$f'(1)=\frac{1}{ \ln(a)}$$, where $$a=2^{\frac{1}{2\pi}}$$)

Can someone guide me as to how to derive this solution without guessing at it?

• Does "make the substitution $u=\log x$" count as guessing? May 6, 2019 at 4:10
• Okay, accepted, some 'guesswork' is always involved in solving differential equations... Thanks though. Calculus is all about guessing the right substitution sometimes, actually May 6, 2019 at 4:38

I don't think you'll arrive algebraically or via differential equations at the example $$f(x) = \sin(\log_a(x))$$ without imposing some fairly restrictive condition that will feel like supposing the result, as that example is not at all generic. Indeed, if $$g_+,g_-: \mathbb{R} \to \mathbb{R}$$ are any two periodic functions with period $$1$$, $$g_{\pm}(x+1)=g_{\pm}(x)$$, and we define $$f$$ by

$$f(x) = g_{\pm}\left( \log_2(|x|) \right), \pm x>0$$

($$f(0)$$ may be assigned arbitrarily), $$f$$ will have the desired property. So, the given example fails to be generic by at least the same degree that $$\sin(2\pi x)$$ fails to be a generic $$1$$-periodic function, whatever that means.

We can conversely conclude algebraically that the above form accounts for all functions satisfying your condition. Indeed, if $$f$$ is such a function, then if we define the two functions $$g_{\pm}$$ by

$$g_{\pm}(x) = f(\pm 2^{x})$$

We see that $$g_{\pm}$$ are each $$1$$-periodic, and further $$g_{\pm} \left( \log_2(|x|) \right) = f(\pm|x|)$$ as above.

This is to say, you will not be able to conclude that $$f(x) = \sin(\log_a(x))$$ just from the given condition because there are infinitely many other functions satisfying this condition. In fact, the set of such functions is in one-to-one correspondence with the set of ordered pairs of $$1$$-periodic functions (up to the choice of $$f(0)$$).

Addendum: A question with perhaps a more satisfying answer and along the same lines as yours is how did the answerer come up with this example?, and I would suggest that the guiding principle here is that logarithms allow us to exchange multiplication for addition. So, if we want to find functions with multiplicative periodicity, we expect intuitively that combining an additively periodic function (which most purveyors of mathematics are comfortable with and can readily produce examples of) with a logarithm in some way should do the trick, and we've seen that it indeed does. By finagling with bases, we then easily get any multiplicative period we like.