# Thread: differentiable on integers example

1. ## differentiable on integers example

Hey, I am struggling with coming up with an example of a function that is differentiable on the integers but non-differentiable everywhere else. I have tried looking at various piecewise functions, but none seem to work. I was thinking

f(x)= 0 if x is an integer
f(x)= 1/q if x is rational

and then i don't know what to do if f(x) is irrational.

I know that I am looking for a function that will be discontinuous and therefore nondifferentiable on at non-integer values.

Since I want it to be differentiable on the integers, I want my function to be continuous at the integers.

I know these things, but I cannot seem to connect the dots and it's driving me insane. Please help!

2. Originally Posted by baseballr6
Hey, I am struggling with coming up with an example of a function that is differentiable on the integers but non-differentiable everywhere else. I have tried looking at various piecewise functions, but none seem to work. I was thinking

f(x)= 0 if x is an integer
f(x)= 1/q if x is rational

and then i don't know what to do if f(x) is irrational.

I know that I am looking for a function that will be discontinuous and therefore nondifferentiable on at non-integer values.

Since I want it to be differentiable on the integers, I want my function to be continuous at the integers.

I know these things, but I cannot seem to connect the dots and it's driving me insane. Please help!
Consider the blamange function $b(x)$ on $[0,1]$ (which is continuous but nowhere differentiable), now consider:

$f(x)=x^2(1-x)^2b(x)$

and extend this periodically to the whole real line.

Is this differentiable at integers? (it looks like it to me but I have not checked it as well as I would like)

RonL

3. ## differentiable at every integer #2

I'm still confused at your example. I think I understand what you're trying to do, but I'm not seeing how the function is differentiable at every integer and not differentiable anywhere else. Is there an easier example that would be less difficult to comprehend?

4. Originally Posted by baseballr6
I'm still confused at your example. I think I understand what you're trying to do, but I'm not seeing how the function is differentiable at every integer and not differentiable anywhere else. Is there an easier example that would be less difficult to comprehend?
The blamange function is the best known example of a continuous function differentiable nowhere, I think you are not going to get anything much simpler than my example.

I await someone who will prove me wrong with a simpler example.

RonL