# Function $\Bbb Q\rightarrow\Bbb Q$ with everywhere irrational derivative

As in topic, my question is as follows:

Is there a function $f:\Bbb Q\rightarrow\Bbb Q$ such that $f'(q)$ exists and is irrational for all $q\in\Bbb Q$?

For the sake of completeness, I define $f'(q)$ as the limit of $\lim\limits_{h\rightarrow 0}\frac{f(q+h)-f(q)}{h}$ where $h$ ranges over rational numbers. I don't know of any different "reasonable" definition of derivative for function from $\Bbb Q$ to itself,, but if you can find an example of a function like in question, or prove that there is none, for some different notion of derivative, I would love to see it.

I can't provide much background on this question, it's just something I've been wondering about for the past few days.

Thanks in advance for all feedback.

• @Paul Yes, my bad. – Svetoslav Feb 10 '16 at 15:19
• Just to bo sure: do you define the derivative $f'(q)$ as the limit of $(f(q+h)-f(q))/h$ when a rational $h$ tends to $0$? – Watson Feb 10 '16 at 15:21
• Since functions of the form $\cos ( n \pi x)$ have points that are rational-valued, but with irrational derivatives, I am wondering if Fourier series can help answer this. – Paul Feb 10 '16 at 15:28
• @mercio Could you elaborate? I was thinking about constructing such a function point by point, but I had hard time making derivatives at all points irrational. I have convinced myself that I can make a function which has irrational derivative at one point (and by similar approach at infinitely many points) but it's far from clear to me why I could be able to make derivative irrational at all rationals. – Wojowu Feb 10 '16 at 15:34
• @mercio It seems very likely to me that you're right. But there are details... ? – David C. Ullrich Feb 10 '16 at 15:50

Yes there are many of them.

Let $\alpha$ be any irrational number and let's build a function whose derivative is $\alpha$.

We pick an enumeration of the rationals $\{r_1,r_2,r_3,\ldots\}$ and we will choose each $f(r_n)$ in order. At the same time in order to make $f'(r_n) = \alpha$ we will decide how to squeeze the graph of $f$ near $r_n$

Suppose we have chosen $n$ points and that we have restricted the remaining graph of $f$ to some open set $U_n \subset \Bbb R^2$ where $\pi(U_n) = \Bbb R \setminus \{r_1,\ldots,r_n\}$ ($\pi : \Bbb R^2 \to \Bbb R$ is the projection on the $x$-axis) .

First, we pick a rational value $y_{n+1}$ for $f(r_{n+1})$ such that $(r_{n+1},y_{n+1}) \in U_n$ ($U_n \cap \pi^{-1}(r_{n+1})$ is nonempty by the induction hypothesis, and $U_n$ is open, so we can find a rational value in there).

Next, we choose two parabolas tangent at $(r_{n+1},y_{n+1})$ with slope $\alpha$ (one of them upside down) and in particular we choose their leading coefficient large enough (in absolute value) so that the upper parabola doesn't meet the lower border of $U_n$ and the lower parabola doesn't meet the upper border of $U_n$ (those borders are a finite number of parabola pieces so this is possible).

Then we choose $U_{n+1}$ to be the interection of $U_n$ and the region between the two parabolas. Then $\pi(U_{n+1}) = \pi(U_n) \setminus \{r_{n+1}\}$, and any function whose graph stays in $U_{n+1}$ will have a derivative $\alpha$ at $r_{n+1}$.

Once we have done this for every $n$, we have a function $\Bbb Q \to \Bbb Q$ "differentiable" everywhere with derivative $\alpha$.

Though, it might not look good and it may not have a continuous extension to $\Bbb R$. Heck, you can even choose any function $g : \Bbb Q \to \Bbb R$ and force $f' = g$

• To be honest, I don't see how you can arrange for your parabola to "not meet the lower border of $U_n$" just by suitably choosing the leading coefficient correctly. The larger you choose the leading coefficient, the smaller (negative!) the "absolute" or "linear" coefficients will become. Can this not screw you? – PhoemueX Feb 10 '16 at 18:29
• give large positive leading coefficients to all the upper parabolas and large negative (like -10^100 if that's not clear) leading coefficients to all the lower parabolas. Think about the parabolas geometrically. The larger the leading coefficient of the upper parabola is, the thinner it is and the faster it tries to escape to infinity (crossing the upper border) and eventually it won't touch the lower border. – mercio Feb 10 '16 at 18:39
• oh i see, what is not clear is that the minimum of the parabola doesn't dip super low below $(r_n,y_n)$ ? – mercio Feb 10 '16 at 18:40
• Ok, I now see it algebraically: We can choose $p_n (x) = A (x-r_n)^2 + \alpha (x-r_n) + y_n$, where $A$ can be chosen arbitrary. Now, the last two terms in the sum are fixed and the term $A (x-r_n)^2$ goes to infinity as $A\to \infty$ and $x\neq r_n$. – PhoemueX Feb 10 '16 at 18:46
• That's exactly what I was gonna say... – David C. Ullrich Feb 10 '16 at 21:38